-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# 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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters