Merge pull request #244545 from ShamrockLee/xrootd-wrap

xrootd: wrap executables with [DY]LD_LIBRARY_PATH prefix

authored by Dmitry Kalinkin and committed by GitHub 15051381 9fbda9a9

+22 -5
+17 -1
pkgs/tools/networking/xrootd/default.nix
··· 4 4 , fetchFromGitHub 5 5 , cmake 6 6 , cppunit 7 + , makeWrapper 7 8 , pkg-config 8 9 , curl 9 10 , fuse ··· 24 25 }: 25 26 26 27 stdenv.mkDerivation (finalAttrs: { 28 + 29 + __structuredAttrs = true; 30 + 27 31 pname = "xrootd"; 28 32 version = "5.5.5"; 29 33 ··· 55 59 56 60 nativeBuildInputs = [ 57 61 cmake 62 + makeWrapper 58 63 pkg-config 59 64 ]; 60 65 ··· 101 106 "-DENABLE_TESTS=TRUE" 102 107 ]; 103 108 104 - postFixup = lib.optionalString (externalEtc != null) '' 109 + makeWrapperArgs = [ 110 + # Workaround the library-not-found issue 111 + # happening to binaries compiled with xrootd libraries. 112 + # See #169677 113 + "--prefix" "${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH" ":" "${placeholder "out"}/lib" 114 + ]; 115 + 116 + postFixup = '' 117 + while IFS= read -r FILE; do 118 + wrapProgram "$FILE" "''${makeWrapperArgs[@]}" 119 + done < <(find "$bin/bin" -mindepth 1 -maxdepth 1 -type f,l -perm -a+x) 120 + '' + lib.optionalString (externalEtc != null) '' 105 121 mv "$out"/etc{,.orig} 106 122 ln -s ${lib.escapeShellArg externalEtc} "$out/etc" 107 123 '';
+1 -3
pkgs/tools/networking/xrootd/fetchxrd.nix
··· 21 21 inherit url; 22 22 urls = if urls == [ ] then lib.singleton url else urls; 23 23 } 24 - # Set [DY]LD_LIBRARY_PATH to workaround #169677 25 - # TODO: Remove the library path after #200830 get merged 26 24 '' 27 25 for u in $urls; do 28 - ${lib.optionalString buildPlatform.isDarwin "DY"}LD_LIBRARY_PATH=${lib.makeLibraryPath [ xrootd ]} xrdcp --force "$u" "$out" 26 + xrdcp --verbose --force "$u" "$out" 29 27 ret=$? 30 28 (( ret != 0 )) || break 31 29 done
+4 -1
pkgs/top-level/all-packages.nix
··· 2112 2112 2113 2113 xpaste = callPackage ../tools/text/xpaste { }; 2114 2114 2115 - xrootd = callPackage ../tools/networking/xrootd { }; 2115 + xrootd = callPackage ../tools/networking/xrootd { 2116 + # Workaround systemd static build breakage 2117 + systemd = if systemd.meta.broken then null else systemd; 2118 + }; 2116 2119 2117 2120 yabridge = callPackage ../tools/audio/yabridge { 2118 2121 wine = wineWowPackages.staging;