Use macdeployqt to add the Qt bits to our bundle. Put our libraries in
authorGerald Combs <gerald@wireshark.org>
Mon, 30 Sep 2013 13:12:28 +0000 (13:12 -0000)
committerGerald Combs <gerald@wireshark.org>
Mon, 30 Sep 2013 13:12:28 +0000 (13:12 -0000)
Contents/Frameworks since that's what macdeployqt expects. Have
osx-dmg.sh look at the correct executable.

svn path=/trunk/; revision=52295

configure.ac
packaging/macosx/osx-app.sh
packaging/macosx/osx-dmg.sh.in

index 914d41964b6412810b8b0c17e1b6d762bd415deb..9997aea9b215fb35cd28470b9cabe24601d3e89b 100644 (file)
@@ -1075,7 +1075,7 @@ darwin*)
        # libraries in the rpath, rather than having a script tweak
        # DYLD_LIBRARY_PATH.
        #
-       LDFLAGS="-Wl,-search_paths_first -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/../Resources/lib -Wl,-rpath,/usr/local/lib $LDFLAGS"
+       LDFLAGS="-Wl,-search_paths_first -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,/usr/local/lib $LDFLAGS"
        AC_MSG_RESULT([Apple linker - added -Wl,-single_module and -Wl,-search_paths_first, and rpaths])
        ;;
 cygwin*)
index bdfa4a99e870de2b7335f4f9a605eb39c8e8eb06..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"
@@ -210,12 +209,15 @@ pkgexec="$package/Contents/MacOS"
 pkgres="$package/Contents/Resources"
 pkgbin="$pkgres/bin"
 # Should pkglib be Contents/Frameworks instead?
-pkglib="$pkgres/lib"
+#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"
 
@@ -369,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
@@ -401,7 +395,6 @@ elif [ "$ui_toolkit" = "qt" ] ; then
        lib_dep_search_list="
                $pkgexec/Wireshark
                $lib_dep_search_list
-               $pkglib/Qt*.framework/Versions/[0-9]*/Qt*
                "
 fi
 
@@ -494,29 +487,6 @@ rpathify_file () {
                                echo "Changing reference to $lib in $1"
                                /usr/bin/install_name_tool -change $lib $to $1
                        done
-                       #
-                       # Rewrite framework paths
-                       #
-                       if [ "$ui_toolkit" = "qt" ] ; then
-                               frameworks="`otool -L $1 | egrep "Qt.*framework/.* \(compatibility" | cut -d\( -f1`"
-                               for fwk in $frameworks ; do
-                                       #
-                                       # Get the file name of the framework.
-                                       #
-                                       base=`echo $fwk | awk 'BEGIN{FS="/";OFS="/"} {print $(NF-3), $(NF-2), $(NF-1), $NF}'`
-                                       #
-                                       # The library will end up in a directory in
-                                       # the rpath; this is what we should change its
-                                       # file name to.
-                                       #
-                                       to=@rpath/$base
-                                       #
-                                       # Change the reference to that library.
-                                       #
-                                       echo "Changing reference to $fwk in $1"
-                                       /usr/bin/install_name_tool -change $fwk $to $1
-                               done
-                       fi
                        ;;
                esac
        fi
@@ -556,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" "Qt*"
-               done
-       fi
 }
 
 PATHLENGTH=`echo $LIBPREFIX | wc -c`
@@ -581,4 +545,8 @@ else
 
 fi
 
+if [ "$ui_toolkit" = "qt" ] ; then
+       macdeployqt "$package" -verbose=2
+fi
+
 exit 0
index 8d2abbe1816fdc45caffdb9ba39ff96cff85816a..30d3e225cd98820184fbe271a1bb8a185ab5e5fe 100755 (executable)
@@ -59,6 +59,11 @@ then
        PATH=$PATH:$developer_path/Tools:$developer_path/usr/bin
 fi
 
+if [ ! -f "$ws_bin" ] ; then
+       # Assume it's a native (Qt) build
+       ws_bin="$app_bundle/Contents/MacOS/Wireshark"
+fi
+
 # Help message
 #----------------------------------------------------------
 help()