knot-dns: add a test for version-sensitive dependencies

This commit is contained in:
Vladimír Čunát 2022-09-08 11:35:43 +02:00
parent 98eb447a53
commit f085846ed2
No known key found for this signature in database
GPG key ID: E747DF1F9575A3AA

View file

@ -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; {