Unverified Commit 419da635 authored by Dmitry Kalinkin's avatar Dmitry Kalinkin Committed by GitHub
Browse files

Merge pull request #285505 from GaetanLepage/xroot

xrootd: 5.5.5 -> 5.6.6, python311Packages.xrootd: init at 5.6.6
parents e03be91f 3720ce9c
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -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 = ''
+1 −1
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
    homepage = "https://github.com/scitokens/scitokens-cpp/";
    description =
      "A C++ implementation of the SciTokens library with a C library interface";
    platforms = platforms.linux;
    platforms = platforms.unix;
    license = licenses.asl20;
    maintainers = with maintainers; [ evey ];
  };
+41 −0
Original line number Diff line number Diff line
{ lib
, buildPythonPackage
, cmake
, setuptools
, wheel
, pkgs
}:

buildPythonPackage rec {
  pname = "xrootd";
  pyproject = true;

  inherit (pkgs.xrootd) version src;

  sourceRoot = "${src.name}/bindings/python";

  nativeBuildInputs = [
    cmake
    setuptools
    wheel
  ];

  buildInputs = [
    pkgs.xrootd
  ];

  dontUseCmakeConfigure = true;

  pythonImportsCheck = [ "XRootD" ];

  # Tests are only compatible with Python 2
  doCheck = false;

  meta = with lib; {
    description = "The 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 ];
  };
}
+40 −12
Original line number Diff line number Diff line
@@ -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"
  ];
  preFixup = ''
    makeWrapperArgs+=("--prefix" "${lib.optionalString stdenv.hostPlatform.isDarwin "DY"}LD_LIBRARY_PATH" ":" "${placeholder "out"}/lib")
  '';

  postFixup = ''
    while IFS= read -r FILE; do
+2 −0
Original line number Diff line number Diff line
@@ -16417,6 +16417,8 @@ self: super: with self; {
  xpybutil = callPackage ../development/python-modules/xpybutil { };
  xrootd = callPackage ../development/python-modules/xrootd { };
  xsdata = callPackage ../development/python-modules/xsdata { };
  xstatic-asciinema-player = callPackage ../development/python-modules/xstatic-asciinema-player { };