cp2k: move grimmeCmake packages in cp2k package file (#440159)

This commit is contained in:
Markus Kowalewski
2025-09-04 23:38:30 +02:00
committed by GitHub
4 changed files with 78 additions and 74 deletions
@@ -39,6 +39,12 @@
elpa,
cudaPackages,
rocmPackages,
newScope,
mctc-lib,
jonquil,
multicharge,
mstore,
test-drive,
config,
gpuBackend ? (
if config.cudaSupport then
@@ -60,6 +66,69 @@ assert builtins.elem gpuBackend [
"rocm"
];
let
grimmeCmake = lib.makeScope newScope (self: {
mctc-lib = mctc-lib.override {
buildType = "cmake";
inherit (self) jonquil toml-f;
};
toml-f = toml-f.override {
buildType = "cmake";
inherit (self) test-drive;
};
dftd4 = dftd4.override {
buildType = "cmake";
inherit (self) mstore mctc-lib multicharge;
};
jonquil = jonquil.override {
buildType = "cmake";
inherit (self) toml-f test-drive;
};
mstore = mstore.override {
buildType = "cmake";
inherit (self) mctc-lib;
};
multicharge = multicharge.override {
buildType = "cmake";
inherit (self) mctc-lib mstore;
};
test-drive = test-drive.override { buildType = "cmake"; };
simple-dftd3 = simple-dftd3.override {
buildType = "cmake";
inherit (self) mctc-lib mstore toml-f;
};
tblite = tblite.override {
buildType = "cmake";
inherit (self)
mctc-lib
mstore
toml-f
multicharge
dftd4
simple-dftd3
;
};
sirius = sirius.override {
inherit (self)
mctc-lib
toml-f
multicharge
dftd4
simple-dftd3
;
};
});
in
stdenv.mkDerivation rec {
pname = "cp2k";
version = "2025.2";
@@ -87,19 +156,16 @@ stdenv.mkDerivation rec {
which
makeWrapper
pkg-config
gfortran
]
++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc;
buildInputs = [
gfortran
fftw
gsl
libint
libvori
libxc
dftd4
simple-dftd3
tblite
libxsmm
mpi
spglib
@@ -110,14 +176,17 @@ stdenv.mkDerivation rec {
plumed
zlib
hdf5-fortran
sirius
spla
spfft
libvdwxc
trexio
toml-f
greenx
gmp
grimmeCmake.dftd4
grimmeCmake.simple-dftd3
grimmeCmake.tblite
grimmeCmake.sirius
grimmeCmake.toml-f
]
++ lib.optional enableElpa elpa
++ lib.optionals (gpuBackend == "cuda") [
+3 -68
View File
@@ -14418,74 +14418,9 @@ with pkgs;
siesta-mpi = callPackage ../applications/science/chemistry/siesta { useMpi = true; };
cp2k =
# CP2K requires all dependencies from the Grimme ecosystem to be build with
# CMake instead of Meson. Unfortunately most other consumers require meson
let
grimmeCmake = lib.makeScope pkgs.newScope (self: {
mctc-lib = pkgs.mctc-lib.override {
buildType = "cmake";
inherit (self) jonquil toml-f;
};
toml-f = pkgs.toml-f.override {
buildType = "cmake";
inherit (self) test-drive;
};
dftd4 = pkgs.dftd4.override {
buildType = "cmake";
inherit (self) mstore mctc-lib multicharge;
};
jonquil = pkgs.jonquil.override {
buildType = "cmake";
inherit (self) toml-f test-drive;
};
mstore = pkgs.mstore.override {
buildType = "cmake";
inherit (self) mctc-lib;
};
multicharge = pkgs.multicharge.override {
buildType = "cmake";
inherit (self) mctc-lib mstore;
};
test-drive = pkgs.test-drive.override { buildType = "cmake"; };
simple-dftd3 = pkgs.simple-dftd3.override {
buildType = "cmake";
inherit (self) mctc-lib mstore toml-f;
};
tblite = pkgs.tblite.override {
buildType = "cmake";
inherit (self)
mctc-lib
mstore
toml-f
multicharge
dftd4
simple-dftd3
;
};
sirius = pkgs.sirius.override {
inherit (self)
mctc-lib
toml-f
multicharge
dftd4
simple-dftd3
;
};
});
in
grimmeCmake.callPackage ../applications/science/chemistry/cp2k/default.nix {
libxc = pkgs.libxc_7;
};
cp2k = callPackage ../by-name/cp/cp2k/package.nix {
libxc = pkgs.libxc_7;
};
### SCIENCE/GEOMETRY