Ticket #48363: patch-osxapp.3.diff
File patch-osxapp.3.diff, 11.9 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 1584 1584 cd $(srcdir)/packaging/macosx ; \ 1585 1585 ./osx-app.sh @OSX_APP_FLAGS@ \ 1586 1586 --create-bundle \ 1587 -l ${prefix} \ 1587 1588 --binary-path ../staging/$(PACKAGE).inst$(bindir) ; \ 1588 1589 else \ 1589 1590 echo "Error: OS X packaging tools not found." ; \ … … 1603 1604 1604 1605 osx-install: osx-app 1605 1606 @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \ 1606 echo "Copying Wireshark.app to /Applications" ; \1607 cp -p r $(srcdir)/packaging/macosx/Wireshark.app /Applications; \1607 echo "Copying Wireshark.app to $(APPLICATIONS_DIR)" ; \ 1608 cp -pPR $(srcdir)/packaging/macosx/Wireshark.app $(DESTDIR)$(APPLICATIONS_DIR) ; \ 1608 1609 fi 1609 1610 1610 1611 test-programs: -
Makefile.in
diff -uNrw Makefile.in.orig Makefile.in
old new 4294 4294 cd $(srcdir)/packaging/macosx ; \ 4295 4295 ./osx-app.sh @OSX_APP_FLAGS@ \ 4296 4296 --create-bundle \ 4297 -l ${prefix} \ 4297 4298 --binary-path ../staging/$(PACKAGE).inst$(bindir) ; \ 4298 4299 else \ 4299 4300 echo "Error: OS X packaging tools not found." ; \ … … 4313 4314 4314 4315 osx-install: osx-app 4315 4316 @if test x$(HAVE_OSX_PACKAGING) = xyes ; then \ 4316 echo "Copying Wireshark.app to /Applications" ; \4317 cp -p r $(srcdir)/packaging/macosx/Wireshark.app /Applications; \4317 echo "Copying Wireshark.app to $(APPLICATIONS_DIR)" ; \ 4318 cp -pPR $(srcdir)/packaging/macosx/Wireshark.app $(DESTDIR)$(APPLICATIONS_DIR) ; \ 4318 4319 fi 4319 4320 4320 4321 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 227 209 EXTRALIBS="" 228 210 fi 229 211 212 # Force building in 32-bit. 213 XCODEFLAGS="$XCODEFLAGS -arch i386" 214 230 215 # Set the SDK root, if an SDK was specified. 231 216 # (-sdk is only supported by the xcodebuild in the version of the 232 217 # developer tools that came with Snow Leopard and later versions) … … 265 250 mkdir -p "$pkgplugin" 266 251 267 252 if [ "$ui_toolkit" = "qt" ] ; then 268 cp -v "$binary_path/$wireshark_bin_name" "$pkgexec/Wireshark"253 ln -sv "$LIBPREFIX/bin/$wireshark_bin_name" "$pkgexec/Wireshark" 269 254 else 270 255 # Build and add the launcher 271 256 #---------------------------------------------------------- … … 290 275 for binary in $binary_list wireshark ; do 291 276 # Copy the binary to its destination 292 277 dest_path="$pkgbin/$binary-bin" 293 cs_binary_list="$cs_binary_list $dest_path" 294 cp -v "$binary_path/$binary" "$dest_path" 295 # 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" 296 282 297 283 if [ "$binary" != "wireshark" ] ; then 298 284 ln -sv ./wireshark "$pkgbin/$binary" … … 300 286 done 301 287 elif [ "$ui_toolkit" = "qt" ] ; then 302 288 for binary in $binary_list ; do 303 # Copy the binary to its destination 304 cp -v "$binary_path/$binary" "$pkgexec" 305 cs_binary_list="$cs_binary_list $pkgexec/$binary" 289 ln -sv "$LIBPREFIX/bin/$binary" "$pkgexec/" 306 290 done 307 291 fi 308 292 309 # The rest of the Wireshark installation (we handled bin above)310 rsync -av \311 --exclude bin/ \312 --exclude lib/ \313 "$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 314 298 315 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" 316 301 317 # Copy the plugins from the "make install" location for them 318 # to the plugin directory, removing the version number 319 find "$binary_path/../lib/wireshark/plugins" \ 320 -type f \ 321 \( -name "*.so" -o -name "*.dylib" \) \ 322 -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 323 307 324 308 cp "$plist" "$bundle/Contents/Info.plist" 325 309 … … 333 317 res_list=" 334 318 $res_list 335 319 bin 336 etc337 320 openDoc 338 321 script 339 322 MenuBar.nib 340 323 ProgressWindow.nib 341 themes342 324 " 343 325 fi 344 326 345 327 for rl_entry in $res_list ; do 346 rsync -av "$resdir"/Resources/$rl_entry "$ bundle"/Contents/Resources/328 rsync -av "$resdir"/Resources/$rl_entry "$pkgres/" 347 329 done 348 330 331 # Make sure that GTK launcher scripts are executable. 332 [ "$ui_toolkit" = "gtk" ] && chmod a+x "$pkgres/"{script,openDoc} "$pkgbin/wireshark" 333 349 334 # PkgInfo must match bundle type and creator code from Info.plist 350 335 echo "APPLWshk" > $bundle/Contents/PkgInfo 351 336 337 # Stop execution here. This build is not meant to be relocated. 338 return 0 339 352 340 if [ "$ui_toolkit" = "gtk" ] ; then 353 341 echo -e "\nPulling in GTK+ libraries and resources...\n" 354 342 … … 424 412 create_bundle 425 413 fi 426 414 415 # Do not execute the rest of the script as the app is not meant to be relocated. 416 exit 0 417 427 418 echo -e "\nFixing up $bundle...\n" 428 419 429 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