-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #247064 from tjni/cmake
python3.pkgs.cmake: init stub at 3.26.4
- Loading branch information
Showing
4 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ lib | ||
, buildPythonPackage | ||
, flit-core | ||
, cmake | ||
}: | ||
|
||
buildPythonPackage rec { | ||
pname = "cmake"; | ||
inherit (cmake) version; | ||
format = "pyproject"; | ||
|
||
src = ./stub; | ||
|
||
postUnpack = '' | ||
substituteInPlace "$sourceRoot/pyproject.toml" \ | ||
--subst-var version | ||
substituteInPlace "$sourceRoot/cmake/__init__.py" \ | ||
--subst-var-by CMAKE_BIN_DIR "${cmake}/bin" | ||
''; | ||
|
||
inherit (cmake) setupHooks; | ||
|
||
nativeBuildInputs = [ | ||
flit-core | ||
]; | ||
|
||
pythonImportsCheck = [ | ||
"cmake" | ||
]; | ||
|
||
meta = with lib; { | ||
description = "CMake is an open-source, cross-platform family of tools designed to build, test and package software"; | ||
longDescription = '' | ||
This is a stub of the cmake package on PyPI that uses the cmake program | ||
provided by nixpkgs instead of downloading cmake from the web. | ||
''; | ||
homepage = "https://github.com/scikit-build/cmake-python-distributions"; | ||
license = licenses.asl20; | ||
maintainers = with maintainers; [ tjni ]; | ||
}; | ||
} |
17 changes: 17 additions & 0 deletions
17
pkgs/development/python-modules/cmake/stub/cmake/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import os | ||
import subprocess | ||
import sys | ||
|
||
CMAKE_BIN_DIR = '@CMAKE_BIN_DIR@' | ||
|
||
def _program(name, args): | ||
return subprocess.call([os.path.join(CMAKE_BIN_DIR, name)] + args, close_fds=False) | ||
|
||
def cmake(): | ||
raise SystemExit(_program('cmake', sys.argv[1:])) | ||
|
||
def cpack(): | ||
raise SystemExit(_program('cpack', sys.argv[1:])) | ||
|
||
def ctest(): | ||
raise SystemExit(_program('ctest', sys.argv[1:])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
[build-system] | ||
requires = ["flit_core"] | ||
build-backend = "flit_core.buildapi" | ||
|
||
[project] | ||
name = "cmake" | ||
version = "@version@" | ||
description = "CMake is an open-source, cross-platform family oftools designed to build, test and package software" | ||
|
||
[project.scripts] | ||
cmake = "cmake:cmake" | ||
cpack = "cmake:cpack" | ||
ctest = "cmake:ctest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters