diff options
author | Daniel Salzman <daniel.salzman@nic.cz> | 2023-08-26 09:32:17 +0200 |
---|---|---|
committer | Daniel Salzman <daniel.salzman@nic.cz> | 2023-08-26 09:32:17 +0200 |
commit | bd625a2fe43de509b334d607d3cc3284931ee8f5 (patch) | |
tree | 62d5123dded5da93aa1430cc1038133ff9b23904 | |
parent | doc: add migration from 3.2.x to 3.3.x (diff) | |
parent | distro/pkg/nix: synchronize from downstream nixpkgs (diff) | |
download | knot-bd625a2fe43de509b334d607d3cc3284931ee8f5.tar.xz knot-bd625a2fe43de509b334d607d3cc3284931ee8f5.zip |
Merge branch 'p/nix-sync' into 'master'
distro/pkg/nix: synchronize from downstream nixpkgs
See merge request knot/knot-dns!1575
-rw-r--r-- | distro/pkg/nix/default.nix | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/distro/pkg/nix/default.nix b/distro/pkg/nix/default.nix index 35cc3e4de..eca169878 100644 --- a/distro/pkg/nix/default.nix +++ b/distro/pkg/nix/default.nix @@ -1,6 +1,8 @@ { lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring , systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2, libmnl -, autoreconfHook, nixosTests, knot-resolver +, ngtcp2-gnutls, xdp-tools +, autoreconfHook +, nixosTests, knot-resolver, knot-dns, runCommandLocal }: stdenv.mkDerivation rec { @@ -33,12 +35,13 @@ stdenv.mkDerivation rec { nettle libedit libiconv lmdb libintl nghttp2 # DoH support in kdig + ngtcp2-gnutls # DoQ support in kdig (and elsewhere but not much use there yet) libmaxminddb # optional for geoip module (it's tiny) # without sphinx &al. for developer documentation # TODO: add dnstap support? ] ++ lib.optionals stdenv.isLinux [ libcap_ng systemd - libbpf libmnl # XDP support (it's Linux kernel API) + xdp-tools libbpf libmnl # XDP support (it's Linux kernel API) ] ++ lib.optional stdenv.isDarwin zlib; # perhaps due to gnutls enableParallelBuilding = true; @@ -46,7 +49,7 @@ stdenv.mkDerivation rec { CFLAGS = [ "-O2" "-DNDEBUG" ]; doCheck = true; - checkFlags = "V=1"; # verbose output in case some test fails + checkFlags = [ "V=1" ]; # verbose output in case some test fails doInstallCheck = true; postInstall = '' @@ -56,7 +59,20 @@ stdenv.mkDerivation rec { passthru.tests = { inherit knot-resolver; } // lib.optionalAttrs stdenv.isLinux { - inherit (nixosTests) knot; + inherit (nixosTests) knot kea; + # Some dependencies are very version-sensitive, so the might get dropped + # or embedded after some update, even if the nixPackagers didn't intend to. + # For non-linux I don't know a good replacement for `ldd`. + deps = runCommandLocal "knot-deps-test" + { nativeBuildInputs = [ (lib.getBin stdenv.cc.libc) ]; } + '' + for libname in libngtcp2 libxdp libbpf; do + echo "Checking for $libname:" + ldd '${knot-dns.bin}/bin/knotd' | grep -F "$libname" + echo "OK" + done + touch "$out" + ''; }; meta = with lib; { @@ -65,5 +81,6 @@ stdenv.mkDerivation rec { license = licenses.gpl3Plus; platforms = platforms.unix; maintainers = [ maintainers.vcunat ]; + mainProgram = "knotd"; }; } |