openmpi: fix cross&static eval (#341269)

This commit is contained in:
Philip Taron 2024-09-13 05:34:45 -07:00 committed by GitHub
commit d0a26e6356
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -175,7 +175,9 @@ stdenv.mkDerivation (finalAttrs: {
// lib.optionalAttrs fortranSupport {
"fort" = [
"gfortran"
"${targetPackages.gfortran}/bin/${targetPackages.gfortran.targetPrefix}gfortran"
"${targetPackages.gfortran or gfortran}/bin/${
targetPackages.gfortran.targetPrefix or gfortran.targetPrefix
}gfortran"
];
};
# The -wrapper-data.txt files that are not symlinks, need to be iterated as
@ -238,11 +240,11 @@ stdenv.mkDerivation (finalAttrs: {
postFixup =
lib.optionalString (lib.elem "man" finalAttrs.outputs) ''
remove-references-to -t "''${!outputMan}" $(readlink -f $out/lib/libopen-pal${stdenv.hostPlatform.extensions.sharedLibrary})
remove-references-to -t "''${!outputMan}" $(readlink -f $out/lib/libopen-pal${stdenv.hostPlatform.extensions.library})
''
+ lib.optionalString (lib.elem "dev" finalAttrs.outputs) ''
remove-references-to -t "''${!outputDev}" $out/bin/mpirun
remove-references-to -t "''${!outputDev}" $(readlink -f $out/lib/libopen-pal${stdenv.hostPlatform.extensions.sharedLibrary})
remove-references-to -t "''${!outputDev}" $(readlink -f $out/lib/libopen-pal${stdenv.hostPlatform.extensions.library})
# The path to the wrapper is hard coded in libopen-pal.so, which we just cleared.
wrapProgram "''${!outputDev}/bin/opal_wrapper" \