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 diff --git a/pkgs/development/libraries/science/chemistry/mctc-lib/default.nix b/pkgs/development/libraries/science/chemistry/mctc-lib/default.nix index aeb7c8bb6f56..a3726ea5e5dd 100644 --- a/pkgs/development/libraries/science/chemistry/mctc-lib/default.nix +++ b/pkgs/development/libraries/science/chemistry/mctc-lib/default.nix @@ -22,11 +22,18 @@ stdenv.mkDerivation rec { buildInputs = [ json-fortran ]; - 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; meta = with lib; { diff --git a/pkgs/development/libraries/science/chemistry/mstore/default.nix b/pkgs/development/libraries/science/chemistry/mstore/default.nix index 86e03df16b0e..948d11435461 100644 --- a/pkgs/development/libraries/science/chemistry/mstore/default.nix +++ b/pkgs/development/libraries/science/chemistry/mstore/default.nix @@ -21,11 +21,18 @@ stdenv.mkDerivation rec { buildInputs = [ mctc-lib ]; - 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"}" + ]; + meta = with lib; { description = "Molecular structure store for testing"; license = licenses.asl20; diff --git a/pkgs/development/libraries/science/chemistry/multicharge/default.nix b/pkgs/development/libraries/science/chemistry/multicharge/default.nix index f61f11225f1b..b90f073a4f2e 100644 --- a/pkgs/development/libraries/science/chemistry/multicharge/default.nix +++ b/pkgs/development/libraries/science/chemistry/multicharge/default.nix @@ -26,11 +26,18 @@ stdenv.mkDerivation rec { buildInputs = [ blas lapack mctc-lib mstore ]; - 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 diff --git a/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix b/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix index 1f5e4b250a91..ae5e30d73608 100644 --- a/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix +++ b/pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix @@ -26,10 +26,16 @@ stdenv.mkDerivation rec { buildInputs = [ mctc-lib mstore toml-f blas ]; - postInstall = '' - substituteInPlace $out/lib/pkgconfig/s-dftd3.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 = '' diff --git a/pkgs/development/libraries/science/chemistry/tblite/default.nix b/pkgs/development/libraries/science/chemistry/tblite/default.nix index 7cc64937dc13..bea5793addbf 100644 --- a/pkgs/development/libraries/science/chemistry/tblite/default.nix +++ b/pkgs/development/libraries/science/chemistry/tblite/default.nix @@ -35,6 +35,12 @@ stdenv.mkDerivation rec { }) ]; + # Fix the Pkg-Config files for doubled store paths + postPatch = '' + substituteInPlace config/template.pc \ + --replace "\''${prefix}/" "" + ''; + nativeBuildInputs = [ cmake gfortran ]; buildInputs = [ @@ -48,16 +54,17 @@ stdenv.mkDerivation rec { simple-dftd3 ]; + outputs = [ "out" "dev" ]; + + cmakeFlags = [ + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" + ]; + doCheck = true; preCheck = '' export OMP_NUM_THREADS=2 ''; - postInstall = '' - substituteInPlace $out/lib/pkgconfig/${pname}.pc \ - --replace "''${prefix}" "" - ''; - meta = with lib; { description = "Light-weight tight-binding framework"; license = with licenses; [ gpl3Plus lgpl3Plus ]; diff --git a/pkgs/development/libraries/toml-f/default.nix b/pkgs/development/libraries/toml-f/default.nix index ed6fc26ee205..28fb3dadce48 100644 --- a/pkgs/development/libraries/toml-f/default.nix +++ b/pkgs/development/libraries/toml-f/default.nix @@ -21,11 +21,18 @@ stdenv.mkDerivation rec { buildInputs = [ test-drive ]; - 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; meta = with lib; {