mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-17 19:21:04 +00:00
doc: Mention testers.hasPkgConfigModules
and its versionCheck
parameter in the appropriate section
This commit is contained in:
parent
c677c1bf9a
commit
9245f1b706
|
@ -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}
|
## Writing packages providing pkg-config modules {#pkg-config-writing-packages}
|
||||||
|
|
||||||
Packages should set `meta.pkgConfigModules` with the list of package config modules they provide.
|
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.
|
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
|
```nix
|
||||||
{ pkg-config, testers, ... }:
|
{ pkg-config, testers, ... }:
|
||||||
|
@ -20,11 +21,14 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
nativeBuildInputs = [ pkg-config validatePkgConfig ];
|
nativeBuildInputs = [ pkg-config validatePkgConfig ];
|
||||||
|
|
||||||
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
passthru.tests.pkg-config = testers.hasPkgConfigModules {
|
||||||
|
package = finalAttrs.finalPackage;
|
||||||
|
versionCheck = true;
|
||||||
|
};
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
/* ... */
|
/* ... */
|
||||||
pkgConfigModules = [ "zlib" ];
|
pkgConfigModules = [ "miniz" ];
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in a new issue