summary refs log tree commit diff
path: root/pkgs/tools/filesystems/lizardfs/default.nix
blob: 4aeadefee348cbc225ba248eeedbeee720e48b6c (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
{ stdenv
, fetchzip
, fetchFromGitHub
, cmake
, makeWrapper
, python
, fuse
, asciidoc
, libxml2
, libxslt
, docbook_xml_dtd_412
, docbook_xsl
, boost
, pkgconfig
, judy
, pam
, zlib # optional
}:

let
  # See https://github.com/lizardfs/lizardfs/blob/3.12/cmake/Libraries.cmake
  # We have to download it ourselves, as the build script normally does a download
  # on-build, which is not good
  spdlog = fetchzip {
    name = "spdlog-0.14.0";
    url = "https://github.com/gabime/spdlog/archive/v0.14.0.zip";
    sha256 = "13730429gwlabi432ilpnja3sfvy0nn2719vnhhmii34xcdyc57q";
  };
in stdenv.mkDerivation rec {
  name = "lizardfs-${version}";
  version = "3.12.0";

  src = fetchFromGitHub {
    owner = "lizardfs";
    repo = "lizardfs";
    rev = "v${version}";
    sha256 = "0zk73wmx82ari3m2mv0zx04x1ggsdmwcwn7k6bkl5c0jnxffc4ax";
  };

  nativeBuildInputs = [ cmake pkgconfig makeWrapper ];

  buildInputs =
    [ fuse asciidoc libxml2 libxslt docbook_xml_dtd_412 docbook_xsl
      zlib boost judy pam
    ];

  patches = [
    ./remove-download-external.patch
  ];

  postUnpack = ''
    mkdir $sourceRoot/external/spdlog-0.14.0
    cp -R ${spdlog}/* $sourceRoot/external/spdlog-0.14.0/
    chmod -R 755 $sourceRoot/external/spdlog-0.14.0/
  '';

  postInstall = ''
    wrapProgram $out/sbin/lizardfs-cgiserver \
        --prefix PATH ":" "${python}/bin"
  '';

  meta = with stdenv.lib; {
    homepage = https://lizardfs.com;
    description = "A highly reliable, scalable and efficient distributed file system";
    platforms = platforms.linux;
    license = licenses.gpl3;
    maintainers = [ maintainers.rushmorem ];
  };
}