-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: add check-pc-files hook to check broken pc files
see nixpkgs pr 172150
- Loading branch information
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
18 changes: 18 additions & 0 deletions
18
pkgs/development/tools/build-managers/cmake/check-pc-files-hook.sh
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,18 @@ | ||
cmakePcfileCheckPhase() { | ||
while IFS= read -rd $'\0' file; do | ||
grepout=$(grep --line-number '}//nix/store' "$file" || true) | ||
if [ -n "$grepout" ]; then | ||
{ | ||
echo "Broken paths found in a .pc file! $file" | ||
echo "The following lines have issues (specifically '//' in paths)." | ||
echo "$grepout" | ||
echo "It is very likely that paths are being joined improperly." | ||
echo 'ex: "${prefix}/@CMAKE_INSTALL_LIBDIR@" should be "@CMAKE_INSTALL_FULL_LIBDIR@"' | ||
echo "Please see https://github.com/NixOS/nixpkgs/issues/144170 for more details." | ||
exit 1 | ||
} 1>&2 | ||
fi | ||
done < <(find "${!outputDev}" -iname "*.pc" -print0) | ||
} | ||
|
||
postFixupHooks+=(cmakePcfileCheckPhase) |
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