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