aboutsummaryrefslogtreecommitdiff
path: root/tools/mac-libs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/mac-libs.sh')
-rwxr-xr-xtools/mac-libs.sh12
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/mac-libs.sh b/tools/mac-libs.sh
index 2a4adde..c307444 100755
--- a/tools/mac-libs.sh
+++ b/tools/mac-libs.sh
@@ -24,8 +24,8 @@ abspath() {
perl -MCwd -le 'print Cwd::abs_path shift' "$1"
}
-cmake_qtdir=$(grep -E "Qt._DIR" CMakeCache.txt | cut -d= -f2)
-qtdir="$(abspath "$cmake_qtdir"/../../..)"
+cmake_qtdir=$(grep -E "Qt._DIR" CMakeCache.txt)
+qtdir="$(abspath "$(echo "$cmake_qtdir/../../.." | cut -d= -f2)")"
plugindir="$app/Contents/PlugIns"
if [[ ! -d "$plugindir" ]]; then
@@ -33,6 +33,10 @@ if [[ ! -d "$plugindir" ]]; then
if [[ ! -d "$qt_plugins" ]]; then
qt_plugins="$qtdir/share/qt/plugins"
fi
+ if [[ ! -d "$qt_plugins" ]]; then
+ qt_major="$(echo "$cmake_qtdir" | sed -E 's/Qt(.)_DIR.*/\1/')"
+ qt_plugins="$qtdir/libexec/qt$qt_major/plugins"
+ fi
mkdir -p "$plugindir/styles" "$plugindir/platforms"
cp "$qt_plugins/styles/libqmacstyle.dylib" "$plugindir/styles/"
@@ -43,6 +47,10 @@ fixup_libs() {
local libs=($(otool -L "$1" | grep -vE "/System|/usr/lib|:$|@rpath" | sed -E 's/'$'\t''(.*) \(.*$/\1/'))
for lib in "${libs[@]}"; do
+ if [[ "$lib" != *"/"* ]]; then
+ continue
+ fi
+
# Dereference symlinks to get the actual .dylib as binaries' load
# commands can contain paths to symlinked libraries.
local abslib="$(abspath "$lib")"