diff options
author | Vladimír Čunát <vladimir.cunat@nic.cz> | 2023-08-26 09:06:33 +0200 |
---|---|---|
committer | Vladimír Čunát <vladimir.cunat@nic.cz> | 2023-08-26 09:06:33 +0200 |
commit | 40c5113f35ff96cc7c96c9e71abd9d93cbfe98f6 (patch) | |
tree | c3d44b12d04a78d2d15def63c5edd88b9d9a72eb /distro/pkg/nix/default.nix | |
parent | NEWS: synchronize with branch 3.2 (diff) | |
download | knot-40c5113f35ff96cc7c96c9e71abd9d93cbfe98f6.tar.xz knot-40c5113f35ff96cc7c96c9e71abd9d93cbfe98f6.zip |
distro/pkg/nix: synchronize from downstream nixpkgs
Some parts of the expression don't work so well due to the way
we use it with apkg separately from nixpkgs, but I don't think
it matters and it's nice to keep the .nix file diff minimal.
I re-tested that it's up to date for upcoming 3.3, too.
Diffstat (limited to '')
-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"; }; } |