forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / qt-6 / hooks / fix-qt-module-paths.sh
blob4884f45b99301ad9d048b8209db9a5583f0227a1
1 # fixQtModulePaths
3 # Usage: fixQtModulePaths _dir_
5 # Find Qt module definitions in directory _dir_ and patch the module paths.
7 fixQtModulePaths() {
8 local dir="$1"
9 local lib="${!outputLib}"
11 if [ -d "$dir" ]; then
12 find "$dir" -name 'qt_*.pri' | while read pr; do
13 if grep -q '\$\$QT_MODULE_' "${pr:?}"; then
14 echo "fixQtModulePaths: Fixing module paths in \`${pr:?}'..."
15 sed -i "${pr:?}" \
16 -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \
17 -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \
18 -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$lib/include|g" \
19 -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$lib/bin|g"
21 done
22 elif [ -e "$dir" ]; then
23 echo "fixQtModulePaths: Warning: \`$dir' is not a directory"
24 else
25 echo "fixQtModulePaths: Warning: \`$dir' does not exist"