Merge pull request #280045 from sheepforce/fortran-dynamic

fortran tight-binding ecosystem: enable static/dynamic builds depending on hostPlatform
This commit is contained in:
markuskowa 2024-01-12 18:24:12 +01:00 committed by GitHub
commit 952b3d0971
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 71 additions and 23 deletions

View File

@ -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

View File

@ -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; {

View File

@ -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;

View File

@ -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

View File

@ -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 = ''

View File

@ -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 ];

View File

@ -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; {