From 71e47e8a232fc3a4fd1817d33028194ada8d3554 Mon Sep 17 00:00:00 2001 From: Phillip Seeber Date: Thu, 11 Jan 2024 17:29:43 +0100 Subject: [PATCH] mctc-lib: enable shared builds on !isStatic platforms --- .../science/chemistry/mctc-lib/default.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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; {