2022-11-21 17:40:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, acl
|
|
|
|
, autoreconfHook
|
|
|
|
, avahi
|
|
|
|
, db
|
|
|
|
, ed
|
|
|
|
, libevent
|
|
|
|
, libgcrypt
|
|
|
|
, libiconv
|
|
|
|
, libtirpc
|
|
|
|
, openssl
|
|
|
|
, pam
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-08-18 13:19:15 +00:00
|
|
|
pname = "netatalk";
|
2022-11-04 12:27:35 +00:00
|
|
|
version = "3.1.13";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2022-11-21 17:40:18 +00:00
|
|
|
url = "mirror://sourceforge/netatalk/netatalk/netatalk-${finalAttrs.version}.tar.bz2";
|
|
|
|
hash = "sha256-ia2mvP4bOa2U9YwjZlTR2UTyZFw+femLM3TgvTfV4F0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2022-11-21 17:40:18 +00:00
|
|
|
./000-no-suid.patch
|
|
|
|
./001-omit-localstatedir-creation.patch
|
2021-12-06 16:07:01 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "make-afpstats-python3-compatible.patch";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://github.com/Netatalk/Netatalk/commit/916b515705cf7ba28dc53d13202811c6e1fe6a9e.patch";
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-DAABpYjQPJLsQBhmtP30gA357w0Qn+AsnFgAeyDC/Rg=";
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
freeBSDPatches = [
|
|
|
|
# https://bugs.freebsd.org/263123
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-etc_afpd_directory.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-etc_afpd_directory.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-07YAJs+EtqGcFXbYHDLbILved1Ebtd8ukQepvzy6et0=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-etc_afpd_file.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-etc_afpd_file.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-T1WTNa2G6wxKtvMa/MCX3Vx6XZBHtU6w3enkdGuIWus=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-etc_afpd_volume.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-etc_afpd_volume.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-NOZNZGzA0hxrNkoLTvN64h40yApPbMH4qIfBTpQoI0s=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-etc_cnid__dbd_cmd__dbd__scanvol.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-etc_cnid__dbd_cmd__dbd__scanvol.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-5QV+tQDo8/XeKwH/e5+Ne+kEOl2uvRDbHMaWysIB6YU=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-libatalk_adouble_ad__attr.c";
|
|
|
|
url =
|
|
|
|
"https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-libatalk_adouble_ad__attr.c";
|
|
|
|
sha256 = "sha256-Ose6BdilwBOmoYpm8Jat1B3biOXJj4y3U4T49zE0G7Y=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-libatalk_adouble_ad__conv.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-libatalk_adouble_ad__conv.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-T27WlKVXosv4bX5Gek2bR2cVDYEee5qrH4mnL9ghbP8=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-libatalk_adouble_ad__date.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-libatalk_adouble_ad__date.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-fkW5A+7R5fT3bukRfZaOwFo7AsyPaYajc1hIlDMZMnc=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-libatalk_adouble_ad__flush.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-libatalk_adouble_ad__flush.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-k2zTx35tAlsFHym83bZGoWXRomwFV9xT3r2fzr3Zvbk=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-libatalk_adouble_ad__open.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-libatalk_adouble_ad__open.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-uV4wwft2IH54+4k5YR+Gz/BpRZBanxX/Ukp8BkohInU=";
|
|
|
|
})
|
|
|
|
# https://bugs.freebsd.org/251203
|
|
|
|
(fetchpatch {
|
|
|
|
name = "patch-libatalk_vfs_extattr.c";
|
2022-11-04 12:27:35 +00:00
|
|
|
url = "https://cgit.freebsd.org/ports/plain/net/netatalk3/files/patch-libatalk_vfs_extattr.c";
|
2022-10-21 18:38:19 +00:00
|
|
|
sha256 = "sha256-lFWF0Qo8PJv7QKvnMn0Fc9Ruzb+FTEWgOMpxc789jWs=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# freeBSD patches are -p0
|
|
|
|
for i in $freeBSDPatches ; do
|
|
|
|
patch -p0 < $i
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
autoreconfHook
|
|
|
|
pkg-config
|
|
|
|
perl
|
|
|
|
python3
|
|
|
|
python3.pkgs.wrapPython
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
buildInputs = [
|
|
|
|
acl
|
|
|
|
avahi
|
|
|
|
db
|
|
|
|
libevent
|
|
|
|
libgcrypt
|
|
|
|
libiconv
|
|
|
|
openssl
|
|
|
|
pam
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--with-bdb=${db.dev}"
|
|
|
|
"--with-ssl-dir=${openssl.dev}"
|
|
|
|
"--with-lockfile=/run/lock/netatalk"
|
|
|
|
"--with-libevent=${libevent.dev}"
|
|
|
|
"--localstatedir=/var/lib"
|
|
|
|
];
|
|
|
|
|
|
|
|
# Expose librpcsvc to the linker for afpd
|
|
|
|
# Fixes errors that showed up when closure-size was merged:
|
|
|
|
# afpd-nfsquota.o: In function `callaurpc':
|
|
|
|
# netatalk-3.1.7/etc/afpd/nfsquota.c:78: undefined reference to `xdr_getquota_args'
|
|
|
|
# netatalk-3.1.7/etc/afpd/nfsquota.c:78: undefined reference to `xdr_getquota_rslt'
|
|
|
|
postConfigure = ''
|
|
|
|
${ed}/bin/ed -v etc/afpd/Makefile << EOF
|
|
|
|
/^afpd_LDADD
|
|
|
|
/am__append_2
|
|
|
|
a
|
2020-11-12 09:05:59 +00:00
|
|
|
${libtirpc}/lib/libtirpc.so \\
|
2020-04-24 23:36:52 +00:00
|
|
|
.
|
|
|
|
w
|
|
|
|
EOF
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
2021-12-06 16:07:01 +00:00
|
|
|
buildPythonPath ${python3.pkgs.dbus-python}
|
2020-04-24 23:36:52 +00:00
|
|
|
patchPythonScript $out/bin/afpstats
|
|
|
|
'';
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Apple Filing Protocol Server";
|
|
|
|
homepage = "http://netatalk.sourceforge.net/";
|
2022-11-21 17:40:18 +00:00
|
|
|
license = licenses.gpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ jcumming ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2022-11-21 17:40:18 +00:00
|
|
|
})
|