pmix: use "''${!outputDev}" instead of $dev

This allows disabling multiple outputs more easily, as the first will
evaluate to $out if a "dev" output is not enabled.
This commit is contained in:
Doron Behar
2024-08-08 07:33:21 +03:00
parent 85e1c49cdb
commit 97a89f6d19
+5 -5
View File
@@ -82,19 +82,19 @@ stdenv.mkDerivation (finalAttrs: {
# The path to the pmixcc-wrapper-data.txt is hard coded and
# points to $out instead of dev. Use wrapper to fix paths.
wrapProgram $dev/bin/pmixcc \
--set PMIX_INCLUDEDIR $dev/include \
--set PMIX_PKGDATADIR $dev/share/pmix
wrapProgram "''${!outputDev}"/bin/pmixcc \
--set PMIX_INCLUDEDIR "''${!outputDev}"/include \
--set PMIX_PKGDATADIR "''${!outputDev}"/share/pmix
'';
postFixup = ''
# The build info (parameters to ./configure) are hardcoded
# into the library. This clears all references to $dev/include.
remove-references-to -t $dev $(readlink -f $out/lib/libpmix.so)
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 $dev/share/pmix/pmixcc-wrapper-data.txt \
substituteInPlace "''${!outputDev}"/share/pmix/pmixcc-wrapper-data.txt \
--replace-fail compiler=gcc \
compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc
'';