diff --git a/pkgs/by-name/mu/multicharge/package.nix b/pkgs/by-name/mu/multicharge/package.nix index bd06e5bdc605..b5298015d4e1 100644 --- a/pkgs/by-name/mu/multicharge/package.nix +++ b/pkgs/by-name/mu/multicharge/package.nix @@ -3,8 +3,10 @@ lib, fetchFromGitHub, gfortran, + buildType ? "meson", meson, ninja, + cmake, pkg-config, python3, blas, @@ -14,6 +16,12 @@ }: assert !blas.isILP64 && !lapack.isILP64; +assert ( + builtins.elem buildType [ + "meson" + "cmake" + ] +); stdenv.mkDerivation rec { pname = "multicharge"; @@ -26,17 +34,28 @@ stdenv.mkDerivation rec { hash = "sha256-8qwM3dpvFoL2WrMWNf14zYtRap0ijdfZ95XaTlkHhqQ="; }; + 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 = [ blas lapack + ]; + + propagatedBuildInputs = [ mctc-lib mstore ]; diff --git a/pkgs/by-name/mu/multicharge/pkgconfig.patch b/pkgs/by-name/mu/multicharge/pkgconfig.patch new file mode 100644 index 000000000000..00c7e907733b --- /dev/null +++ b/pkgs/by-name/mu/multicharge/pkgconfig.patch @@ -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@