From dc237ef7f577bada0022109bed5727d7f74effa6 Mon Sep 17 00:00:00 2001 From: Phillip Seeber Date: Thu, 11 Jan 2024 17:29:59 +0100 Subject: [PATCH] dftd4: enable shared builds on !isStatic platforms --- .../libraries/science/chemistry/dftd4/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/science/chemistry/dftd4/default.nix b/pkgs/development/libraries/science/chemistry/dftd4/default.nix index 52c9b4de20a5..d791a7d4e3d6 100644 --- a/pkgs/development/libraries/science/chemistry/dftd4/default.nix +++ b/pkgs/development/libraries/science/chemistry/dftd4/default.nix @@ -27,11 +27,18 @@ stdenv.mkDerivation rec { buildInputs = [ blas lapack mctc-lib mstore multicharge ]; - postInstall = '' - substituteInPlace $out/lib/pkgconfig/${pname}.pc \ - --replace "''${prefix}/" "" + outputs = [ "out" "dev" ]; + + # Fix the Pkg-Config files for doubled store paths + postPatch = '' + substituteInPlace config/template.pc \ + --replace "\''${prefix}/" "" ''; + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" + ]; + doCheck = true; preCheck = '' export OMP_NUM_THREADS=2