2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
2020-09-09 16:11:51 +01:00
|
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2
|
2021-06-16 11:56:22 +01:00
|
|
|
, autoreconfHook, nixosTests
|
2017-01-30 10:55:15 +00:00
|
|
|
}:
|
2016-07-01 12:44:07 +01:00
|
|
|
|
2021-01-15 07:07:56 +00:00
|
|
|
let inherit (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";
|
2021-06-16 07:34:17 +01:00
|
|
|
version = "3.0.7";
|
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";
|
2021-06-16 07:34:17 +01:00
|
|
|
sha256 = "2bad8be0be95c8f54a26d1e16299e65f31ae1b34bd6ad3819aa50e7b40521484";
|
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
|
|
|
];
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ pkg-config 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;
|
2021-06-23 14:09:14 +01:00
|
|
|
checkFlags = "V=1"; # verbose output in case some test fails
|
2020-09-14 10:20:52 +01:00
|
|
|
doInstallCheck = true;
|
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
|
|
|
|
2021-06-16 11:56:22 +01:00
|
|
|
passthru.tests = { inherit (nixosTests) knot; };
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-07-01 12:44:07 +01:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|