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 , fetchFromGitHub 5 , cmake 6 , cppunit 7 , pkg-config 8 , curl 9 , fuse ··· 24 }: 25 26 stdenv.mkDerivation (finalAttrs: { 27 pname = "xrootd"; 28 version = "5.5.5"; 29 ··· 55 56 nativeBuildInputs = [ 57 cmake 58 pkg-config 59 ]; 60 ··· 101 "-DENABLE_TESTS=TRUE" 102 ]; 103 104 - postFixup = lib.optionalString (externalEtc != null) '' 105 mv "$out"/etc{,.orig} 106 ln -s ${lib.escapeShellArg externalEtc} "$out/etc" 107 '';
··· 4 , fetchFromGitHub 5 , cmake 6 , cppunit 7 + , makeWrapper 8 , pkg-config 9 , curl 10 , fuse ··· 25 }: 26 27 stdenv.mkDerivation (finalAttrs: { 28 + 29 + __structuredAttrs = true; 30 + 31 pname = "xrootd"; 32 version = "5.5.5"; 33 ··· 59 60 nativeBuildInputs = [ 61 cmake 62 + makeWrapper 63 pkg-config 64 ]; 65 ··· 106 "-DENABLE_TESTS=TRUE" 107 ]; 108 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) '' 121 mv "$out"/etc{,.orig} 122 ln -s ${lib.escapeShellArg externalEtc} "$out/etc" 123 '';
+1 -3
pkgs/tools/networking/xrootd/fetchxrd.nix
··· 21 inherit url; 22 urls = if urls == [ ] then lib.singleton url else urls; 23 } 24 - # Set [DY]LD_LIBRARY_PATH to workaround #169677 25 - # TODO: Remove the library path after #200830 get merged 26 '' 27 for u in $urls; do 28 - ${lib.optionalString buildPlatform.isDarwin "DY"}LD_LIBRARY_PATH=${lib.makeLibraryPath [ xrootd ]} xrdcp --force "$u" "$out" 29 ret=$? 30 (( ret != 0 )) || break 31 done
··· 21 inherit url; 22 urls = if urls == [ ] then lib.singleton url else urls; 23 } 24 '' 25 for u in $urls; do 26 + xrdcp --verbose --force "$u" "$out" 27 ret=$? 28 (( ret != 0 )) || break 29 done
+4 -1
pkgs/top-level/all-packages.nix
··· 2112 2113 xpaste = callPackage ../tools/text/xpaste { }; 2114 2115 - xrootd = callPackage ../tools/networking/xrootd { }; 2116 2117 yabridge = callPackage ../tools/audio/yabridge { 2118 wine = wineWowPackages.staging;
··· 2112 2113 xpaste = callPackage ../tools/text/xpaste { }; 2114 2115 + xrootd = callPackage ../tools/networking/xrootd { 2116 + # Workaround systemd static build breakage 2117 + systemd = if systemd.meta.broken then null else systemd; 2118 + }; 2119 2120 yabridge = callPackage ../tools/audio/yabridge { 2121 wine = wineWowPackages.staging;