Unverified Commit c306c88e authored by Theodore Ni's avatar Theodore Ni Committed by GitHub
Browse files

Merge pull request #247064 from tjni/cmake

python3.pkgs.cmake: init stub at 3.26.4
parents ffe4cde3 d8569354
Loading
Loading
Loading
Loading
+42 −0
Original line number Diff line number Diff line
{ 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 −0
Original line number Diff line number Diff line
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 −0
Original line number Diff line number Diff line
[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"
+8 −2
Original line number Diff line number Diff line
@@ -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 { };

@@ -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 { };
@@ -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 { };