Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / by-name / cm / cmake / check-pc-files-hook.sh
blob94d1b7b53556eb0c9821e9f7085d3802ee27c2c3
1 cmakePcfileCheckPhase() {
2 while IFS= read -rd $'\0' file; do
3 grepout=$(grep --line-number '}//nix/store' "$file" || true)
4 if [ -n "$grepout" ]; then
6 echo "Broken paths found in a .pc file! $file"
7 echo "The following lines have issues (specifically '//' in paths)."
8 echo "$grepout"
9 echo "It is very likely that paths are being joined improperly."
10 echo 'ex: "${prefix}/@CMAKE_INSTALL_LIBDIR@" should be "@CMAKE_INSTALL_FULL_LIBDIR@"'
11 echo "Please see https://github.com/NixOS/nixpkgs/issues/144170 for more details."
12 exit 1
13 } 1>&2
15 done < <(find "${!outputDev}" -iname "*.pc" -print0)
18 postFixupHooks+=(cmakePcfileCheckPhase)