2017-05-02 12:47:36 +01:00
|
|
|
{ stdenv, fetchurl, fetchpatch, pkgconfig, utillinux, hexdump, which
|
2017-01-25 21:41:07 +00:00
|
|
|
, knot-dns, luajit, libuv, lmdb
|
2017-01-25 14:20:18 +00:00
|
|
|
, cmocka, systemd, hiredis, libmemcached
|
|
|
|
, gnutls, nettle
|
2017-01-25 17:41:52 +00:00
|
|
|
, luajitPackages, makeWrapper
|
2017-01-25 14:20:18 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) optional;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "knot-resolver-${version}";
|
2017-06-23 13:48:29 +01:00
|
|
|
version = "1.3.1";
|
2017-01-25 14:20:18 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://secure.nic.cz/files/knot-resolver/${name}.tar.xz";
|
2017-06-23 13:48:29 +01:00
|
|
|
sha256 = "cc9631fe1a92628e81e74b324a7f70c0b29840d426de05d7d045fdf85ab01117";
|
2017-01-25 14:20:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
configurePhase = ":";
|
|
|
|
|
2017-01-30 19:07:44 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig which makeWrapper hexdump ];
|
2017-01-25 21:41:07 +00:00
|
|
|
|
2017-02-15 09:21:45 +00:00
|
|
|
buildInputs = [ knot-dns luajit libuv gnutls ]
|
|
|
|
++ optional stdenv.isLinux lmdb # system lmdb causes some problems on Darwin
|
2017-04-05 14:48:23 +01:00
|
|
|
## optional dependencies; TODO: libedit, dnstap?
|
2017-01-25 14:20:18 +00:00
|
|
|
++ optional doInstallCheck cmocka
|
2017-01-25 21:41:07 +00:00
|
|
|
++ optional stdenv.isLinux systemd # socket activation
|
2017-01-25 14:20:18 +00:00
|
|
|
++ [
|
|
|
|
nettle # DNS cookies
|
|
|
|
hiredis libmemcached # additional cache backends
|
|
|
|
# http://knot-resolver.readthedocs.io/en/latest/build.html#requirements
|
|
|
|
];
|
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
CFLAGS = [ "-O2" "-DNDEBUG" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doInstallCheck = true;
|
|
|
|
installCheckTarget = "check";
|
|
|
|
preInstallCheck = ''
|
|
|
|
export LD_LIBRARY_PATH="$out/lib"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# optional: to allow auto-bootstrapping root trust anchor via https
|
|
|
|
postInstall = with luajitPackages; ''
|
|
|
|
wrapProgram "$out/sbin/kresd" \
|
|
|
|
--set LUA_PATH '${
|
|
|
|
stdenv.lib.concatStringsSep ";"
|
|
|
|
(map getLuaPath [ luasec luasocket ])
|
|
|
|
}' \
|
|
|
|
--set LUA_CPATH '${
|
|
|
|
stdenv.lib.concatStringsSep ";"
|
|
|
|
(map getLuaCPath [ luasec luasocket ])
|
|
|
|
}'
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2017-01-25 17:41:52 +00:00
|
|
|
description = "Caching validating DNS resolver, from .cz domain registry";
|
2017-01-25 14:20:18 +00:00
|
|
|
homepage = https://knot-resolver.cz;
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = [ maintainers.vcunat /* upstream developer */ ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|