nixpkgs/pkgs/servers/dns/knot-dns/default.nix

61 lines
1.6 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, pkgconfig, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb
, autoreconfHook
}:
let inherit (stdenv.lib) optional optionals; in
stdenv.mkDerivation rec {
pname = "knot-dns";
version = "2.9.6";
src = fetchurl {
url = "https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
sha256 = "bf742883c6825b54f19f2dadca2c94fec1ff8bdcf0a52388e2e167937594b2e7";
};
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
2018-03-14 19:15:06 +00:00
libiconv lmdb libintl
libmaxminddb # optional for geoip module (it's tiny)
# 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 ];
};
}