Merge pull request #280045 from sheepforce/fortran-dynamic

fortran tight-binding ecosystem: enable static/dynamic builds depending on hostPlatform

authored by markuskowa and committed by GitHub 952b3d09 cdcd061e

+71 -23
+10 -3
pkgs/development/libraries/science/chemistry/dftd4/default.nix
··· 27 27 28 28 buildInputs = [ blas lapack mctc-lib mstore multicharge ]; 29 29 30 - postInstall = '' 31 - substituteInPlace $out/lib/pkgconfig/${pname}.pc \ 32 - --replace "''${prefix}/" "" 30 + outputs = [ "out" "dev" ]; 31 + 32 + # Fix the Pkg-Config files for doubled store paths 33 + postPatch = '' 34 + substituteInPlace config/template.pc \ 35 + --replace "\''${prefix}/" "" 33 36 ''; 37 + 38 + cmakeFlags = [ 39 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 40 + ]; 34 41 35 42 doCheck = true; 36 43 preCheck = ''
+10 -3
pkgs/development/libraries/science/chemistry/mctc-lib/default.nix
··· 22 22 23 23 buildInputs = [ json-fortran ]; 24 24 25 - postInstall = '' 26 - substituteInPlace $out/lib/pkgconfig/${pname}.pc \ 27 - --replace "''${prefix}/" "" 25 + outputs = [ "out" "dev" ]; 26 + 27 + # Fix the Pkg-Config files for doubled store paths 28 + postPatch = '' 29 + substituteInPlace config/template.pc \ 30 + --replace "\''${prefix}/" "" 28 31 ''; 32 + 33 + cmakeFlags = [ 34 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 35 + ]; 29 36 30 37 doCheck = true; 31 38
+10 -3
pkgs/development/libraries/science/chemistry/mstore/default.nix
··· 21 21 22 22 buildInputs = [ mctc-lib ]; 23 23 24 - postInstall = '' 25 - substituteInPlace $out/lib/pkgconfig/${pname}.pc \ 26 - --replace "''${prefix}/" "" 24 + outputs = [ "out" "dev" ]; 25 + 26 + # Fix the Pkg-Config files for doubled store paths 27 + postPatch = '' 28 + substituteInPlace config/template.pc \ 29 + --replace "\''${prefix}/" "" 27 30 ''; 31 + 32 + cmakeFlags = [ 33 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 34 + ]; 28 35 29 36 meta = with lib; { 30 37 description = "Molecular structure store for testing";
+10 -3
pkgs/development/libraries/science/chemistry/multicharge/default.nix
··· 26 26 27 27 buildInputs = [ blas lapack mctc-lib mstore ]; 28 28 29 - postInstall = '' 30 - substituteInPlace $out/lib/pkgconfig/${pname}.pc \ 31 - --replace "''${prefix}/" "" 29 + outputs = [ "out" "dev" ]; 30 + 31 + # Fix the Pkg-Config files for doubled store paths 32 + postPatch = '' 33 + substituteInPlace config/template.pc \ 34 + --replace "\''${prefix}/" "" 32 35 ''; 36 + 37 + cmakeFlags = [ 38 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 39 + ]; 33 40 34 41 doCheck = true; 35 42 preCheck = ''
+9 -3
pkgs/development/libraries/science/chemistry/simple-dftd3/default.nix
··· 26 26 27 27 buildInputs = [ mctc-lib mstore toml-f blas ]; 28 28 29 - postInstall = '' 30 - substituteInPlace $out/lib/pkgconfig/s-dftd3.pc \ 31 - --replace "''${prefix}/" "" 29 + outputs = [ "out" "dev" ]; 30 + 31 + # Fix the Pkg-Config files for doubled store paths 32 + postPatch = '' 33 + substituteInPlace config/template.pc \ 34 + --replace "\''${prefix}/" "" 32 35 ''; 36 + cmakeFlags = [ 37 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 38 + ]; 33 39 34 40 doCheck = true; 35 41 preCheck = ''
+12 -5
pkgs/development/libraries/science/chemistry/tblite/default.nix
··· 35 35 }) 36 36 ]; 37 37 38 + # Fix the Pkg-Config files for doubled store paths 39 + postPatch = '' 40 + substituteInPlace config/template.pc \ 41 + --replace "\''${prefix}/" "" 42 + ''; 43 + 38 44 nativeBuildInputs = [ cmake gfortran ]; 39 45 40 46 buildInputs = [ ··· 48 54 simple-dftd3 49 55 ]; 50 56 57 + outputs = [ "out" "dev" ]; 58 + 59 + cmakeFlags = [ 60 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 61 + ]; 62 + 51 63 doCheck = true; 52 64 preCheck = '' 53 65 export OMP_NUM_THREADS=2 54 - ''; 55 - 56 - postInstall = '' 57 - substituteInPlace $out/lib/pkgconfig/${pname}.pc \ 58 - --replace "''${prefix}" "" 59 66 ''; 60 67 61 68 meta = with lib; {
+10 -3
pkgs/development/libraries/toml-f/default.nix
··· 21 21 22 22 buildInputs = [ test-drive ]; 23 23 24 - postInstall = '' 25 - substituteInPlace $out/lib/pkgconfig/${pname}.pc \ 26 - --replace "''${prefix}/" "" 24 + outputs = [ "out" "dev" ]; 25 + 26 + # Fix the Pkg-Config files for doubled store paths 27 + postPatch = '' 28 + substituteInPlace config/template.pc \ 29 + --replace "\''${prefix}/" "" 27 30 ''; 31 + 32 + cmakeFlags = [ 33 + "-DBUILD_SHARED_LIBS=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}" 34 + ]; 28 35 29 36 doCheck = true; 30 37