diff options
author | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2021-04-24 10:41:00 +0200 |
---|---|---|
committer | Nadia Holmquist Pedersen <nadia@nhp.sh> | 2021-04-24 10:41:00 +0200 |
commit | 19a0eb4e5671f86cbc94cbd37bf52294c711863d (patch) | |
tree | d670ec03b5a4237a9e01d6d09b0ba45c3d9cf3b7 /tools | |
parent | d1178a7514119ba7008a705d366f3f00a6b80e03 (diff) |
mac-libs.sh: support macports
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/mac-libs.sh | 12 |
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")" |