mstore: 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 67f14b24ee
commit e2444c92c9
2 changed files with 33 additions and 3 deletions
+20 -3
View File
@@ -3,13 +3,22 @@
lib,
fetchFromGitHub,
gfortran,
buildType ? "meson",
meson,
ninja,
cmake,
pkg-config,
python3,
mctc-lib,
}:
assert (
builtins.elem buildType [
"meson"
"cmake"
]
);
stdenv.mkDerivation rec {
pname = "mstore";
version = "0.3.0";
@@ -21,13 +30,21 @@ stdenv.mkDerivation rec {
hash = "sha256-zfrxdrZ1Um52qTRNGJoqZNQuHhK3xM/mKfk0aBLrcjw=";
};
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 = [ mctc-lib ];
+13
View File
@@ -0,0 +1,13 @@
diff --git a/config/template.pc b/config/template.pc
index 800947d..d388699 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@