Use macdeployqt to add the Qt bits to our bundle. Put our libraries in
[metze/wireshark/wip.git] / packaging / macosx / osx-app.sh
index f407a23bef1bb9ae6d3a10da4bc6a9bd88d6d11c..419143e9873431b20d4f827a932194cc7633a72d 100755 (executable)
@@ -43,7 +43,6 @@ plist="./Info.plist"
 util_dir="./Utilities"
 cli_dir="$util_dir/Command Line"
 chmodbpf_dir="$util_dir/ChmodBPF"
-frameworks=""
 
 # "qt" or "gtk"
 ui_toolkit="gtk"
@@ -209,12 +208,16 @@ resdir=`pwd`
 pkgexec="$package/Contents/MacOS"
 pkgres="$package/Contents/Resources"
 pkgbin="$pkgres/bin"
+# Should pkglib be Contents/Frameworks instead?
+#pkglib="$pkgres/lib"
 pkglib="$package/Contents/Frameworks"
+pkgqtplugin="$package/Contents/PlugIns"
 pkgplugin="$pkglib/wireshark/plugins"
 pkgpython="$pkglib/wireshark/python"
 
 mkdir -p "$pkgexec"
 mkdir -p "$pkgbin"
+mkdir -p "$pkgqtplugin"
 mkdir -p "$pkgplugin"
 mkdir -p "$pkgpython"
 
@@ -368,14 +371,6 @@ END_PANGO
                fi
                cp -r $LIBPREFIX/lib/gdk-pixbuf-2.0/$gdk_pixbuf_version/loaders/* $pkglib/gdk-pixbuf-2.0/$gdk_pixbuf_version/loaders
        fi
-elif [ "$ui_toolkit" = "qt" ] ; then
-       frameworks="`otool -L $pkgexec/Wireshark 2>/dev/null | grep 'Qt.*framework' | sed -e 's:.framework/.*:.framework:' | sort | uniq`"
-       for fwk in $frameworks ; do
-               rsync -av \
-               --exclude "Headers/" \
-               --exclude "*_debug*" \
-               $fwk "$pkglib"
-       done
 fi # GTK+ / Qt
 
 # Find out libs we need from Fink, MacPorts, or from a custom install
@@ -400,7 +395,6 @@ elif [ "$ui_toolkit" = "qt" ] ; then
        lib_dep_search_list="
                $pkgexec/Wireshark
                $lib_dep_search_list
-               $pkglib/Qt*.framework/Versions/[0-9]*/*
                "
 fi
 
@@ -532,12 +526,6 @@ rpathify_files () {
                rpathify_dir "$pkglib/pango/$pango_version/modules" "*.so"
        fi
        rpathify_dir "$pkgbin" "*"
-       if [ "$ui_toolkit" = "qt" ] ; then
-               rpathify_dir "$pkgexec" "Wireshark"
-               for fwk_dir in "$pkglib/Qt*.framework/Versions/[0-9]*" ; do
-                       rpathify_dir "$fwk_dir" "*"
-               done
-       fi
 }
 
 PATHLENGTH=`echo $LIBPREFIX | wc -c`
@@ -557,4 +545,8 @@ else
 
 fi
 
+if [ "$ui_toolkit" = "qt" ] ; then
+       macdeployqt "$package" -verbose=2
+fi
+
 exit 0