From f085846ed2b1cec849bd27f88f5edbc03b5f5da6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Thu, 8 Sep 2022 11:35:43 +0200 Subject: [PATCH] knot-dns: add a test for version-sensitive dependencies --- pkgs/servers/dns/knot-dns/default.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/pkgs/servers/dns/knot-dns/default.nix b/pkgs/servers/dns/knot-dns/default.nix index fc4efcfe56a1..6d46bfb4dce7 100644 --- a/pkgs/servers/dns/knot-dns/default.nix +++ b/pkgs/servers/dns/knot-dns/default.nix @@ -1,7 +1,8 @@ { lib, stdenv, fetchurl, pkg-config, gnutls, liburcu, lmdb, libcap_ng, libidn2, libunistring , systemd, nettle, libedit, zlib, libiconv, libintl, libmaxminddb, libbpf, nghttp2, libmnl , ngtcp2-gnutls -, autoreconfHook, nixosTests, knot-resolver +, autoreconfHook +, nixosTests, knot-resolver, knot-dns, runCommandLocal , fetchpatch }: @@ -65,6 +66,19 @@ stdenv.mkDerivation rec { inherit knot-resolver; } // lib.optionalAttrs stdenv.isLinux { inherit (nixosTests) knot; + # 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 libbpf; do + echo "Checking for $libname:" + ldd '${knot-dns.bin}/bin/knotd' | grep -F "$libname" + echo "OK" + done + touch "$out" + ''; }; meta = with lib; {