2022-02-20 02:22:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, callPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, cppunit
|
2022-02-24 21:40:53 +00:00
|
|
|
, pkg-config
|
2022-02-20 02:22:22 +00:00
|
|
|
, curl
|
|
|
|
, fuse
|
|
|
|
, libkrb5
|
|
|
|
, libuuid
|
2022-09-29 23:43:34 +00:00
|
|
|
, libxcrypt
|
2022-02-20 02:22:22 +00:00
|
|
|
, libxml2
|
|
|
|
, openssl
|
|
|
|
, readline
|
|
|
|
, systemd
|
2022-02-24 21:40:53 +00:00
|
|
|
, voms
|
2022-02-20 02:22:22 +00:00
|
|
|
, zlib
|
2023-02-03 07:36:07 +00:00
|
|
|
, enableTests ? stdenv.isLinux
|
2022-07-25 03:28:13 +00:00
|
|
|
# If not null, the builder will
|
|
|
|
# move "$out/etc" to "$out/etc.orig" and symlink "$out/etc" to externalEtc.
|
|
|
|
, externalEtc ? "/etc"
|
2022-02-20 02:22:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "xrootd";
|
2023-02-19 08:20:51 +00:00
|
|
|
version = "5.5.3";
|
2022-02-20 02:22:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "xrootd";
|
|
|
|
repo = "xrootd";
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-02-19 08:20:51 +00:00
|
|
|
hash = "sha256-61+8M6ubKX/GnsPLTql6XzGw/PTljpiXoDa1YoECya4=";
|
2022-02-20 02:22:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" "man" ];
|
|
|
|
|
2022-12-20 09:32:24 +00:00
|
|
|
passthru.tests = lib.optionalAttrs enableTests {
|
2022-02-20 02:22:22 +00:00
|
|
|
test-runner = callPackage ./test-runner.nix { };
|
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
curl
|
|
|
|
libkrb5
|
|
|
|
libuuid
|
2022-09-29 23:43:34 +00:00
|
|
|
libxcrypt
|
2022-02-20 02:22:22 +00:00
|
|
|
libxml2
|
|
|
|
openssl
|
|
|
|
readline
|
|
|
|
zlib
|
2023-02-03 07:36:07 +00:00
|
|
|
fuse
|
2022-02-20 02:22:22 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isLinux [
|
|
|
|
systemd
|
2022-02-24 21:40:53 +00:00
|
|
|
voms
|
2022-02-20 02:22:22 +00:00
|
|
|
]
|
|
|
|
++ lib.optionals enableTests [
|
|
|
|
cppunit
|
|
|
|
];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs genversion.sh
|
|
|
|
'';
|
|
|
|
|
2022-07-25 03:28:13 +00:00
|
|
|
# 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"
|
|
|
|
'' + lib.optionalString stdenv.isLinux ''
|
|
|
|
mkdir -p "$out/lib/systemd/system"
|
|
|
|
install -m 644 -t "$out/lib/systemd/system" ../packaging/common/*.service ../packaging/common/*.socket
|
|
|
|
'';
|
|
|
|
|
2022-02-20 02:22:22 +00:00
|
|
|
cmakeFlags = lib.optionals enableTests [
|
|
|
|
"-DENABLE_TESTS=TRUE"
|
|
|
|
];
|
|
|
|
|
2022-07-25 03:28:13 +00:00
|
|
|
postFixup = lib.optionalString (externalEtc != null) ''
|
|
|
|
mv "$out"/etc{,.orig}
|
|
|
|
ln -s ${lib.escapeShellArg externalEtc} "$out/etc"
|
|
|
|
'';
|
|
|
|
|
2022-02-20 02:22:22 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "High performance, scalable fault tolerant data access";
|
|
|
|
homepage = "https://xrootd.slac.stanford.edu";
|
|
|
|
license = licenses.lgpl3Plus;
|
|
|
|
platforms = platforms.all;
|
|
|
|
maintainers = with maintainers; [ ShamrockLee ];
|
|
|
|
};
|
|
|
|
}
|