2017-05-02 13:47:36 +02:00
|
|
|
{ stdenv, fetchurl, fetchpatch, pkgconfig, utillinux, hexdump, which
|
2017-01-25 22:41:07 +01:00
|
|
|
, knot-dns, luajit, libuv, lmdb
|
2017-01-25 15:20:18 +01:00
|
|
|
, cmocka, systemd, hiredis, libmemcached
|
|
|
|
, gnutls, nettle
|
2017-01-25 18:41:52 +01:00
|
|
|
, luajitPackages, makeWrapper
|
2017-01-25 15:20:18 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (stdenv.lib) optional;
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "knot-resolver-${version}";
|
2017-06-23 14:48:29 +02:00
|
|
|
version = "1.3.1";
|
2017-01-25 15:20:18 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://secure.nic.cz/files/knot-resolver/${name}.tar.xz";
|
2017-06-23 14:48:29 +02:00
|
|
|
sha256 = "cc9631fe1a92628e81e74b324a7f70c0b29840d426de05d7d045fdf85ab01117";
|
2017-01-25 15:20:18 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
configurePhase = ":";
|
|
|
|
|
2017-01-30 20:07:44 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig which makeWrapper hexdump ];
|
2017-01-25 22:41:07 +01:00
|
|
|
|
2017-02-15 10:21:45 +01:00
|
|
|
buildInputs = [ knot-dns luajit libuv gnutls ]
|
|
|
|
++ optional stdenv.isLinux lmdb # system lmdb causes some problems on Darwin
|
2017-04-05 15:48:23 +02:00
|
|
|
## optional dependencies; TODO: libedit, dnstap?
|
2017-01-25 15:20:18 +01:00
|
|
|
++ optional doInstallCheck cmocka
|
2017-01-25 22:41:07 +01:00
|
|
|
++ optional stdenv.isLinux systemd # socket activation
|
2017-01-25 15:20:18 +01: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 18:41:52 +01:00
|
|
|
description = "Caching validating DNS resolver, from .cz domain registry";
|
2017-01-25 15:20:18 +01:00
|
|
|
homepage = https://knot-resolver.cz;
|
|
|
|
license = licenses.gpl3Plus;
|
2017-07-10 18:10:17 +02: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 15:20:18 +01:00
|
|
|
maintainers = [ maintainers.vcunat /* upstream developer */ ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|