dftd4: 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@
|
||||
@@ -2,7 +2,10 @@
|
||||
stdenv,
|
||||
lib,
|
||||
fetchFromGitHub,
|
||||
fetchpatch,
|
||||
gfortran,
|
||||
buildType ? "meson",
|
||||
cmake,
|
||||
meson,
|
||||
ninja,
|
||||
pkg-config,
|
||||
@@ -15,6 +18,12 @@
|
||||
}:
|
||||
|
||||
assert !blas.isILP64 && !lapack.isILP64;
|
||||
assert (
|
||||
builtins.elem buildType [
|
||||
"meson"
|
||||
"cmake"
|
||||
]
|
||||
);
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "dftd4";
|
||||
@@ -30,24 +39,37 @@ stdenv.mkDerivation rec {
|
||||
patches = [
|
||||
# Make sure fortran headers are installed directly in /include
|
||||
./fortran-module-dir.patch
|
||||
|
||||
# Fix wrong generation of package config include paths
|
||||
./cmake.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
|
||||
multicharge
|
||||
];
|
||||
|
||||
cmakeFlags = [
|
||||
(lib.strings.cmakeBool "BUILD_SHARED_LIBS" (!stdenv.hostPlatform.isStatic))
|
||||
];
|
||||
|
||||
outputs = [
|
||||
"out"
|
||||
"dev"
|
||||
|
||||
Reference in New Issue
Block a user