From 5543645978aad3d26e9da77fc6e24363af494c4d Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 12 Sep 2024 02:13:36 +0300 Subject: [PATCH 1/2] openmpi: fix cross eval `error: attribute 'gfortran' missing` because `__raw` `targetPackages` only contains `stdenv` --- pkgs/development/libraries/openmpi/default.nix | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix index ea98064820c2..7725be4c8000 100644 --- a/pkgs/development/libraries/openmpi/default.nix +++ b/pkgs/development/libraries/openmpi/default.nix @@ -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 From 66538a85a0fcbd2ef0afba3465068c93ecfaf1a0 Mon Sep 17 00:00:00 2001 From: Artturin Date: Thu, 12 Sep 2024 02:18:43 +0300 Subject: [PATCH 2/2] openmpi: fix `pkgsStatic` eval The dependencies to `openmpi` don't build anyways, so it's fine if this doesn't work as long as it evals without attribute missing errors. `error: attribute 'sharedLibrary' missing` --- pkgs/development/libraries/openmpi/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix index 7725be4c8000..0ae1118a36b0 100644 --- a/pkgs/development/libraries/openmpi/default.nix +++ b/pkgs/development/libraries/openmpi/default.nix @@ -240,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" \