about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/sync/casync/default.nix
blob: 79064f6bc107e2e4a2c2e8ed1b9893686755f6aa (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
{ lib
, stdenv
, fetchFromGitHub
, meson
, ninja
, pkg-config
, python3
, sphinx
, acl
, curl
, fuse
, libselinux
, udev
, xz
, zstd
, fuseSupport ? true
, selinuxSupport ? true
, udevSupport ? true
, glibcLocales
, rsync
}:

stdenv.mkDerivation {
  pname = "casync";
  version = "2-226-gbd8898e";

  src = fetchFromGitHub {
    owner = "systemd";
    repo = "casync";
    rev = "bd8898ed92685e12022dd33a04c87786b5262344";
    sha256 = "04ibglizjzyd7ih13q6m7ic78n0mzw9nfmb3zd1fcm9j62qlq11i";
  };

  buildInputs = [ acl curl xz zstd ]
    ++ lib.optionals (fuseSupport) [ fuse ]
    ++ lib.optionals (selinuxSupport) [ libselinux ]
    ++ lib.optionals (udevSupport) [ udev ];
  nativeBuildInputs = [ meson ninja pkg-config python3 sphinx ];
  nativeCheckInputs = [ glibcLocales rsync ];

  postPatch = ''
    for f in test/test-*.sh.in; do
      patchShebangs $f
    done
    patchShebangs test/http-server.py
  '';

  PKG_CONFIG_UDEV_UDEVDIR = "lib/udev";
  mesonFlags = lib.optionals (!fuseSupport) [ "-Dfuse=false" ]
    ++ lib.optionals (!udevSupport) [ "-Dudev=false" ]
    ++ lib.optionals (!selinuxSupport) [ "-Dselinux=false" ];

  doCheck = true;
  preCheck = ''
    export LC_ALL="en_US.utf-8"
  '';

  meta = with lib; {
    description = "Content-Addressable Data Synchronizer";
    mainProgram = "casync";
    homepage = "https://github.com/systemd/casync";
    license = licenses.lgpl21Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ flokli ];
  };
}