2018-07-20 15:37:49 +02:00
|
|
|
{ stdenv, fetchurl, pkgconfig, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
2018-03-14 20:15:06 +01:00
|
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl
|
2020-02-07 16:21:12 +01:00
|
|
|
, autoreconfHook
|
2017-01-30 11:55:15 +01:00
|
|
|
}:
|
2016-07-01 13:44:07 +02:00
|
|
|
|
2017-02-09 02:52:13 +01:00
|
|
|
let inherit (stdenv.lib) optional optionals; in
|
2017-02-14 00:47:01 +01:00
|
|
|
|
2016-07-01 13:44:07 +02:00
|
|
|
# Note: ATM only the libraries have been tested in nixpkgs.
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "knot-dns";
|
2020-03-03 11:16:53 +01:00
|
|
|
version = "2.9.3";
|
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";
|
2020-03-03 11:16:53 +01:00
|
|
|
sha256 = "f2adf137d70955a4a20df90c5409e10be8e1127204a98b27d626ac090531a07e";
|
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
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ pkgconfig 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
|
2016-07-01 13:44:07 +02:00
|
|
|
# without sphinx &al. for developer documentation
|
2017-01-25 22:41:07 +01:00
|
|
|
]
|
2017-09-23 14:14:13 +02:00
|
|
|
++ optionals stdenv.isLinux [ libcap_ng systemd ]
|
2017-02-14 00:47:01 +01:00
|
|
|
++ 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;
|
|
|
|
doInstallCheck = false; # needs pykeymgr?
|
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
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|