2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
2021-08-02 08:18:06 +01:00
|
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2, libmnl
|
2021-12-20 15:43:21 +00:00
|
|
|
, autoreconfHook, nixosTests, knot-resolver
|
2017-01-30 10:55:15 +00:00
|
|
|
}:
|
2016-07-01 12:44:07 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "knot-dns";
|
2022-02-08 12:59:50 +00:00
|
|
|
version = "3.1.6";
|
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";
|
2022-02-08 12:59:50 +00:00
|
|
|
sha256 = "e9ba1305d750dc08fb08687aec7ac55737ca073deaa0b867c884e0c0f2fdb753";
|
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?
|
2021-08-02 12:12:10 +01:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
libcap_ng systemd
|
2021-08-02 17:41:36 +01:00
|
|
|
libbpf libmnl # XDP support (it's Linux kernel API)
|
2021-08-02 12:12:10 +01:00
|
|
|
] ++ lib.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-12-20 15:43:21 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit knot-resolver;
|
2021-12-20 16:17:55 +00:00
|
|
|
} // lib.optionalAttrs stdenv.isLinux {
|
|
|
|
inherit (nixosTests) knot;
|
2021-12-20 15:43:21 +00:00
|
|
|
};
|
2021-06-16 11:56:22 +01:00
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|