From 4c91cc87e40d753e3cf4b40e7ee73ac6f731dc2b Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 2 Oct 2024 16:25:44 +0200 Subject: [PATCH 1/7] xrootd: move to by-name --- pkgs/{tools/networking => by-name/xr}/xrootd/fetchxrd.nix | 0 .../xrootd/default.nix => by-name/xr/xrootd/package.nix} | 0 pkgs/{tools/networking => by-name/xr}/xrootd/test-runner.nix | 0 pkgs/top-level/all-packages.nix | 2 +- 4 files changed, 1 insertion(+), 1 deletion(-) rename pkgs/{tools/networking => by-name/xr}/xrootd/fetchxrd.nix (100%) rename pkgs/{tools/networking/xrootd/default.nix => by-name/xr/xrootd/package.nix} (100%) rename pkgs/{tools/networking => by-name/xr}/xrootd/test-runner.nix (100%) diff --git a/pkgs/tools/networking/xrootd/fetchxrd.nix b/pkgs/by-name/xr/xrootd/fetchxrd.nix similarity index 100% rename from pkgs/tools/networking/xrootd/fetchxrd.nix rename to pkgs/by-name/xr/xrootd/fetchxrd.nix diff --git a/pkgs/tools/networking/xrootd/default.nix b/pkgs/by-name/xr/xrootd/package.nix similarity index 100% rename from pkgs/tools/networking/xrootd/default.nix rename to pkgs/by-name/xr/xrootd/package.nix diff --git a/pkgs/tools/networking/xrootd/test-runner.nix b/pkgs/by-name/xr/xrootd/test-runner.nix similarity index 100% rename from pkgs/tools/networking/xrootd/test-runner.nix rename to pkgs/by-name/xr/xrootd/test-runner.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 67153be49f77..a7845ea4b64b 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2038,7 +2038,7 @@ with pkgs; xpaste = callPackage ../tools/text/xpaste { }; - xrootd = callPackage ../tools/networking/xrootd { + xrootd = callPackage ../by-name/xr/xrootd/package.nix { # Workaround systemd static build breakage systemd = if systemd.meta.broken then null else systemd; }; From 7c3a580f90eae20f804c9164c5d81000c0f59af7 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 2 Oct 2024 16:27:36 +0200 Subject: [PATCH 2/7] xrootd: format --- pkgs/by-name/xr/xrootd/package.nix | 217 +++++++++++++++-------------- 1 file changed, 116 insertions(+), 101 deletions(-) diff --git a/pkgs/by-name/xr/xrootd/package.nix b/pkgs/by-name/xr/xrootd/package.nix index 60da8d7e6e21..af98c5717ca9 100644 --- a/pkgs/by-name/xr/xrootd/package.nix +++ b/pkgs/by-name/xr/xrootd/package.nix @@ -1,31 +1,32 @@ -{ lib -, stdenv -, callPackage -, fetchFromGitHub -, davix -, cmake -, cppunit -, gtest -, makeWrapper -, pkg-config -, curl -, fuse -, libkrb5 -, libuuid -, libxcrypt -, libxml2 -, openssl -, readline -, scitokens-cpp -, systemd -, voms -, zlib +{ + lib, + stdenv, + callPackage, + fetchFromGitHub, + davix, + cmake, + cppunit, + gtest, + makeWrapper, + pkg-config, + curl, + fuse, + libkrb5, + libuuid, + libxcrypt, + libxml2, + openssl, + readline, + scitokens-cpp, + systemd, + voms, + zlib, # Build bin/test-runner -, enableTestRunner ? true + enableTestRunner ? true, # If not null, the builder will # move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc. -, externalEtc ? "/etc" -, removeReferencesTo + externalEtc ? "/etc", + removeReferencesTo, }: stdenv.mkDerivation (finalAttrs: { @@ -40,24 +41,31 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-vSZKTsDMY5bhfniFOQ11VA30gjfb4Y8tCC7JNjNw8Y0="; }; - outputs = [ "bin" "out" "dev" "man" ] - ++ lib.optional (externalEtc != null) "etc"; + outputs = [ + "bin" + "out" + "dev" + "man" + ] ++ lib.optional (externalEtc != null) "etc"; passthru.fetchxrd = callPackage ./fetchxrd.nix { xrootd = finalAttrs.finalPackage; }; passthru.tests = lib.optionalAttrs stdenv.hostPlatform.isLinux { test-runner = callPackage ./test-runner.nix { xrootd = finalAttrs.finalPackage; }; - } // { - test-xrdcp = finalAttrs.passthru.fetchxrd { - pname = "xrootd-test-xrdcp"; - # Use the the bin output hash of xrootd as version to ensure that - # the test gets rebuild everytime xrootd gets rebuild - version = finalAttrs.version + "-" + builtins.substring (builtins.stringLength builtins.storeDir + 1) 32 "${finalAttrs.finalPackage}"; - url = "root://eospublic.cern.ch//eos/opendata/alice/2010/LHC10h/000138275/ESD/0000/AliESDs.root"; - hash = "sha256-tIcs2oi+8u/Qr+P7AAaPTbQT+DEt26gEdc4VNerlEHY="; + } + // { + test-xrdcp = finalAttrs.passthru.fetchxrd { + pname = "xrootd-test-xrdcp"; + # Use the the bin output hash of xrootd as version to ensure that + # the test gets rebuild everytime xrootd gets rebuild + version = + finalAttrs.version + + "-" + + builtins.substring (builtins.stringLength builtins.storeDir + 1) 32 "${finalAttrs.finalPackage}"; + url = "root://eospublic.cern.ch//eos/opendata/alice/2010/LHC10h/000138275/ESD/0000/AliESDs.root"; + hash = "sha256-tIcs2oi+8u/Qr+P7AAaPTbQT+DEt26gEdc4VNerlEHY="; + }; }; - } - ; nativeBuildInputs = [ cmake @@ -66,74 +74,81 @@ stdenv.mkDerivation (finalAttrs: { removeReferencesTo ]; - buildInputs = [ - davix - curl - libkrb5 - libuuid - libxcrypt - libxml2 - openssl - readline - scitokens-cpp - zlib - ] - ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - # https://github.com/xrootd/xrootd/blob/5b5a1f6957def2816b77ec773c7e1bfb3f1cfc5b/cmake/XRootDFindLibs.cmake#L58 - fuse - ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - systemd - voms - ] - ++ lib.optionals enableTestRunner [ - gtest - cppunit - ]; + buildInputs = + [ + davix + curl + libkrb5 + libuuid + libxcrypt + libxml2 + openssl + readline + scitokens-cpp + zlib + ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ + # https://github.com/xrootd/xrootd/blob/5b5a1f6957def2816b77ec773c7e1bfb3f1cfc5b/cmake/XRootDFindLibs.cmake#L58 + fuse + ] + ++ lib.optionals stdenv.hostPlatform.isLinux [ + systemd + 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.hostPlatform.isDarwin '' - sed -i cmake/XRootDOSDefs.cmake -e '/set( MacOSX TRUE )/ainclude( GNUInstallDirs )' - ''; + preConfigure = + '' + patchShebangs genversion.sh + substituteInPlace cmake/XRootDConfig.cmake.in \ + --replace-fail "@PACKAGE_CMAKE_INSTALL_" "@CMAKE_INSTALL_FULL_" + '' + + lib.optionalString stdenv.hostPlatform.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= - postInstall = '' - mkdir -p "$out/lib/tmpfiles.d" - install -m 644 -T ../packaging/rhel/xrootd.tmpfiles "$out/lib/tmpfiles.d/xrootd.conf" - mkdir -p "$out/etc/xrootd" - install -m 644 -t "$out/etc/xrootd" ../packaging/common/*.cfg - install -m 644 -t "$out/etc/xrootd" ../packaging/common/client.conf - mkdir -p "$out/etc/xrootd/client.plugins.d" - 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.hostPlatform.isLinux '' - mkdir -p "$out/lib/systemd/system" - install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket - ''; + postInstall = + '' + mkdir -p "$out/lib/tmpfiles.d" + install -m 644 -T ../packaging/rhel/xrootd.tmpfiles "$out/lib/tmpfiles.d/xrootd.conf" + mkdir -p "$out/etc/xrootd" + install -m 644 -t "$out/etc/xrootd" ../packaging/common/*.cfg + install -m 644 -t "$out/etc/xrootd" ../packaging/common/client.conf + mkdir -p "$out/etc/xrootd/client.plugins.d" + 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.hostPlatform.isLinux '' + mkdir -p "$out/lib/systemd/system" + install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket + ''; - cmakeFlags = [ - "-DXRootD_VERSION_STRING=${finalAttrs.version}" - ] ++ lib.optionals enableTestRunner [ - "-DFORCE_ENABLED=TRUE" - "-DENABLE_DAVIX=TRUE" - "-DENABLE_FUSE=${if (!stdenv.hostPlatform.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.hostPlatform.isLinux then "TRUE" else "FALSE"}" - ]; + cmakeFlags = + [ + "-DXRootD_VERSION_STRING=${finalAttrs.version}" + ] + ++ lib.optionals enableTestRunner [ + "-DFORCE_ENABLED=TRUE" + "-DENABLE_DAVIX=TRUE" + "-DENABLE_FUSE=${if (!stdenv.hostPlatform.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.hostPlatform.isLinux then "TRUE" else "FALSE"}" + ]; postFixup = lib.optionalString (externalEtc != null) '' moveToOutput etc "$etc" From 93d374121eaa640b5263459f0337952b46a0b91f Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 2 Oct 2024 16:28:23 +0200 Subject: [PATCH 3/7] xrootd: 5.6.6 -> 5.7.1 Diff: https://github.com/xrootd/xrootd/compare/v5.6.6...v5.7.1 Changelog: https://github.com/xrootd/xrootd/releases/tag/v5.7.1 --- pkgs/by-name/xr/xrootd/package.nix | 73 +++++++++++++++--------------- pkgs/top-level/all-packages.nix | 5 -- 2 files changed, 37 insertions(+), 41 deletions(-) diff --git a/pkgs/by-name/xr/xrootd/package.nix b/pkgs/by-name/xr/xrootd/package.nix index af98c5717ca9..d59dd6f6b32d 100644 --- a/pkgs/by-name/xr/xrootd/package.nix +++ b/pkgs/by-name/xr/xrootd/package.nix @@ -10,6 +10,7 @@ makeWrapper, pkg-config, curl, + isa-l, fuse, libkrb5, libuuid, @@ -31,16 +32,26 @@ stdenv.mkDerivation (finalAttrs: { pname = "xrootd"; - version = "5.6.6"; + version = "5.7.1"; src = fetchFromGitHub { owner = "xrootd"; repo = "xrootd"; - rev = "v${finalAttrs.version}"; + rev = "refs/tags/v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-vSZKTsDMY5bhfniFOQ11VA30gjfb4Y8tCC7JNjNw8Y0="; + hash = "sha256-ZU31nsQgs+Gz9mV8LVv4utJ7g8TXN5OxHjNDfQlt38M="; }; + postPatch = + '' + patchShebangs genversion.sh + substituteInPlace cmake/XRootDConfig.cmake.in \ + --replace-fail "@PACKAGE_CMAKE_INSTALL_" "@CMAKE_INSTALL_FULL_" + '' + + lib.optionalString stdenv.hostPlatform.isDarwin '' + sed -i cmake/XRootDOSDefs.cmake -e '/set( MacOSX TRUE )/ainclude( GNUInstallDirs )' + ''; + outputs = [ "bin" "out" @@ -48,25 +59,6 @@ stdenv.mkDerivation (finalAttrs: { "man" ] ++ lib.optional (externalEtc != null) "etc"; - passthru.fetchxrd = callPackage ./fetchxrd.nix { xrootd = finalAttrs.finalPackage; }; - passthru.tests = - lib.optionalAttrs stdenv.hostPlatform.isLinux { - test-runner = callPackage ./test-runner.nix { xrootd = finalAttrs.finalPackage; }; - } - // { - test-xrdcp = finalAttrs.passthru.fetchxrd { - pname = "xrootd-test-xrdcp"; - # Use the the bin output hash of xrootd as version to ensure that - # the test gets rebuild everytime xrootd gets rebuild - version = - finalAttrs.version - + "-" - + builtins.substring (builtins.stringLength builtins.storeDir + 1) 32 "${finalAttrs.finalPackage}"; - url = "root://eospublic.cern.ch//eos/opendata/alice/2010/LHC10h/000138275/ESD/0000/AliESDs.root"; - hash = "sha256-tIcs2oi+8u/Qr+P7AAaPTbQT+DEt26gEdc4VNerlEHY="; - }; - }; - nativeBuildInputs = [ cmake makeWrapper @@ -78,6 +70,7 @@ stdenv.mkDerivation (finalAttrs: { [ davix curl + isa-l libkrb5 libuuid libxcrypt @@ -100,16 +93,6 @@ stdenv.mkDerivation (finalAttrs: { cppunit ]; - preConfigure = - '' - patchShebangs genversion.sh - substituteInPlace cmake/XRootDConfig.cmake.in \ - --replace-fail "@PACKAGE_CMAKE_INSTALL_" "@CMAKE_INSTALL_FULL_" - '' - + lib.optionalString stdenv.hostPlatform.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= postInstall = '' @@ -157,11 +140,29 @@ stdenv.mkDerivation (finalAttrs: { dontPatchELF = true; # shrinking rpath will cause runtime failures in dlopen - meta = with lib; { + passthru = { + fetchxrd = callPackage ./fetchxrd.nix { xrootd = finalAttrs.finalPackage; }; + tests = { + test-xrdcp = finalAttrs.passthru.fetchxrd { + pname = "xrootd-test-xrdcp"; + # Use the the bin output hash of xrootd as version to ensure that + # the test gets rebuild everytime xrootd gets rebuild + version = + finalAttrs.version + + "-" + + builtins.substring (builtins.stringLength builtins.storeDir + 1) 32 "${finalAttrs.finalPackage}"; + url = "root://eospublic.cern.ch//eos/opendata/alice/2010/LHC10h/000138275/ESD/0000/AliESDs.root"; + hash = "sha256-tIcs2oi+8u/Qr+P7AAaPTbQT+DEt26gEdc4VNerlEHY="; + }; + }; + }; + + meta = { description = "High performance, scalable fault tolerant data access"; homepage = "https://xrootd.slac.stanford.edu"; - license = licenses.lgpl3Plus; - platforms = platforms.all; - maintainers = with maintainers; [ ShamrockLee ]; + changelog = "https://github.com/xrootd/xrootd/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.lgpl3Plus; + platforms = lib.platforms.all; + maintainers = with lib.maintainers; [ ShamrockLee ]; }; }) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a7845ea4b64b..d622af066e0e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -2038,11 +2038,6 @@ with pkgs; xpaste = callPackage ../tools/text/xpaste { }; - xrootd = callPackage ../by-name/xr/xrootd/package.nix { - # Workaround systemd static build breakage - systemd = if systemd.meta.broken then null else systemd; - }; - yabridge = callPackage ../tools/audio/yabridge { wine = wineWowPackages.staging; }; From 3f9372d31b8eee1aa470c1085dac6ad2f67e0dfc Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 4 Oct 2024 00:59:55 +0800 Subject: [PATCH 4/7] xrootd: fix the cmake flags influenced by enableTestRunner --- pkgs/by-name/xr/xrootd/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/xr/xrootd/package.nix b/pkgs/by-name/xr/xrootd/package.nix index d59dd6f6b32d..4487db9b5697 100644 --- a/pkgs/by-name/xr/xrootd/package.nix +++ b/pkgs/by-name/xr/xrootd/package.nix @@ -121,16 +121,16 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ "-DXRootD_VERSION_STRING=${finalAttrs.version}" - ] - ++ lib.optionals enableTestRunner [ "-DFORCE_ENABLED=TRUE" "-DENABLE_DAVIX=TRUE" "-DENABLE_FUSE=${if (!stdenv.hostPlatform.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.hostPlatform.isLinux then "TRUE" else "FALSE"}" + ] + ++ lib.optionals enableTestRunner [ + "-DENABLE_TESTS=TRUE" ]; postFixup = lib.optionalString (externalEtc != null) '' From 4a13a18e28f2decbe96cf10f6f9222e5a13a8977 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 4 Oct 2024 01:12:18 +0800 Subject: [PATCH 5/7] xrootd: modernize cmakeFlags Use lib.cmakeBool and lib.cmakeFeatures instead of if TRUE else FALSE. --- pkgs/by-name/xr/xrootd/package.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/xr/xrootd/package.nix b/pkgs/by-name/xr/xrootd/package.nix index 4487db9b5697..308a389eae47 100644 --- a/pkgs/by-name/xr/xrootd/package.nix +++ b/pkgs/by-name/xr/xrootd/package.nix @@ -120,17 +120,17 @@ stdenv.mkDerivation (finalAttrs: { cmakeFlags = [ - "-DXRootD_VERSION_STRING=${finalAttrs.version}" - "-DFORCE_ENABLED=TRUE" - "-DENABLE_DAVIX=TRUE" - "-DENABLE_FUSE=${if (!stdenv.hostPlatform.isDarwin) then "TRUE" else "FALSE"}" # not supported - "-DENABLE_MACAROONS=OFF" - "-DENABLE_PYTHON=FALSE" # built separately - "-DENABLE_SCITOKENS=TRUE" - "-DENABLE_VOMS=${if stdenv.hostPlatform.isLinux then "TRUE" else "FALSE"}" + (lib.cmakeFeature "XRootD_VERSION_STRING" finalAttrs.version) + (lib.cmakeBool "FORCE_ENABLED" true) + (lib.cmakeBool "ENABLE_DAVIX" true) + (lib.cmakeBool "ENABLE_FUSE" (!stdenv.hostPlatform.isDarwin)) # XRootD doesn't support MacFUSE + (lib.cmakeBool "ENABLE_MACAROONS" false) + (lib.cmakeBool "ENABLE_PYTHON" false) # built separately + (lib.cmakeBool "ENABLE_SCITOKENS" true) + (lib.cmakeBool "ENABLE_VOMS" stdenv.hostPlatform.isLinux) ] ++ lib.optionals enableTestRunner [ - "-DENABLE_TESTS=TRUE" + (lib.cmakeBool "ENABLE_TESTS" true) ]; postFixup = lib.optionalString (externalEtc != null) '' From 685c8307326eccb5fc7ac61f1032871020791833 Mon Sep 17 00:00:00 2001 From: Yueh-Shun Li Date: Fri, 4 Oct 2024 12:14:24 +0800 Subject: [PATCH 6/7] xrootd: remove test-runner XRootD 5.7.1 no longer provides bin/test-runner. --- pkgs/by-name/xr/xrootd/package.nix | 36 +++++++++++--------------- pkgs/by-name/xr/xrootd/test-runner.nix | 24 ----------------- 2 files changed, 15 insertions(+), 45 deletions(-) delete mode 100644 pkgs/by-name/xr/xrootd/test-runner.nix diff --git a/pkgs/by-name/xr/xrootd/package.nix b/pkgs/by-name/xr/xrootd/package.nix index 308a389eae47..18dd045d8d87 100644 --- a/pkgs/by-name/xr/xrootd/package.nix +++ b/pkgs/by-name/xr/xrootd/package.nix @@ -5,7 +5,6 @@ fetchFromGitHub, davix, cmake, - cppunit, gtest, makeWrapper, pkg-config, @@ -22,8 +21,6 @@ systemd, voms, zlib, - # Build bin/test-runner - enableTestRunner ? true, # If not null, the builder will # move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc. externalEtc ? "/etc", @@ -87,10 +84,6 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optionals stdenv.hostPlatform.isLinux [ systemd voms - ] - ++ lib.optionals enableTestRunner [ - gtest - cppunit ]; # https://github.com/xrootd/xrootd/blob/master/packaging/rhel/xrootd.spec.in#L665-L675= @@ -118,20 +111,21 @@ stdenv.mkDerivation (finalAttrs: { install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket ''; - cmakeFlags = - [ - (lib.cmakeFeature "XRootD_VERSION_STRING" finalAttrs.version) - (lib.cmakeBool "FORCE_ENABLED" true) - (lib.cmakeBool "ENABLE_DAVIX" true) - (lib.cmakeBool "ENABLE_FUSE" (!stdenv.hostPlatform.isDarwin)) # XRootD doesn't support MacFUSE - (lib.cmakeBool "ENABLE_MACAROONS" false) - (lib.cmakeBool "ENABLE_PYTHON" false) # built separately - (lib.cmakeBool "ENABLE_SCITOKENS" true) - (lib.cmakeBool "ENABLE_VOMS" stdenv.hostPlatform.isLinux) - ] - ++ lib.optionals enableTestRunner [ - (lib.cmakeBool "ENABLE_TESTS" true) - ]; + cmakeFlags = [ + (lib.cmakeFeature "XRootD_VERSION_STRING" finalAttrs.version) + (lib.cmakeBool "FORCE_ENABLED" true) + (lib.cmakeBool "ENABLE_DAVIX" true) + (lib.cmakeBool "ENABLE_FUSE" (!stdenv.hostPlatform.isDarwin)) # XRootD doesn't support MacFUSE + (lib.cmakeBool "ENABLE_MACAROONS" false) + (lib.cmakeBool "ENABLE_PYTHON" false) # built separately + (lib.cmakeBool "ENABLE_SCITOKENS" true) + (lib.cmakeBool "ENABLE_TESTS" finalAttrs.doCheck) + (lib.cmakeBool "ENABLE_VOMS" stdenv.hostPlatform.isLinux) + ]; + + # TODO(@ShamrockLee): Enable the checks. + doCheck = false; + checkInputs = [ gtest ]; postFixup = lib.optionalString (externalEtc != null) '' moveToOutput etc "$etc" diff --git a/pkgs/by-name/xr/xrootd/test-runner.nix b/pkgs/by-name/xr/xrootd/test-runner.nix deleted file mode 100644 index b878febc7bff..000000000000 --- a/pkgs/by-name/xr/xrootd/test-runner.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ runCommand, xrootd }: - -# These tests are specified in the test procedure of the upstream CD: -# https://github.com/xrootd/xrootd/blob/master/.github/workflows/build.yml#L90-L98 -runCommand "${xrootd.pname}-run-tests-${xrootd.version}" { - testRunnerPath = "${xrootd}/bin/test-runner"; - testLibraries = [ "XrdClTests" ]; - XrdClTestsSuites = [ "UtilsTest" "SocketTest" "PollerTest" ]; - pname = "${xrootd.pname}-run-tests"; - inherit (xrootd) version; - meta.mainProgram = "test-runner"; -} '' - for testLibrary in $testLibraries; do - echo "Testing $testLibrary" - testLibraryPath="${xrootd.out}/lib/lib''${testLibrary}.so" - testsuiteVarname="''${testLibrary}Suites" - for testsuite in ''${!testsuiteVarname}; do - echo "Doing test $testsuite" - "$testRunnerPath" "$testLibraryPath" "All Tests/$testsuite/" - done - done - mkdir -p "$out/bin" - ln -s "$testRunnerPath" "$out/bin/test-runner" -'' From 31f260e2b7b4b0027b75165464122ef2aacb1a45 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Wed, 2 Oct 2024 17:09:58 +0200 Subject: [PATCH 7/7] python312Packages.xrootd: 5.6.6 -> 5.7.1 --- pkgs/by-name/xr/xrootd/package.nix | 13 +++++++------ pkgs/development/python-modules/xrootd/default.nix | 10 ++++------ 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/xr/xrootd/package.nix b/pkgs/by-name/xr/xrootd/package.nix index 18dd045d8d87..2860c1198538 100644 --- a/pkgs/by-name/xr/xrootd/package.nix +++ b/pkgs/by-name/xr/xrootd/package.nix @@ -21,8 +21,9 @@ systemd, voms, zlib, - # If not null, the builder will - # move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc. + # If not null, move the default configuration files to "$etc/etc" and look for the configuration + # directory at externalEtc. + # Otherwise, the program will look for the configuration files under $out/etc." externalEtc ? "/etc", removeReferencesTo, }: @@ -81,9 +82,9 @@ stdenv.mkDerivation (finalAttrs: { # https://github.com/xrootd/xrootd/blob/5b5a1f6957def2816b77ec773c7e1bfb3f1cfc5b/cmake/XRootDFindLibs.cmake#L58 fuse ] - ++ lib.optionals stdenv.hostPlatform.isLinux [ - systemd - voms + ++ lib.filter (lib.meta.availableOn stdenv.hostPlatform) [ + systemd # only available on specific non-static Linux platforms + voms # only available on Linux due to gsoap failing to build on Darwin ]; # https://github.com/xrootd/xrootd/blob/master/packaging/rhel/xrootd.spec.in#L665-L675= @@ -119,7 +120,7 @@ stdenv.mkDerivation (finalAttrs: { (lib.cmakeBool "ENABLE_MACAROONS" false) (lib.cmakeBool "ENABLE_PYTHON" false) # built separately (lib.cmakeBool "ENABLE_SCITOKENS" true) - (lib.cmakeBool "ENABLE_TESTS" finalAttrs.doCheck) + (lib.cmakeBool "ENABLE_TESTS" finalAttrs.finalPackage.doCheck) (lib.cmakeBool "ENABLE_VOMS" stdenv.hostPlatform.isLinux) ]; diff --git a/pkgs/development/python-modules/xrootd/default.nix b/pkgs/development/python-modules/xrootd/default.nix index 33b42f9f0f35..65d874d73c2d 100644 --- a/pkgs/development/python-modules/xrootd/default.nix +++ b/pkgs/development/python-modules/xrootd/default.nix @@ -3,7 +3,6 @@ buildPythonPackage, cmake, setuptools, - wheel, xrootd, }: @@ -15,10 +14,9 @@ buildPythonPackage rec { sourceRoot = "${src.name}/bindings/python"; - nativeBuildInputs = [ + build-system = [ cmake setuptools - wheel ]; buildInputs = [ xrootd ]; @@ -30,11 +28,11 @@ buildPythonPackage rec { # Tests are only compatible with Python 2 doCheck = false; - meta = with lib; { + meta = { description = "XRootD central repository"; homepage = "https://github.com/xrootd/xrootd"; changelog = "https://github.com/xrootd/xrootd/releases/tag/v${version}"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ GaetanLepage ]; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ GaetanLepage ]; }; }