Skip to content

Commit

Permalink
overrides: added cmake override to build-systems
Browse files Browse the repository at this point in the history
  • Loading branch information
JonBoyleCoding authored and adisbladis committed Jun 20, 2023
1 parent ebf4e53 commit 2e0005c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions overrides/build-systems.json
Original file line number Diff line number Diff line change
Expand Up @@ -3094,6 +3094,10 @@
"cma": [
"setuptools"
],
"cmake": [
"setuptools",
"scikit-build"
],
"cmarkgfm": [
"setuptools"
],
Expand Down
22 changes: 22 additions & 0 deletions overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,28 @@ lib.composeManyExtensions [
)
);

cmake = super.cmake.overridePythonAttrs (
old: rec {
cmake-ver-hashes = version: {
"3.26.3" = "sha256-tlAp/pJlla0pUxWke28YDK5u/Ir/1MKhGHbpvKcWPVA=";
}.${version} or (
lib.warn "Unknown cmake version: '${version}'. Please update cmake-ver-hases." lib.fakeHash
);

cmake-src = pkgs.fetchgit {
url = "https://gitlab.kitware.com/cmake/cmake.git";
rev = "v" + super.cmake.version;
sha256 = cmake-ver-hashes super.cmake.version;
};

nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.cmake pkgs.ninja pkgs.glibc ];
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.cmake ];

CMAKE_ARGS = "-DCMakeProject_SOURCE_DIR='${cmake-src}'";
dontUseCmakeConfigure = true;
}
);

cmdstanpy = super.cmdstanpy.overridePythonAttrs (
old: {
propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ pkgs.cmdstan ];
Expand Down

0 comments on commit 2e0005c

Please sign in to comment.