2021-01-18 22:50:56 -08:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
2020-09-09 08:11:51 -07:00
|
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2
|
2020-02-07 07:21:12 -08:00
|
|
|
, autoreconfHook
|
2017-01-30 02:55:15 -08:00
|
|
|
}:
|
2016-07-01 04:44:07 -07:00
|
|
|
|
2021-01-14 23:07:56 -08:00
|
|
|
let inherit (lib) optional optionals; in
|
2017-02-13 15:47:01 -08:00
|
|
|
|
2016-07-01 04:44:07 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "knot-dns";
|
2021-05-12 03:55:41 -07:00
|
|
|
version = "3.0.6";
|
2016-07-01 04:44:07 -07:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 11:43:35 -07:00
|
|
|
url = "https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
|
2021-05-12 03:55:41 -07:00
|
|
|
sha256 = "63756ac5a00c3e4a066ed231a287faef5963a9183d77326e30bf0644cdf74f86";
|
2016-07-01 04:44:07 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
|
2020-02-07 07:21:12 -08: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 03:00:18 -07:00
|
|
|
./runtime-deps.patch
|
2020-02-07 07:21:12 -08:00
|
|
|
];
|
|
|
|
|
2021-01-18 22:50:56 -08:00
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ];
|
2016-07-01 04:44:07 -07:00
|
|
|
buildInputs = [
|
2018-07-20 06:37:49 -07:00
|
|
|
gnutls liburcu libidn2 libunistring
|
2017-01-25 13:41:07 -08:00
|
|
|
nettle libedit
|
2018-03-14 12:15:06 -07:00
|
|
|
libiconv lmdb libintl
|
2020-09-09 08:11:51 -07:00
|
|
|
nghttp2 # DoH support in kdig
|
2020-08-12 23:12:43 -07:00
|
|
|
libmaxminddb # optional for geoip module (it's tiny)
|
2016-07-01 04:44:07 -07:00
|
|
|
# without sphinx &al. for developer documentation
|
2020-09-09 08:11:51 -07:00
|
|
|
# TODO: add dnstap support?
|
2017-01-25 13:41:07 -08:00
|
|
|
]
|
2020-09-09 23:41:58 -07:00
|
|
|
++ optionals stdenv.isLinux [
|
|
|
|
libcap_ng systemd
|
|
|
|
libbpf # XDP support
|
|
|
|
]
|
2017-02-13 15:47:01 -08:00
|
|
|
++ optional stdenv.isDarwin zlib; # perhaps due to gnutls
|
2016-07-01 04:44:07 -07:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-01-31 03:53:24 -08:00
|
|
|
CFLAGS = [ "-O2" "-DNDEBUG" ];
|
2016-07-01 04:44:07 -07:00
|
|
|
|
2018-08-09 16:59:27 -07:00
|
|
|
doCheck = true;
|
2020-09-14 02:20:52 -07:00
|
|
|
doInstallCheck = true;
|
2016-07-01 04:44:07 -07:00
|
|
|
|
2020-02-07 07:21:12 -08:00
|
|
|
postInstall = ''
|
|
|
|
rm -r "$out"/lib/*.la
|
|
|
|
'';
|
2016-07-01 04:44:07 -07:00
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2016-07-01 04:44:07 -07:00
|
|
|
description = "Authoritative-only DNS server from .cz domain registry";
|
2020-03-31 18:11:51 -07:00
|
|
|
homepage = "https://knot-dns.cz";
|
2016-07-01 04:44:07 -07:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.vcunat ];
|
|
|
|
};
|
|
|
|
}
|