mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 21:03:15 +00:00
895ce97eea
Upstream is aware but they don't have a fix yet. I'm not aware of NixPkgs being used for another platform affected by this (e.g. ppc64le).
77 lines
2.2 KiB
Nix
77 lines
2.2 KiB
Nix
{ lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring
|
|
, systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2, libmnl
|
|
, autoreconfHook, nixosTests
|
|
}:
|
|
|
|
let inherit (lib) optional optionals; in
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "knot-dns";
|
|
version = "3.1.0";
|
|
|
|
src = fetchurl {
|
|
url = "https://secure.nic.cz/files/knot-dns/knot-${version}.tar.xz";
|
|
sha256 = "54323712e3cbc3d4c70a15777818fd2ff0de30cebb6c22e2946372b15b2653ed";
|
|
};
|
|
|
|
outputs = [ "bin" "out" "dev" ];
|
|
|
|
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
|
|
./runtime-deps.patch
|
|
];
|
|
|
|
# Disable knotd journal tests on platforms that don't use 4k sysconf(_SC_PAGESIZE).
|
|
# The journal most likely works fine, but some of the tests currently don't.
|
|
postPatch = lib.optionalString (doCheck && stdenv.isDarwin && stdenv.isAarch64) ''
|
|
sed '/^\tknot\/test_journal\>/d' -i tests/Makefile.am
|
|
'';
|
|
|
|
nativeBuildInputs = [ pkg-config autoreconfHook ];
|
|
buildInputs = [
|
|
gnutls liburcu libidn2 libunistring
|
|
nettle libedit
|
|
libiconv lmdb libintl
|
|
nghttp2 # DoH support in kdig
|
|
libmaxminddb # optional for geoip module (it's tiny)
|
|
libmnl # required for knot >= 3.1
|
|
# without sphinx &al. for developer documentation
|
|
# TODO: add dnstap support?
|
|
]
|
|
++ optionals stdenv.isLinux [
|
|
libcap_ng systemd
|
|
libbpf # XDP support
|
|
]
|
|
++ optional stdenv.isDarwin zlib; # perhaps due to gnutls
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
CFLAGS = [ "-O2" "-DNDEBUG" ];
|
|
|
|
doCheck = true;
|
|
checkFlags = "V=1"; # verbose output in case some test fails
|
|
doInstallCheck = true;
|
|
|
|
postInstall = ''
|
|
rm -r "$out"/lib/*.la
|
|
'';
|
|
|
|
passthru.tests = { inherit (nixosTests) knot; };
|
|
|
|
meta = with lib; {
|
|
description = "Authoritative-only DNS server from .cz domain registry";
|
|
homepage = "https://knot-dns.cz";
|
|
license = licenses.gpl3Plus;
|
|
platforms = platforms.unix;
|
|
maintainers = [ maintainers.vcunat ];
|
|
};
|
|
}
|