d7501b986a
The removal of `luaL_reg` alias caused lots of breakage. Only sysdig and knot-resolver needed (also) other changes.
75 lines
2.2 KiB
Nix
75 lines
2.2 KiB
Nix
{ stdenv, fetchurl, fetchpatch, pkgconfig, utillinux, hexdump, which
|
|
, knot-dns, luajit, libuv, lmdb
|
|
, cmocka, systemd, hiredis, libmemcached
|
|
, gnutls, nettle
|
|
, luajitPackages, makeWrapper
|
|
}:
|
|
|
|
let
|
|
inherit (stdenv.lib) optional;
|
|
in
|
|
stdenv.mkDerivation rec {
|
|
name = "knot-resolver-${version}";
|
|
version = "1.2.6";
|
|
|
|
src = fetchurl {
|
|
url = "http://secure.nic.cz/files/knot-resolver/${name}.tar.xz";
|
|
sha256 = "31e1b8899c5592433e5265a8e9685126fc5aeff3bd6b10884154b2e34b786f3c";
|
|
};
|
|
|
|
patches = [(fetchpatch {
|
|
name = "luajit-2.1.0-beta3.diff";
|
|
url = https://gitlab.labs.nic.cz/knot/resolver/merge_requests/289.diff;
|
|
sha256 = "1cgfi715qhmvb31ri2wr6cacsjvb1dqavdmnnl1074y25zalxfax";
|
|
})];
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
configurePhase = ":";
|
|
|
|
nativeBuildInputs = [ pkgconfig which makeWrapper hexdump ];
|
|
|
|
buildInputs = [ knot-dns luajit libuv gnutls ]
|
|
++ optional stdenv.isLinux lmdb # system lmdb causes some problems on Darwin
|
|
## optional dependencies; TODO: libedit, dnstap?
|
|
++ optional doInstallCheck cmocka
|
|
++ optional stdenv.isLinux systemd # socket activation
|
|
++ [
|
|
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; {
|
|
description = "Caching validating DNS resolver, from .cz domain registry";
|
|
homepage = https://knot-resolver.cz;
|
|
license = licenses.gpl3Plus;
|
|
platforms = platforms.unix;
|
|
maintainers = [ maintainers.vcunat /* upstream developer */ ];
|
|
};
|
|
}
|
|
|