20 # If not null, the builder will
21 # move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc.
22 , externalEtc ? "/etc"
25 stdenv.mkDerivation rec {
29 src = fetchFromGitHub {
33 fetchSubmodules = true;
34 hash = "sha256-a8qw8uHxd7OLMMq+HPMB36O0Yjctlnf8DkfEdMvc1NQ=";
37 outputs = [ "bin" "out" "dev" "man" ];
39 passthru.tests = lib.optionalAttrs enableTests {
40 test-runner = callPackage ./test-runner.nix { };
58 ++ lib.optionals stdenv.isLinux [
63 ++ lib.optionals enableTests [
68 patchShebangs genversion.sh
70 # Manually apply part of
71 # https://github.com/xrootd/xrootd/pull/1619
72 # Remove after the above PR is merged.
73 sed -i 's/set\((\s*CMAKE_INSTALL_[A-Z_]\+DIR\s\+"[^"]\+"\s*)\)/define_default\1/g' cmake/XRootDOSDefs.cmake
76 # https://github.com/xrootd/xrootd/blob/master/packaging/rhel/xrootd.spec.in#L665-L675=
78 mkdir -p "$out/lib/tmpfiles.d"
79 install -m 644 -T ../packaging/rhel/xrootd.tmpfiles "$out/lib/tmpfiles.d/xrootd.conf"
80 mkdir -p "$out/etc/xrootd"
81 install -m 644 -t "$out/etc/xrootd" ../packaging/common/*.cfg
82 install -m 644 -t "$out/etc/xrootd" ../packaging/common/client.conf
83 mkdir -p "$out/etc/xrootd/client.plugins.d"
84 install -m 644 -t "$out/etc/xrootd/client.plugins.d" ../packaging/common/client-plugin.conf.example
85 mkdir -p "$out/etc/logrotate.d"
86 install -m 644 -T ../packaging/common/xrootd.logrotate "$out/etc/logrotate.d/xrootd"
87 '' + lib.optionalString stdenv.isLinux ''
88 mkdir -p "$out/lib/systemd/system"
89 install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket
92 cmakeFlags = lib.optionals enableTests [
96 postFixup = lib.optionalString (externalEtc != null) ''
98 ln -s ${lib.escapeShellArg externalEtc} "$out/etc"
102 description = "High performance, scalable fault tolerant data access";
103 homepage = "https://xrootd.slac.stanford.edu";
104 license = licenses.lgpl3Plus;
105 platforms = platforms.all;
106 maintainers = with maintainers; [ ShamrockLee ];