From 7b9e11995df355b1fab5d116441c43f9515084f5 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Thu, 1 Feb 2024 09:19:28 +0100 Subject: [PATCH] xrootd: 5.5.5 -> 5.6.6 Changelog: https://github.com/xrootd/xrootd/releases/tag/v5.6.6 Structured attrs don't work with cmakeFlags - only first item is passed. Co-authored-by: Dmitry Kalinkin --- .../science/misc/root/default.nix | 12 +++++ pkgs/tools/networking/xrootd/default.nix | 52 ++++++++++++++----- 2 files changed, 52 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix index c5534c18d7bb..7c9d6f5cb0a6 100644 --- a/pkgs/applications/science/misc/root/default.nix +++ b/pkgs/applications/science/misc/root/default.nix @@ -2,6 +2,7 @@ , lib , callPackage , fetchurl +, fetchpatch , makeWrapper , cmake , coreutils @@ -109,6 +110,17 @@ stdenv.mkDerivation rec { patches = [ ./sw_vers.patch + + # compatibility with recent XRootD + # https://github.com/root-project/root/pull/13752 + (fetchpatch { + url = "https://github.com/root-project/root/commit/3d3cda6c520791282298782189cdb8ca07ace4b9.diff"; + hash = "sha256-O3aXzrOEQiPjZgbAj9TL6Wt/adN1kKFwjooeaFRyT4I="; + }) + (fetchpatch { + url = "https://github.com/root-project/root/commit/6e7798e62dbed1ffa8b91a180fa5a080b7c04ba3.diff"; + hash = "sha256-47/J631DBnVlvM1Pm9iicKXDKAqN8v9hjAstQuHmH8Q="; + }) ]; preConfigure = '' diff --git a/pkgs/tools/networking/xrootd/default.nix b/pkgs/tools/networking/xrootd/default.nix index e32139fdfceb..991b9039860e 100644 --- a/pkgs/tools/networking/xrootd/default.nix +++ b/pkgs/tools/networking/xrootd/default.nix @@ -2,8 +2,10 @@ , stdenv , callPackage , fetchFromGitHub +, davix , cmake , cppunit +, gtest , makeWrapper , pkg-config , curl @@ -14,6 +16,7 @@ , libxml2 , openssl , readline +, scitokens-cpp , systemd , voms , zlib @@ -22,21 +25,19 @@ # If not null, the builder will # move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc. , externalEtc ? "/etc" +, removeReferencesTo }: stdenv.mkDerivation (finalAttrs: { - - __structuredAttrs = true; - pname = "xrootd"; - version = "5.5.5"; + version = "5.6.6"; src = fetchFromGitHub { owner = "xrootd"; repo = "xrootd"; rev = "v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-SLmxv8opN7z4V07S9kLGo8HG7Ql62iZQLtf3zGemwA8="; + hash = "sha256-vSZKTsDMY5bhfniFOQ11VA30gjfb4Y8tCC7JNjNw8Y0="; }; outputs = [ "bin" "out" "dev" "man" ] @@ -62,9 +63,11 @@ stdenv.mkDerivation (finalAttrs: { cmake makeWrapper pkg-config + removeReferencesTo ]; buildInputs = [ + davix curl libkrb5 libuuid @@ -72,7 +75,11 @@ stdenv.mkDerivation (finalAttrs: { libxml2 openssl readline + scitokens-cpp zlib + ] + ++ lib.optionals (!stdenv.isDarwin) [ + # https://github.com/xrootd/xrootd/blob/5b5a1f6957def2816b77ec773c7e1bfb3f1cfc5b/cmake/XRootDFindLibs.cmake#L58 fuse ] ++ lib.optionals stdenv.isLinux [ @@ -80,11 +87,16 @@ stdenv.mkDerivation (finalAttrs: { voms ] ++ lib.optionals enableTestRunner [ + gtest cppunit ]; preConfigure = '' patchShebangs genversion.sh + substituteInPlace cmake/XRootDConfig.cmake.in \ + --replace-fail "@PACKAGE_CMAKE_INSTALL_" "@CMAKE_INSTALL_FULL_" + '' + lib.optionalString stdenv.isDarwin '' + sed -i cmake/XRootDOSDefs.cmake -e '/set( MacOSX TRUE )/ainclude( GNUInstallDirs )' ''; # https://github.com/xrootd/xrootd/blob/master/packaging/rhel/xrootd.spec.in#L665-L675= @@ -98,21 +110,37 @@ stdenv.mkDerivation (finalAttrs: { install -m 644 -t "$out/etc/xrootd/client.plugins.d" ../packaging/common/client-plugin.conf.example mkdir -p "$out/etc/logrotate.d" install -m 644 -T ../packaging/common/xrootd.logrotate "$out/etc/logrotate.d/xrootd" + '' + # Leaving those in bin/ leads to a cyclic reference between $dev and $bin + # This happens since https://github.com/xrootd/xrootd/commit/fe268eb622e2192d54a4230cea54c41660bd5788 + # So far, this xrootd-config script does not seem necessary in $bin + + '' + moveToOutput "bin/xrootd-config" "$dev" + moveToOutput "bin/.xrootd-config-wrapped" "$dev" '' + lib.optionalString stdenv.isLinux '' mkdir -p "$out/lib/systemd/system" install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket ''; - cmakeFlags = lib.optionals enableTestRunner [ + cmakeFlags = [ + "-DXRootD_VERSION_STRING=${finalAttrs.version}" + ] ++ lib.optionals enableTestRunner [ + "-DFORCE_ENABLED=TRUE" + "-DENABLE_DAVIX=TRUE" + "-DENABLE_FUSE=${if (!stdenv.isDarwin) then "TRUE" else "FALSE"}" # not supported + "-DENABLE_MACAROONS=OFF" + "-DENABLE_PYTHON=FALSE" # built separately + "-DENABLE_SCITOKENS=TRUE" "-DENABLE_TESTS=TRUE" + "-DENABLE_VOMS=${if stdenv.isLinux then "TRUE" else "FALSE"}" ]; - makeWrapperArgs = [ - # Workaround the library-not-found issue - # happening to binaries compiled with xrootd libraries. - # See #169677 - "--prefix" "${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH" ":" "${placeholder "out"}/lib" - ]; + # Workaround the library-not-found issue + # happening to binaries compiled with xrootd libraries. + # See #169677 + preFixup = '' + makeWrapperArgs+=("--prefix" "${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH" ":" "${placeholder "out"}/lib") + ''; postFixup = '' while IFS= read -r FILE; do