about summary refs log tree commit diff
path: root/doc/languages-frameworks
diff options
context:
space:
mode:
authornicoo <nicoo@debian.org>2024-05-03 20:18:56 +0000
committerGitHub <noreply@github.com>2024-05-03 20:18:56 +0000
commita817fdac5fea62e89332ea223c0a5ea8b6443341 (patch)
tree00f59fb834333852c997fb13d37273a0e84af78b /doc/languages-frameworks
parentaf8edf6d75e467f35c837fe705257fbe7dc27fea (diff)
parentc150eb5e442d717fc43c9e3b4475b547b03ba67d (diff)
Merge #307770: add optional version check in `testers.hasPkgConfigModules`
Diffstat (limited to 'doc/languages-frameworks')
-rw-r--r--doc/languages-frameworks/pkg-config.section.md12
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" ];
   };
 })
 ```