2018-07-20 14:37:49 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
2020-09-09 16:11:51 +01:00
|
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2
|
2020-02-07 15:21:12 +00:00
|
|
|
, autoreconfHook
|
2017-01-30 10:55:15 +00:00
|
|
|
}:
|
2016-07-01 12:44:07 +01:00
|
|
|
|
2017-02-09 01:52:13 +00:00
|
|
|
let inherit (stdenv.lib) optional optionals; in
|
2017-02-13 23:47:01 +00:00
|
|
|
|
2016-07-01 12:44:07 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "knot-dns";
|
2020-10-10 10:04:33 +01:00
|
|
|
version = "3.0.1";
|
2016-07-01 12:44:07 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 19:43:35 +01:00
|
|
|
url = "https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
|
2020-10-10 10:04:33 +01:00
|
|
|
sha256 = "97af6724b04308f691392c80d75564ff8b246871f2f59c4f03cede3c4dd401bb";
|
2016-07-01 12:44:07 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
|
2020-02-07 15:21:12 +00:00
|
|
|
configureFlags = [
|
|
|
|
"--with-configdir=/etc/knot"
|
|
|
|
"--with-rundir=/run/knot"
|
|
|
|
"--with-storage=/var/lib/knot"
|
|
|
|
];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Don't try to create directories like /var/lib/knot at build time.
|
|
|
|
# They are later created from NixOS itself.
|
|
|
|
./dont-create-run-time-dirs.patch
|
2020-09-08 11:00:18 +01:00
|
|
|
./runtime-deps.patch
|
2020-02-07 15:21:12 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig autoreconfHook ];
|
2016-07-01 12:44:07 +01:00
|
|
|
buildInputs = [
|
2018-07-20 14:37:49 +01:00
|
|
|
gnutls liburcu libidn2 libunistring
|
2017-01-25 21:41:07 +00:00
|
|
|
nettle libedit
|
2018-03-14 19:15:06 +00:00
|
|
|
libiconv lmdb libintl
|
2020-09-09 16:11:51 +01:00
|
|
|
nghttp2 # DoH support in kdig
|
2020-08-13 07:12:43 +01:00
|
|
|
libmaxminddb # optional for geoip module (it's tiny)
|
2016-07-01 12:44:07 +01:00
|
|
|
# without sphinx &al. for developer documentation
|
2020-09-09 16:11:51 +01:00
|
|
|
# TODO: add dnstap support?
|
2017-01-25 21:41:07 +00:00
|
|
|
]
|
2020-09-10 07:41:58 +01:00
|
|
|
++ optionals stdenv.isLinux [
|
|
|
|
libcap_ng systemd
|
|
|
|
libbpf # XDP support
|
|
|
|
]
|
2017-02-13 23:47:01 +00:00
|
|
|
++ optional stdenv.isDarwin zlib; # perhaps due to gnutls
|
2016-07-01 12:44:07 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-01-31 11:53:24 +00:00
|
|
|
CFLAGS = [ "-O2" "-DNDEBUG" ];
|
2016-07-01 12:44:07 +01:00
|
|
|
|
2018-08-10 00:59:27 +01:00
|
|
|
doCheck = true;
|
|
|
|
doInstallCheck = false; # needs pykeymgr?
|
2016-07-01 12:44:07 +01:00
|
|
|
|
2020-02-07 15:21:12 +00:00
|
|
|
postInstall = ''
|
|
|
|
rm -r "$out"/lib/*.la
|
|
|
|
'';
|
2016-07-01 12:44:07 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Authoritative-only DNS server from .cz domain registry";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://knot-dns.cz";
|
2016-07-01 12:44:07 +01:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.vcunat ];
|
|
|
|
};
|
|
|
|
}
|