2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, fetchurl, pkgconfig, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
2020-08-20 17:08:02 +00:00
|
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb
|
2020-04-24 23:36:52 +00:00
|
|
|
, autoreconfHook
|
|
|
|
}:
|
|
|
|
|
|
|
|
let inherit (stdenv.lib) optional optionals; in
|
|
|
|
|
|
|
|
# Note: ATM only the libraries have been tested in nixpkgs.
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "knot-dns";
|
2020-05-29 06:06:01 +00:00
|
|
|
version = "2.9.5";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
|
2020-05-29 06:06:01 +00:00
|
|
|
sha256 = "1109a8ba212ff8ddfdbaf44a6f8fc13a2b880a98a9e54c19112ba72a1aacbf76";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
|
|
|
|
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
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig autoreconfHook ];
|
|
|
|
buildInputs = [
|
|
|
|
gnutls liburcu libidn2 libunistring
|
|
|
|
nettle libedit
|
|
|
|
libiconv lmdb libintl
|
2020-08-20 17:08:02 +00:00
|
|
|
libmaxminddb # optional for geoip module (it's tiny)
|
2020-04-24 23:36:52 +00:00
|
|
|
# without sphinx &al. for developer documentation
|
|
|
|
]
|
|
|
|
++ optionals stdenv.isLinux [ libcap_ng systemd ]
|
|
|
|
++ optional stdenv.isDarwin zlib; # perhaps due to gnutls
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
CFLAGS = [ "-O2" "-DNDEBUG" ];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
doInstallCheck = false; # needs pykeymgr?
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
rm -r "$out"/lib/*.la
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Authoritative-only DNS server from .cz domain registry";
|
|
|
|
homepage = "https://knot-dns.cz";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.vcunat ];
|
|
|
|
};
|
|
|
|
}
|