mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-02 02:53:55 +00:00
python3.pkgs.cmake: init stub at 3.26.4
I would like this to be as transparent as possible for Python packages, so I'm shadowing the top-level cmake attribute by using the same name as the PyPI package that this replaces.
This commit is contained in:
parent
e7ced4364b
commit
c81c467dce
42
pkgs/development/python-modules/cmake/default.nix
Normal file
42
pkgs/development/python-modules/cmake/default.nix
Normal file
@ -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
pkgs/development/python-modules/cmake/stub/cmake/__init__.py
Normal file
17
pkgs/development/python-modules/cmake/stub/cmake/__init__.py
Normal file
@ -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:]))
|
13
pkgs/development/python-modules/cmake/stub/pyproject.toml
Normal file
13
pkgs/development/python-modules/cmake/stub/pyproject.toml
Normal file
@ -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"
|
@ -2033,6 +2033,8 @@ self: super: with self; {
|
||||
|
||||
cmaes = callPackage ../development/python-modules/cmaes { };
|
||||
|
||||
cmake = callPackage ../development/python-modules/cmake { inherit (pkgs) cmake; };
|
||||
|
||||
cmarkgfm = callPackage ../development/python-modules/cmarkgfm { };
|
||||
|
||||
cmd2 = callPackage ../development/python-modules/cmd2 { };
|
||||
|
Loading…
Reference in New Issue
Block a user