-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
relocate.sh.in
executable file
·26 lines (20 loc) · 859 Bytes
/
relocate.sh.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
CURRENT_ROOT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd "$CURRENT_ROOT"
if [ "${PLATFORM}" == "macos" ]; then
REPLACE_FILES="pyside/lib/cmake/**/*.cmake pyside/lib/pkgconfig/*.pc qt/lib/pkgconfig/*.pc python/Library/Frameworks/Python.framework/Versions/Current/lib/pkgconfig/*.pc"
else
REPLACE_FILES="pyside/lib/cmake/**/*.cmake pyside/lib/pkgconfig/*.pc qt/lib/pkgconfig/*.pc python/lib/pkgconfig/*.pc"
fi
ORIGINAL_ROOT_ESCAPED="${ORIGINAL_ROOT////\\/}"
CURRENT_ROOT_ESCAPED="${CURRENT_ROOT////\\/}"
for file in $REPLACE_FILES; do
echo "Relocating $file"
if [ "${PLATFORM}" == "macos" ]; then
sed -i".original" -e "s/$ORIGINAL_ROOT_ESCAPED/$CURRENT_ROOT_ESCAPED/g" "$file"
else
sed -i -e "s/$ORIGINAL_ROOT_ESCAPED/$CURRENT_ROOT_ESCAPED/g" "$file"
fi
done
echo "[Paths]
Prefix = $CURRENT_ROOT/qt
" > qt/bin/qt.conf