toml-f: 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,12 +3,21 @@
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
gfortran,
|
||||
buildType ? "meson",
|
||||
meson,
|
||||
ninja,
|
||||
cmake,
|
||||
pkg-config,
|
||||
test-drive,
|
||||
}:
|
||||
|
||||
assert (
|
||||
builtins.elem buildType [
|
||||
"meson"
|
||||
"cmake"
|
||||
]
|
||||
);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "toml-f";
|
||||
version = "0.4.2";
|
||||
@@ -20,12 +29,20 @@ stdenv.mkDerivation rec {
|
||||
hash = "sha256-+cac4rUNpd2w3yBdH1XoCKdJ9IgOHZioZg8AhzGY0FE=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix wrong generation of package config include paths
|
||||
./cmake.patch
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
gfortran
|
||||
pkg-config
|
||||
]
|
||||
++ lib.optionals (buildType == "meson") [
|
||||
meson
|
||||
ninja
|
||||
pkg-config
|
||||
];
|
||||
]
|
||||
++ lib.optional (buildType == "cmake") cmake;
|
||||
|
||||
buildInputs = [ test-drive ];
|
||||
|
||||
@@ -34,6 +51,10 @@ stdenv.mkDerivation rec {
|
||||
"dev"
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
"-Dtest-drive_DIR=${test-drive}"
|
||||
];
|
||||
|
||||
# tftest-build fails on aarch64-linux
|
||||
doCheck = !stdenv.hostPlatform.isAarch64;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user