mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 13:43:22 +00:00
13083b1a01
This adds the `validatePkgConfig` hook, which can be used to validate pkg-config files in the output(s). Currently, this will just run `pkg-config --validate` on all `.pc` files, capturing errors such as the issue that was fixed in #87789. The hook could be extended in the future with more fine-grained checks.
20 lines
453 B
Bash
20 lines
453 B
Bash
# This setup hook validates each pkgconfig file in each output.
|
|
|
|
fixupOutputHooks+=(_validatePkgConfig)
|
|
|
|
_validatePkgConfig() {
|
|
for pc in $(find "$prefix" -name '*.pc'); do
|
|
local bail=0
|
|
|
|
# Do not fail immediately. It's nice to see all errors when
|
|
# there are multiple pkgconfig files.
|
|
if ! pkg-config --validate "$pc"; then
|
|
bail=1
|
|
fi
|
|
done
|
|
|
|
if [ $bail -eq 1 ]; then
|
|
exit 1
|
|
fi
|
|
}
|