mstore: add option to build with cmake in addition to meson
This commit is contained in:
@@ -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 ];
|
||||
|
||||
|
||||
@@ -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@
|
||||
Reference in New Issue
Block a user