2 { lib, runCommand, pkg-config }:
6 moduleNames ? package.meta.pkgConfigModules,
7 testName ? "check-pkg-config-${lib.concatStringsSep "-" moduleNames}",
11 nativeBuildInputs = [ pkg-config ];
12 buildInputs = [ package ];
15 description = "Test whether ${package.name} exposes pkg-config modules ${lib.concatStringsSep ", " moduleNames}.";
17 # Make sure licensing info etc is preserved, as this is a concern for e.g. cache.nixos.org,
18 # as hydra can't check this meta info in dependencies.
19 # The test itself is just Nixpkgs, with MIT license.
20 // builtins.intersectAttrs
22 available = throw "unused";
23 broken = throw "unused";
24 insecure = throw "unused";
25 license = throw "unused";
26 maintainers = throw "unused";
27 platforms = throw "unused";
28 unfree = throw "unused";
29 unsupported = throw "unused";
33 for moduleName in $moduleNames; do
34 echo "checking pkg-config module $moduleName in $buildInputs"
36 version="$(pkg-config --modversion $moduleName)"
40 echo "✅ pkg-config module $moduleName exists and has version $version"
41 printf '%s\t%s\n' "$moduleName" "$version" >> "$out"
43 echo "These modules were available in the input propagation closure:"
45 echo "❌ pkg-config module $moduleName was not found"