summary refs log tree commit diff
path: root/pkgs/tools/filesystems/netatalk/default.nix
blob: 950d10640bf0f7723ce639e8fc0a7258e3bcd408 (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
{ lib
, stdenv
, fetchurl
, acl
, autoreconfHook
, avahi
, db
, libevent
, libgcrypt
, libiconv
, openssl
, pam
, perl
, pkg-config
, python3
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "netatalk";
  version = "3.1.18";

  src = fetchurl {
    url = "mirror://sourceforge/netatalk/netatalk/netatalk-${finalAttrs.version}.tar.bz2";
    hash = "sha256-htIJ3Hd2pLoXhFFk0uN2pGnO43aiexiuMYmOP0ukFlU=";
  };

  patches = [
    ./000-no-suid.patch
    ./001-omit-localstatedir-creation.patch
  ];

  nativeBuildInputs = [
    autoreconfHook
    pkg-config
    perl
    python3
    python3.pkgs.wrapPython
  ];

  buildInputs = [
    acl
    avahi
    db
    libevent
    libgcrypt
    libiconv
    openssl
    pam
  ];

  configureFlags = [
    "--with-bdb=${db.dev}"
    "--with-ssl-dir=${openssl.dev}"
    "--with-lockfile=/run/lock/netatalk"
    "--localstatedir=/var/lib"
  ];

  postInstall = ''
    sed -i -e "s%/usr/bin/env python%${python3}/bin/python3%" $out/bin/afpstats
    buildPythonPath ${python3.pkgs.dbus-python}
    patchPythonScript $out/bin/afpstats
  '';

  enableParallelBuilding = true;

  meta = with lib; {
    description = "Apple Filing Protocol Server";
    homepage = "http://netatalk.sourceforge.net/";
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ jcumming ];
  };
})