Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

pmix: split output -> out, dev

This reduces the run time closure from 334 MB to 37.8 MB,
mainly by removing gcc from the closure:

nix path-info -hS
/nix/store/jddsvgvf0ayj5x1df9yaa74lhaz6sjz2-pmix-5.0.1 4.1M 334.2M
/nix/store/n6p56psvwpj419f6cjbdlyiri1mv498f-pmix-5.0.1 2.7M 37.8M

+28 -1
+28 -1
pkgs/development/libraries/pmix/default.nix
··· 1 1 { lib, stdenv, fetchFromGitHub, perl, autoconf, automake 2 - , libtool, python3, flex, libevent, hwloc, munge, zlib, pandoc, gitMinimal 2 + , removeReferencesTo, libtool, python3, flex, libevent 3 + , targetPackages, makeWrapper 4 + , hwloc, munge, zlib, pandoc, gitMinimal 3 5 } : 4 6 5 7 stdenv.mkDerivation rec { ··· 14 16 fetchSubmodules = true; 15 17 }; 16 18 19 + outputs = [ "out" "dev" ]; 20 + 17 21 postPatch = '' 18 22 patchShebangs ./autogen.pl 19 23 patchShebangs ./config ··· 28 32 flex 29 33 gitMinimal 30 34 python3 35 + removeReferencesTo 36 + makeWrapper 31 37 ]; 32 38 33 39 buildInputs = [ libevent hwloc munge zlib ]; ··· 46 52 47 53 postInstall = '' 48 54 find $out/lib/ -name "*.la" -exec rm -f \{} \; 55 + 56 + moveToOutput "bin/pmix_info" "''${!outputDev}" 57 + moveToOutput "bin/pmixcc" "''${!outputDev}" 58 + moveToOutput "share/pmix/pmixcc-wrapper-data.txt" "''${!outputDev}" 59 + 60 + # The path to the pmixcc-wrapper-data.txt is hard coded and 61 + # points to $out instead of dev. Use wrapper to fix paths. 62 + wrapProgram $dev/bin/pmixcc \ 63 + --set PMIX_INCLUDEDIR $dev/include \ 64 + --set PMIX_PKGDATADIR $dev/share/pmix 65 + ''; 66 + 67 + postFixup = '' 68 + # The build info (parameters to ./configure) are hardcoded 69 + # into the library. This clears all references to $dev/include. 70 + remove-references-to -t $dev $(readlink -f $out/lib/libpmix.so) 71 + 72 + # Pin the compiler to the current version in a cross compiler friendly way. 73 + # Same pattern as for openmpi (see https://github.com/NixOS/nixpkgs/pull/58964#discussion_r275059427). 74 + sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \ 75 + $dev/share/pmix/pmixcc-wrapper-data.txt 49 76 ''; 50 77 51 78 enableParallelBuilding = true;