summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShamrock Lee <44064051+ShamrockLee@users.noreply.github.com>2022-12-10 08:28:22 +0800
committerDmitry Kalinkin <dmitry.kalinkin@gmail.com>2023-01-06 06:43:59 -0500
commitcdcc53ab8554b729587e4d1bf1437682008c7766 (patch)
treef6d3eff31dfa440e721062ac036b6be74ba399c7
parentroot: adjust format (diff)
downloadnixpkgs-cdcc53ab8554b729587e4d1bf1437682008c7766.tar.gz
root: add xrootd support and workaround the xrootd runpath bug
(cherry picked from commit f2fcf446d0c5715358749a3e8df723b026ba118b)
-rw-r--r--pkgs/applications/science/misc/root/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix
index 41240a191cf9..e7188e7672c4 100644
--- a/pkgs/applications/science/misc/root/default.nix
+++ b/pkgs/applications/science/misc/root/default.nix
@@ -48,6 +48,7 @@
, patchRcPathFish
, patchRcPathPosix
, tbb
+, xrootd
, Cocoa
, CoreSymbolication
, OpenGL
@@ -113,6 +114,7 @@ stdenv.mkDerivation rec {
patchRcPathPosix
python.pkgs.numpy
tbb
+ xrootd
]
++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
++ lib.optionals (stdenv.isDarwin) [ Cocoa CoreSymbolication OpenGL ]
@@ -195,7 +197,7 @@ stdenv.mkDerivation rec {
"-Dvdt=OFF"
"-Dwebgui=OFF"
"-Dxml=ON"
- "-Dxrootd=OFF"
+ "-Dxrootd=ON"
]
++ lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include"
++ lib.optionals stdenv.isDarwin [
@@ -209,11 +211,13 @@ stdenv.mkDerivation rec {
NIX_LDFLAGS = lib.optionalString (stdenv.isLinux && stdenv.isAarch64 && stdenv.cc.isGNU) "-lgcc";
+ # Workaround the xrootd runpath bug #169677 by prefixing [DY]LD_LIBRARY_PATH with ${lib.makeLibraryPath xrootd}.
+ # TODO: Remove the [DY]LDLIBRARY_PATH prefix for xrootd when #200830 get merged.
postInstall = ''
for prog in rootbrowse rootcp rooteventselector rootls rootmkdir rootmv rootprint rootrm rootslimtree; do
wrapProgram "$out/bin/$prog" \
--set PYTHONPATH "$out/lib" \
- --set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib"
+ --set ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH "$out/lib:${lib.makeLibraryPath [ xrootd ]}"
done
# Make ldd and sed available to the ROOT executable by prefixing PATH.
@@ -222,7 +226,8 @@ stdenv.mkDerivation rec {
gnused # sed
stdenv.cc # c++ ld etc.
stdenv.cc.libc # ldd
- ]}"
+ ]}" \
+ --prefix ${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH : "${lib.makeLibraryPath [ xrootd ]}"
# Patch thisroot.{sh,csh,fish}