about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authormarkuskowa <markus.kowalewski@gmail.com>2024-01-12 18:24:12 +0100
committerGitHub <noreply@github.com>2024-01-12 18:24:12 +0100
commit952b3d0971f2a13abd9ee9564ee52ceaebdd3c07 (patch)
treee751de6730c26b1b5191115fa23373885cff6c6e /pkgs
parentcdcd061e7f312304de5391bf2a01d8c705206eaf (diff)
parentdc237ef7f577bada0022109bed5727d7f74effa6 (diff)
Merge pull request #280045 from sheepforce/fortran-dynamic
fortran tight-binding ecosystem: enable static/dynamic builds depending on hostPlatform
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/libraries/science/chemistry/dftd4/default.nix13
-rw-r--r--pkgs/development/libraries/science/chemistry/mctc-lib/default.nix13
-rw-r--r--pkgs/development/libraries/science/chemistry/mstore/default.nix13
-rw-r--r--pkgs/development/libraries/science/chemistry/multicharge/default.nix13
-rw-r--r--pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix12
-rw-r--r--pkgs/development/libraries/science/chemistry/tblite/default.nix17
-rw-r--r--pkgs/development/libraries/toml-f/default.nix13
7 files changed, 71 insertions, 23 deletions
diff --git a/pkgs/development/libraries/science/chemistry/dftd4/default.nix b/pkgs/development/libraries/science/chemistry/dftd4/default.nix
index 52c9b4de20a55..d791a7d4e3d60 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 aeb7c8bb6f56d..a3726ea5e5dd6 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 86e03df16b0e9..948d11435461d 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 f61f11225f1b8..b90f073a4f2e9 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 1f5e4b250a917..ae5e30d736089 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 7cc64937dc131..bea5793addbf6 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 ed6fc26ee2056..28fb3dadce48b 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; {