2017-07-28 14:33:40 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, 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-08-09 15:36:32 +01:00
|
|
|
version = "1.3.3";
|
2017-01-25 14:20:18 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://secure.nic.cz/files/knot-resolver/${name}.tar.xz";
|
2017-08-09 15:36:32 +01:00
|
|
|
sha256 = "c679238bea5744de8a99f4402a61e9e58502bc42b40ecfa370e53679ed5d5b80";
|
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;
|
2017-07-10 17:10:17 +01:00
|
|
|
# Platforms using negative pointers for stack won't work ATM due to LuaJIT impl.
|
|
|
|
platforms = filter (p: p != "aarch64-linux") platforms.unix;
|
2017-01-25 14:20:18 +00:00
|
|
|
maintainers = [ maintainers.vcunat /* upstream developer */ ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|