aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNadia Holmquist Pedersen <nadia@nhp.sh>2021-04-24 10:41:00 +0200
committerNadia Holmquist Pedersen <nadia@nhp.sh>2021-04-24 10:41:00 +0200
commit19a0eb4e5671f86cbc94cbd37bf52294c711863d (patch)
treed670ec03b5a4237a9e01d6d09b0ba45c3d9cf3b7 /tools
parentd1178a7514119ba7008a705d366f3f00a6b80e03 (diff)
mac-libs.sh: support macports
Diffstat (limited to 'tools')
-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")"