diff options
Diffstat (limited to 'doc/languages-frameworks/pkg-config.section.md')
-rw-r--r-- | doc/languages-frameworks/pkg-config.section.md | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/doc/languages-frameworks/pkg-config.section.md b/doc/languages-frameworks/pkg-config.section.md index e5a2b85b65769..0b25396314cbb 100644 --- a/doc/languages-frameworks/pkg-config.section.md +++ b/doc/languages-frameworks/pkg-config.section.md @@ -7,10 +7,11 @@ Nixpkgs provides a couple of facilities for working with this tool. ## Writing packages providing pkg-config modules {#pkg-config-writing-packages} Packages should set `meta.pkgConfigModules` with the list of package config modules they provide. -They should also use `testers.testMetaPkgConfig` to check that the final built package matches that list. +They should also use `testers.hasPkgConfigModules` to check that the final built package matches that list, +and optionally check that the pkgconf modules' version metadata matches the derivation's. Additionally, the [`validatePkgConfig` setup hook](https://nixos.org/manual/nixpkgs/stable/#validatepkgconfig), will do extra checks on to-be-installed pkg-config modules. -A good example of all these things is zlib: +A good example of all these things is miniz: ```nix { pkg-config, testers, ... }: @@ -20,11 +21,14 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config validatePkgConfig ]; - passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; + passthru.tests.pkg-config = testers.hasPkgConfigModules { + package = finalAttrs.finalPackage; + versionCheck = true; + }; meta = { /* ... */ - pkgConfigModules = [ "zlib" ]; + pkgConfigModules = [ "miniz" ]; }; }) ``` |