Ticket #48363: patch-osxapp.2.diff
File patch-osxapp.2.diff, 12.1 KB (added by mdeaudelin (Mathieu Deaudelin-Lemay), 9 years ago) |
---|
-
Makefile.am
# Changed Makefile to install app bundle in the proper location # and to provide the install prefix to the osx-app.sh script. diff -uNrw Makefile.am.orig Makefile.am
old new 1582 1582 cd $(srcdir)/packaging/macosx ; \ 1583 1583 ./osx-app.sh @OSX_APP_FLAGS@ \ 1584 1584 --create-bundle \ 1585 -l ${prefix} \ 1585 1586 --binary-path ../staging/$(PACKAGE).inst$(bindir) ; \ 1586 1587 else \ 1587 1588 echo "Error: OS X packaging tools not found." ; \ … … 1601 1602 1602 1603 osx-install: osx-app 1603 1604 @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \ 1604 echo "Copying Wireshark.app to /Applications" ; \1605 cp -p r $(srcdir)/packaging/macosx/Wireshark.app /Applications; \1605 echo "Copying Wireshark.app to $(APPLICATIONS_DIR)" ; \ 1606 cp -pPR $(srcdir)/packaging/macosx/Wireshark.app $(DESTDIR)$(APPLICATIONS_DIR) ; \ 1606 1607 fi 1607 1608 1608 1609 test-programs: -
Makefile.in
diff -uNrw Makefile.in.orig Makefile.in
old new 4290 4290 cd $(srcdir)/packaging/macosx ; \ 4291 4291 ./osx-app.sh @OSX_APP_FLAGS@ \ 4292 4292 --create-bundle \ 4293 -l ${prefix} \ 4293 4294 --binary-path ../staging/$(PACKAGE).inst$(bindir) ; \ 4294 4295 else \ 4295 4296 echo "Error: OS X packaging tools not found." ; \ … … 4309 4310 4310 4311 osx-install: osx-app 4311 4312 @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \ 4312 echo "Copying Wireshark.app to /Applications" ; \4313 cp -p r $(srcdir)/packaging/macosx/Wireshark.app /Applications; \4313 echo "Copying Wireshark.app to $(APPLICATIONS_DIR)" ; \ 4314 cp -pPR $(srcdir)/packaging/macosx/Wireshark.app $(DESTDIR)$(APPLICATIONS_DIR) ; \ 4314 4315 fi 4315 4316 4316 4317 test-programs: -
packaging/macosx/osx-app.sh
# Change the script to build an application bundle which contains only # symbolic links to the executables in their locations under $prefix. diff -uNrw packaging/macosx/osx-app.sh.orig packaging/macosx/osx-app.sh
old new 52 52 binary_list=" 53 53 androiddump 54 54 capinfos 55 captype 55 56 dftest 56 57 dumpcap 57 58 editcap 58 59 mergecap 59 60 randpkt 60 61 rawshark 62 reordercap 61 63 text2pcap 62 64 tshark 63 65 " … … 207 209 EXTRALIBS="" 208 210 fi 209 211 212 # Force building in 32-bit. 213 XCODEFLAGS="$XCODEFLAGS -arch i386" 214 210 215 # Set the SDK root, if an SDK was specified. 211 216 # (-sdk is only supported by the xcodebuild in the version of the 212 217 # developer tools that came with Snow Leopard and later versions) … … 245 250 mkdir -p "$pkgplugin" 246 251 247 252 if [ "$ui_toolkit" = "qt" ] ; then 248 cp -v "$binary_path/$wireshark_bin_name" "$pkgexec/Wireshark"253 ln -sv "$LIBPREFIX/bin/$wireshark_bin_name" "$pkgexec/Wireshark" 249 254 else 250 255 # Build and add the launcher 251 256 #---------------------------------------------------------- … … 270 275 for binary in $binary_list wireshark ; do 271 276 # Copy the binary to its destination 272 277 dest_path="$pkgbin/$binary-bin" 273 cs_binary_list="$cs_binary_list $dest_path" 274 cp -v "$binary_path/$binary" "$dest_path" 275 # TODO Add a "$verbose" variable and command line switch, which sets wether these commands are verbose or not 278 # wireshark-bin is wireshark-gtk 279 [ "$binary" = "wireshark" ] && binary=$wireshark_bin_name 280 281 ln -sv "$LIBPREFIX/bin/$binary" "$dest_path" 276 282 277 283 if [ "$binary" != "wireshark" ] ; then 278 284 ln -sv ./wireshark "$pkgbin/$binary" … … 280 286 done 281 287 elif [ "$ui_toolkit" = "qt" ] ; then 282 288 for binary in $binary_list ; do 283 # Copy the binary to its destination 284 cp -v "$binary_path/$binary" "$pkgexec" 285 cs_binary_list="$cs_binary_list $pkgexec/$binary" 289 ln -sv "$LIBPREFIX/bin/$binary" "$pkgexec/" 286 290 done 287 291 fi 288 292 289 # The rest of the Wireshark installation (we handled bin above)290 rsync -av \291 --exclude bin/ \292 --exclude lib/ \293 "$binary_path/.."/* "$pkgres"293 # Symlink each item that would have been copied to the Resources folder. 294 mkdir -p "$pkgres/" 295 for rsrcdir in "$(find "$binary_path/../" -depth 1 \! -name bin \! -name lib)"; do 296 ln -sv "$LIBPREFIX/$(basename "$rsrcdir")" "$pkgres/" 297 done 294 298 295 rsync -av $binary_path/../lib/*.dylib "$pkglib/" 299 # Don't copy libraries, symlink Frameworks (or Resources/lib) to $LIBPREFIX/lib. 300 ln -sfv "$LIBPREFIX/lib" "$pkglib" 296 301 297 # Copy the plugins from the "make install" location for them 298 # to the plugin directory, removing the version number 299 find "$binary_path/../lib/wireshark/plugins" \ 300 -type f \ 301 \( -name "*.so" -o -name "*.dylib" \) \ 302 -exec cp -fv "{}" "$pkgplugin/" \; 302 # Symlink ${bundle}/Contents/PlugIns to ${prefix}/lib/wireshark/plugins/${version} 303 rm -rf "$pkgplugin" 304 for plvers in "$(find "$binary_path/../lib/wireshark/plugins" -depth 1 -type d -name ?.*.*)"; do 305 ln -sfv "$LIBPREFIX/lib/wireshark/plugins/$(basename "$plvers")" "$pkgplugin" 306 done 303 307 304 308 cp "$plist" "$bundle/Contents/Info.plist" 305 309 … … 313 317 res_list=" 314 318 $res_list 315 319 bin 316 etc317 320 openDoc 318 321 script 319 322 MenuBar.nib 320 323 ProgressWindow.nib 321 themes322 324 " 323 325 fi 324 326 325 327 for rl_entry in $res_list ; do 326 rsync -av "$resdir"/Resources/$rl_entry "$ bundle"/Contents/Resources/328 rsync -av "$resdir"/Resources/$rl_entry "$pkgres/" 327 329 done 328 330 331 # Make sure that GTK launcher scripts are executable. 332 [ "$ui_toolkit" = "gtk" ] && chmod a+x "$pkgres/"{script,openDoc} "$pkgbin/wireshark" 333 329 334 # PkgInfo must match bundle type and creator code from Info.plist 330 335 echo "APPLWshk" > $bundle/Contents/PkgInfo 331 336 337 # Stop execution here. This build is not meant to be relocated. 338 return 0 339 332 340 if [ "$ui_toolkit" = "gtk" ] ; then 333 341 echo -e "\nPulling in GTK+ libraries and resources...\n" 334 342 … … 404 412 create_bundle 405 413 fi 406 414 415 # Do not execute the rest of the script as the app is not meant to be relocated. 416 exit 0 417 407 418 echo -e "\nFixing up $bundle...\n" 408 419 409 420 # Find out libs we need from Fink, MacPorts, or from a custom install -
packaging/macosx/Resources/bin/wireshark
# Change the launcher script to remove all parts where environment variables # are set to accomodate relocatable application bundles since ours isn't. diff -uNrw packaging/macosx/Resources/bin/wireshark.orig packaging/macosx/Resources/bin/wireshark
old new 21 21 # http://developer.apple.com/qa/qa2001/qa1067.html 22 22 # but since no one does, we correct this by making the 'classic' PATH additions here: 23 23 # /usr/local/bin which, though standard, doesn't seem to be in the PATH 24 # newer python as recommended by MacPython http://www.python.org/download/mac/25 24 # Fink 26 25 # MacPorts (former DarwinPorts) 27 export PATH="/opt/local/bin:/sw/bin /:/Library/Frameworks/Python.framework/Versions/Current/bin:/usr/local/bin:$CWD:$PATH"26 export PATH="/opt/local/bin:/sw/bin:/usr/local/bin:$CWD:$PATH" 28 27 29 28 if [ "$APPNAME" == "wireshark" ] ; then # Apply GUI settings 30 # For Panther and Tiger, override the default fontconfig configuration31 # XXX - This apparently isn't needed?32 #if [[ $VERSION -le 4 ]]; then33 export FONTCONFIG_PATH="$TOP/etc/fonts"34 #fi35 export PANGO_RC_FILE="$HOME/.wireshark-etc/pangorc"36 export GTK_IM_MODULE_FILE="$HOME/.wireshark-etc/gtk.immodules"37 export GDK_PIXBUF_MODULE_FILE="$HOME/.wireshark-etc/gdk-pixbuf.loaders"38 export GTK_DATA_PREFIX="$TOP"39 export GTK_EXE_PREFIX="$TOP"40 export GNOME_VFS_MODULE_CONFIG_PATH="$TOP/etc/gnome-vfs-2.0/modules"41 export GNOME_VFS_MODULE_PATH="$TOP/lib/gnome-vfs-2.0/modules"42 43 # Set GTK theme (only if there is no .gtkrc-2.0 in the user's home)44 if [[ ! -e "$HOME/.gtkrc-2.0" ]]; then45 # prepare the theme depending on OS X appearance settings46 (47 cd "$TOP/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/"48 ./sync_osx_look.sh49 # TODO: make this more robust, probably by integrating this script directly inline here50 )51 export GTK2_RC_FILES="$TOP/themes/Clearlooks-Quicksilver-OSX/gtk-2.0/gtkrc"52 fi53 29 54 30 # TODO: Have to add ".UTF-8" to the LANG since ommiting causes Wireshark 55 31 # to crash on startup in locale_from_utf8(). … … 57 33 2>&1\`_\" /usr/share/locale/locale.alias | tail -n1 | sed 's/\./ /' | \ 58 34 awk '{print $2}'`.UTF-8" 59 35 60 # Handle the case where the directory storing Wireshark has a '#' in the name.61 # This '#' needs to be escaped in pango.modules for Pango to work properly.62 ESCAPEDTOP=`echo $TOP | sed 's/#/\\\\\\\\#/'`63 64 mkdir -p "${HOME}/.wireshark-etc"65 sed 's|${HOME}|'"$HOME|g" "$TOP/etc/pango/pangorc" > "${HOME}/.wireshark-etc/pangorc"66 sed 's|${CWD}|'"$ESCAPEDTOP|g" "$TOP/etc/pango/pango.modules" \67 > "${HOME}/.wireshark-etc/pango.modules"68 cp -f "$TOP/etc/pango/pangox.aliases" "${HOME}/.wireshark-etc/"69 sed 's|${CWD}|'"$TOP|g" "$TOP/etc/gtk-2.0/gtk.immodules" \70 > "${HOME}/.wireshark-etc/gtk.immodules"71 sed 's|${CWD}|'"$TOP|g" "$TOP/etc/gtk-2.0/gdk-pixbuf.loaders" \72 > "${HOME}/.wireshark-etc/gdk-pixbuf.loaders"73 36 fi 74 37 75 38 exec "$CWD/$APPNAME-bin" "$@" -
packaging/macosx/Resources/bin/getdisplay.sh
# Remove all parts of launcher scripts that are specific to Mac OS X 10.4 and earlier # since this version of wireshark doesn't run on it anyway. diff -uNrw packaging/macosx/Resources/bin/getdisplay.sh.orig packaging/macosx/Resources/bin/getdisplay.sh
old new 1 #!/bin/sh2 #3 # Author: Aaron Voisine <aaron@voisine.org>4 5 if [ "$DISPLAY"x == "x" ]; then6 echo :0 > /tmp/display.$UID7 else8 echo $DISPLAY > /tmp/display.$UID9 fi -
packaging/macosx/Resources/openDoc
diff -uNrw packaging/macosx/Resources/openDoc.orig packaging/macosx/Resources/openDoc
old new 5 5 6 6 CWD="`dirname \"$0\"`" 7 7 8 # System version: 3 for Panther, 4 for Tiger, 5 for Leopard9 export VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'`10 11 if [[ $VERSION -le 4 ]]; then12 export "DISPLAY=`cat /tmp/display.$UID`"13 fi14 15 8 BASE="`echo "$0" | sed -e 's/\/[A-Za-z]*.app\/Contents\/Resources\/openDoc/\//'`" 16 9 cd "$BASE" 17 10 exec "$CWD/bin/wireshark" "$@" 18 -
packaging/macosx/Resources/script
diff -uNrw packaging/macosx/Resources/script.orig packaging/macosx/Resources/script
old new 5 5 6 6 CWD="`dirname \"$0\"`" 7 7 8 # System version: 3 for Panther, 4 for Tiger, 5 for Leopard9 export VERSION=`/usr/bin/sw_vers | grep ProductVersion | cut -f2 -d'.'`10 11 # On Leopard, X11.app is installed by default, and will be started12 # automatically via launchd. On older systems, we need to start13 # X11 ourself.14 15 # For Panther and Tiger, start X1116 if [[ $VERSION -le 4 ]]; then17 # FIXME apparently this removes the xterm that starts with X18 # from xinitrc but when is it really used? Should we modify19 # the .xinitrc of the user without warning?20 ps -wx -ocommand | grep -e '[X]11' > /dev/null21 if [ "$?" != "0" -a ! -f "${HOME}/.xinitrc" ]; then22 echo "rm -f \"${HOME}/.xinitrc\"" > "${HOME}/.xinitrc"23 sed 's/xterm/# xterm/' /usr/X11R6/lib/X11/xinit/xinitrc >> "${HOME}/.xinitrc"24 fi25 26 # Start X11 and get DISPLAY27 cp -f "$CWD/bin/getdisplay.sh" /tmp/28 rm -f /tmp/display.$UID29 open-x11 /tmp/getdisplay.sh || \30 open -a XDarwin /tmp/getdisplay.sh || \31 echo ":0" > /tmp/display.$UID32 33 while [ "$?" == "0" -a ! -f /tmp/display.$UID ]; do34 sleep 135 done36 export DISPLAY="`cat /tmp/display.$UID`"37 38 ps -wx -ocommand | grep -e '[X]11' > /dev/null || exit 1139 fi40 41 42 8 # Warn the user about time-consuming generation of fontconfig caches. 43 test -f "${HOME}/.wireshark/.fccache-new" || exit 12 44 9 # Check first if the user already has a cache, then check if we already warned. 10 test -d "${HOME}/.cache/fontconfig" || test -f "${HOME}/.wireshark/.fccache-new" || exit 12 45 11 46 12 BASE="`echo "$0" | sed -e 's/\/Contents\/Resources\/script/\//'`" 47 13 cd "$BASE" 48 14 exec "$CWD/bin/wireshark" "$@" 49 # TODO examine wether it would be wisest to move the code from wireshark shell50 # script and getdisplay.sh to here and only keep the real binary in bin. This51 # may make things easier on Leopard and may also help using Wireshark on the52 # command line53