test-drive: add option to build with cmake in addition to meson
This commit is contained in:
@@ -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@
|
||||
@@ -3,11 +3,20 @@
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
gfortran,
|
||||
buildType ? "meson",
|
||||
meson,
|
||||
ninja,
|
||||
cmake,
|
||||
mesonEmulatorHook,
|
||||
}:
|
||||
|
||||
assert (
|
||||
builtins.elem buildType [
|
||||
"meson"
|
||||
"cmake"
|
||||
]
|
||||
);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "test-drive";
|
||||
version = "0.5.0";
|
||||
@@ -19,14 +28,20 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-xRx8ErIN9xjxZt/nEsdIQkIGFRltuELdlI8lXA+M030=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix wrong generation of package config include paths
|
||||
./cmake.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
gfortran
|
||||
]
|
||||
++ lib.optionals (buildType == "meson") [
|
||||
meson
|
||||
ninja
|
||||
]
|
||||
++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
||||
mesonEmulatorHook
|
||||
];
|
||||
++ lib.optional (buildType == "cmake") cmake
|
||||
++ lib.optional (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) mesonEmulatorHook;
|
||||
|
||||
mesonAutoFeatures = "auto";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user