about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/networking/xrootd/default.nix
blob: ffc348370983178a1e88dfde35e5ced5efc9730d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
{ lib
, stdenv
, callPackage
, fetchFromGitHub
, cmake
, cppunit
, curl
, fuse
, libkrb5
, libuuid
, libxml2
, openssl
, pkg-config
, readline
, systemd
, zlib
, enableTests ? true
}:

stdenv.mkDerivation rec {
  pname = "xrootd";
  version = "5.4.1";

  src = fetchFromGitHub {
    owner = "xrootd";
    repo = "xrootd";
    rev = "v${version}";
    fetchSubmodules = true;
    sha256 = "sha256-rr6cZ6tyrpCQyKcPBWwGsRAsLbjTXAoTtxf+u1UmvZo=";
  };

  outputs = [ "bin" "out" "dev" "man" ];

  passthru.tests = lib.optionalAttrs enableTests {
    test-runner = callPackage ./test-runner.nix { };
  };

  nativeBuildInputs = [
    cmake
    pkg-config
  ];

  buildInputs = [
    curl
    libkrb5
    libuuid
    libxml2
    openssl
    readline
    zlib
  ]
  ++ lib.optionals stdenv.isLinux [
    fuse
    systemd
  ]
  ++ lib.optionals enableTests [
    cppunit
  ];

  preConfigure = ''
    patchShebangs genversion.sh

    # Manually apply part of
    # https://github.com/xrootd/xrootd/pull/1619
    # Remove after the above PR is merged.
    sed -i 's/set\((\s*CMAKE_INSTALL_[A-Z_]\+DIR\s\+"[^"]\+"\s*)\)/define_default\1/g' cmake/XRootDOSDefs.cmake
  '';

  cmakeFlags = lib.optionals enableTests [
    "-DENABLE_TESTS=TRUE"
  ];

  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 ];
  };
}