2018-07-20 06:37:49 -07:00
|
|
|
{ stdenv, fetchurl, pkgconfig, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
2018-03-14 12:15:06 -07:00
|
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl
|
2020-02-07 07:21:12 -08:00
|
|
|
, autoreconfHook
|
2017-01-30 02:55:15 -08:00
|
|
|
}:
|
2016-07-01 04:44:07 -07:00
|
|
|
|
2017-02-08 17:52:13 -08:00
|
|
|
let inherit (stdenv.lib) optional optionals; in
|
2017-02-13 15:47:01 -08:00
|
|
|
|
2016-07-01 04:44:07 -07:00
|
|
|
# Note: ATM only the libraries have been tested in nixpkgs.
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "knot-dns";
|
2019-12-12 01:36:39 -08:00
|
|
|
version = "2.9.2";
|
2016-07-01 04:44:07 -07:00
|
|
|
|
|
|
|
src = fetchurl {
|
2018-06-28 11:43:35 -07:00
|
|
|
url = "https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
|
2019-12-12 01:36:39 -08:00
|
|
|
sha256 = "298cdf33aa7589b50df7e5833694b24cd2de8b6d17cee7e1673873fe576db6ee";
|
2016-07-01 04:44:07 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
|
2020-02-07 07:21:12 -08: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
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig autoreconfHook ];
|
2016-07-01 04:44:07 -07:00
|
|
|
buildInputs = [
|
2018-07-20 06:37:49 -07:00
|
|
|
gnutls liburcu libidn2 libunistring
|
2017-01-25 13:41:07 -08:00
|
|
|
nettle libedit
|
2018-03-14 12:15:06 -07:00
|
|
|
libiconv lmdb libintl
|
2016-07-01 04:44:07 -07:00
|
|
|
# without sphinx &al. for developer documentation
|
2017-01-25 13:41:07 -08:00
|
|
|
]
|
2017-09-23 05:14:13 -07:00
|
|
|
++ optionals stdenv.isLinux [ libcap_ng systemd ]
|
2017-02-13 15:47:01 -08:00
|
|
|
++ optional stdenv.isDarwin zlib; # perhaps due to gnutls
|
2016-07-01 04:44:07 -07:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2017-01-31 03:53:24 -08:00
|
|
|
CFLAGS = [ "-O2" "-DNDEBUG" ];
|
2016-07-01 04:44:07 -07:00
|
|
|
|
2018-08-09 16:59:27 -07:00
|
|
|
doCheck = true;
|
|
|
|
doInstallCheck = false; # needs pykeymgr?
|
2016-07-01 04:44:07 -07:00
|
|
|
|
2020-02-07 07:21:12 -08:00
|
|
|
postInstall = ''
|
|
|
|
rm -r "$out"/lib/*.la
|
|
|
|
'';
|
2016-07-01 04:44:07 -07:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|