pmix: put substitution & wrapping in install & fixup respectively

Make it match the same pattern as in openmpi.
This commit is contained in:
Doron Behar
2024-08-08 07:33:21 +03:00
parent 97a89f6d19
commit 7c18982822
+10 -10
View File
@@ -80,11 +80,11 @@ stdenv.mkDerivation (finalAttrs: {
moveToOutput "bin/pmixcc" "''${!outputDev}"
moveToOutput "share/pmix/pmixcc-wrapper-data.txt" "''${!outputDev}"
# The path to the pmixcc-wrapper-data.txt is hard coded and
# points to $out instead of dev. Use wrapper to fix paths.
wrapProgram "''${!outputDev}"/bin/pmixcc \
--set PMIX_INCLUDEDIR "''${!outputDev}"/include \
--set PMIX_PKGDATADIR "''${!outputDev}"/share/pmix
# Pin the compiler to the current version in a cross compiler friendly way.
# Same pattern as for openmpi (see https://github.com/NixOS/nixpkgs/pull/58964#discussion_r275059427).
substituteInPlace "''${!outputDev}"/share/pmix/pmixcc-wrapper-data.txt \
--replace-fail compiler=gcc \
compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc
'';
postFixup = ''
@@ -92,11 +92,11 @@ stdenv.mkDerivation (finalAttrs: {
# into the library. This clears all references to $dev/include.
remove-references-to -t "''${!outputDev}" $(readlink -f $out/lib/libpmix.so)
# Pin the compiler to the current version in a cross compiler friendly way.
# Same pattern as for openmpi (see https://github.com/NixOS/nixpkgs/pull/58964#discussion_r275059427).
substituteInPlace "''${!outputDev}"/share/pmix/pmixcc-wrapper-data.txt \
--replace-fail compiler=gcc \
compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc
# The path to the pmixcc-wrapper-data.txt is hard coded and
# points to $out instead of dev. Use wrapper to fix paths.
wrapProgram "''${!outputDev}"/bin/pmixcc \
--set PMIX_INCLUDEDIR "''${!outputDev}"/include \
--set PMIX_PKGDATADIR "''${!outputDev}"/share/pmix
'';
enableParallelBuilding = true;