multicharge: add option to build with cmake in addition to meson

This commit is contained in:
Phillip Seeber
2025-08-25 12:32:47 +02:00
parent e2444c92c9
commit 7834ece92e
2 changed files with 35 additions and 3 deletions
+22 -3
View File
@@ -3,8 +3,10 @@
lib,
fetchFromGitHub,
gfortran,
buildType ? "meson",
meson,
ninja,
cmake,
pkg-config,
python3,
blas,
@@ -14,6 +16,12 @@
}:
assert !blas.isILP64 && !lapack.isILP64;
assert (
builtins.elem buildType [
"meson"
"cmake"
]
);
stdenv.mkDerivation rec {
pname = "multicharge";
@@ -26,17 +34,28 @@ stdenv.mkDerivation rec {
hash = "sha256-8qwM3dpvFoL2WrMWNf14zYtRap0ijdfZ95XaTlkHhqQ=";
};
patches = [
# Fix wrong generation of package config include paths
./pkgconfig.patch
];
nativeBuildInputs = [
gfortran
meson
ninja
pkg-config
python3
];
]
++ lib.optionals (buildType == "meson") [
meson
ninja
]
++ lib.optional (buildType == "cmake") cmake;
buildInputs = [
blas
lapack
];
propagatedBuildInputs = [
mctc-lib
mstore
];
@@ -0,0 +1,13 @@
diff --git a/config/template.pc b/config/template.pc
index 3d6efbb..e338a42 100644
--- a/config/template.pc
+++ b/config/template.pc
@@ -1,6 +1,6 @@
prefix=@CMAKE_INSTALL_PREFIX@
-libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
+libdir=@CMAKE_INSTALL_FULL_LIBDIR@
+includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: @PROJECT_NAME@
Description: @PROJECT_DESCRIPTION@