nixpkgs/pkgs/build-support/setup-hooks/validate-pkg-config.sh
Daniël de Kok 48a20e9337 validatePkgConfig: fix variable scope
validatePkgConfig failed due to a wrong variable scope, as reported in
issue #100834. This change corrects the variable scoping.
2020-10-18 14:00:05 +02:00

18 lines
448 B
Bash

# This setup hook validates each pkgconfig file in each output.
fixupOutputHooks+=(_validatePkgConfig)
_validatePkgConfig() {
local bail=0
for pc in $(find "$prefix" -name '*.pc'); do
# 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
}