Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions pkgs/development/python-modules/cmake/default.nix
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 pkgs/development/python-modules/cmake/stub/cmake/__init__.py
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:]))
13 changes: 13 additions & 0 deletions pkgs/development/python-modules/cmake/stub/pyproject.toml
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"
10 changes: 8 additions & 2 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,9 @@ self: super: with self; {

awkward = callPackage ../development/python-modules/awkward { };

awkward-cpp = callPackage ../development/python-modules/awkward-cpp { };
awkward-cpp = callPackage ../development/python-modules/awkward-cpp {
inherit (pkgs) cmake;
};

aws-adfs = callPackage ../development/python-modules/aws-adfs { };

Expand Down Expand Up @@ -2033,6 +2035,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 { };
Expand Down Expand Up @@ -11359,7 +11363,9 @@ self: super: with self; {

scikit-build = callPackage ../development/python-modules/scikit-build { };

scikit-build-core = callPackage ../development/python-modules/scikit-build-core { };
scikit-build-core = callPackage ../development/python-modules/scikit-build-core {
inherit (pkgs) cmake;
};

scikit-fmm = callPackage ../development/python-modules/scikit-fmm { };

Expand Down