More Qt app bundle migration. Still doesn't work quite right.
authorGerald Combs <gerald@wireshark.org>
Mon, 30 Sep 2013 11:29:58 +0000 (11:29 -0000)
committerGerald Combs <gerald@wireshark.org>
Mon, 30 Sep 2013 11:29:58 +0000 (11:29 -0000)
svn path=/trunk/; revision=52293

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

index 75dc88a6a2b58efbf95f1e8e0c3810d0a6f23251..914d41964b6412810b8b0c17e1b6d762bd415deb 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,/usr/local/lib $LDFLAGS"
+       LDFLAGS="-Wl,-search_paths_first -Wl,-rpath,@executable_path/../lib -Wl,-rpath,@executable_path/../Resources/lib -Wl,-rpath,/usr/local/lib $LDFLAGS"
        AC_MSG_RESULT([Apple linker - added -Wl,-single_module and -Wl,-search_paths_first, and rpaths])
        ;;
 cygwin*)
index f407a23bef1bb9ae6d3a10da4bc6a9bd88d6d11c..bdfa4a99e870de2b7335f4f9a605eb39c8e8eb06 100755 (executable)
@@ -209,7 +209,8 @@ resdir=`pwd`
 pkgexec="$package/Contents/MacOS"
 pkgres="$package/Contents/Resources"
 pkgbin="$pkgres/bin"
-pkglib="$package/Contents/Frameworks"
+# Should pkglib be Contents/Frameworks instead?
+pkglib="$pkgres/lib"
 pkgplugin="$pkglib/wireshark/plugins"
 pkgpython="$pkglib/wireshark/python"
 
@@ -400,7 +401,7 @@ elif [ "$ui_toolkit" = "qt" ] ; then
        lib_dep_search_list="
                $pkgexec/Wireshark
                $lib_dep_search_list
-               $pkglib/Qt*.framework/Versions/[0-9]*/*
+               $pkglib/Qt*.framework/Versions/[0-9]*/Qt*
                "
 fi
 
@@ -493,6 +494,29 @@ 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
@@ -534,8 +558,8 @@ rpathify_files () {
        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" "*"
+               for fwk_dir in $pkglib/Qt*.framework/Versions/[0-9]* ; do
+                       rpathify_dir "$fwk_dir" "Qt*"
                done
        fi
 }