depot/third_party/nixpkgs/pkgs/build-support/setup-hooks/validate-pkg-config.sh
Default email 02a8431f10 Project import generated by Copybara.
GitOrigin-RevId: 007126eef72271480cb7670e19e501a1ad2c1ff2
2020-10-20 09:25:03 +10: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
}