From c64475f36e161b83d7545c491321b3a9a44382c3 Mon Sep 17 00:00:00 2001 From: Alexander Kojevnikov Date: Thu, 30 Aug 2012 10:38:41 -0700 Subject: [PATCH] osx: Update the bundle script --- .gitignore | 2 +- Makefile.am | 4 - configure.ac | 2 +- dist/osx/{Info.plist => Info.plist.in} | 8 +- dist/osx/README.md | 10 +- dist/osx/bundle.sh | 29 ++--- dist/osx/gtkrc | 2 - dist/osx/launcher.sh | 167 ------------------------- dist/osx/spek.bundle | 44 ------- dist/osx/spek.modules.in | 45 ------- 10 files changed, 27 insertions(+), 286 deletions(-) rename dist/osx/{Info.plist => Info.plist.in} (82%) delete mode 100644 dist/osx/gtkrc delete mode 100755 dist/osx/launcher.sh delete mode 100644 dist/osx/spek.bundle delete mode 100644 dist/osx/spek.modules.in diff --git a/.gitignore b/.gitignore index 68a9227..f6aebcb 100644 --- a/.gitignore +++ b/.gitignore @@ -18,9 +18,9 @@ configure data/spek.desktop data/spek.desktop.in depcomp +dist/osx/Info.plist dist/osx/Spek.app dist/osx/Spek.dmg -dist/osx/spek.modules dist/win/Spek dist/win/spek.wxs install-sh diff --git a/Makefile.am b/Makefile.am index 3eeb69e..d0b4032 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,10 +14,6 @@ EXTRA_DIST = \ dist/osx/README.md \ dist/osx/Spek.icns \ dist/osx/bundle.sh \ - dist/osx/gtkrc \ - dist/osx/launcher.sh \ - dist/osx/spek.bundle \ - dist/osx/spek.modules \ dist/win/README.md \ dist/win/banner.bmp \ dist/win/bundle.bat \ diff --git a/configure.ac b/configure.ac index f0e5f07..ec971c3 100644 --- a/configure.ac +++ b/configure.ac @@ -64,7 +64,7 @@ AC_CONFIG_FILES([ data/icons/32x32/Makefile data/icons/48x48/Makefile data/icons/scalable/Makefile - dist/osx/spek.modules + dist/osx/Info.plist dist/win/spek.wxs lib/Makefile man/Makefile diff --git a/dist/osx/Info.plist b/dist/osx/Info.plist.in similarity index 82% rename from dist/osx/Info.plist rename to dist/osx/Info.plist.in index 7ea295d..ff15794 100644 --- a/dist/osx/Info.plist +++ b/dist/osx/Info.plist.in @@ -7,7 +7,7 @@ CFBundleExecutable Spek CFBundleGetInfoString - Spek 0.4 + Spek @VERSION@ CFBundleIconFile Spek.icns CFBundleIdentifier @@ -17,13 +17,13 @@ CFBundlePackageType APPL CFBundleShortVersionString - 0.4 + @VERSION@ CFBundleSignature ???? CFBundleVersion - 0.4 + @VERSION@ NSHumanReadableCopyright - Copyright (c) 2010-2011 Alexander Kojevnikov + Copyright (c) 2010-2012 Alexander Kojevnikov and contributors LSMinimumSystemVersion 10.4 diff --git a/dist/osx/README.md b/dist/osx/README.md index 9973f5e..fcbd7ba 100644 --- a/dist/osx/README.md +++ b/dist/osx/README.md @@ -2,7 +2,7 @@ Using [MacPorts](http://www.macports.org/) install build dependencies: - port install git-core autoconf automake intltool yasm. + port install git-core autoconf automake intltool upx yasm. Download and build wxWidgets 2.9+, example configure flags: @@ -17,10 +17,12 @@ Copy the wxWidgets m4 macro to the MacPorts tree: Download and build FFmpeg, example configure flags: - ./configure --prefix=$HOME/usr --disable-shared --disable-debug --disable-doc \ - --enable-gpl --enable-version3 --disable-nonfree --disable-ffmpeg --disable-ffplay \ + ./configure --prefix=$HOME/usr --enable-gpl --enable-version3 \ + --enable-runtime-cpudetect --enable-pthreads \ + --disable-shared --disable-debug --disable-doc \ + --disable-nonfree --disable-ffmpeg --disable-ffplay \ --disable-ffprobe --disable-ffserver --disable-avdevice --disable-swscale \ - --disable-postproc --enable-pthreads --disable-encoders --disable-muxers \ + --disable-postproc --disable-encoders --disable-muxers \ --disable-devices --disable-filters --disable-swresample make && make install diff --git a/dist/osx/bundle.sh b/dist/osx/bundle.sh index af60c22..9910e49 100755 --- a/dist/osx/bundle.sh +++ b/dist/osx/bundle.sh @@ -1,23 +1,29 @@ #!/bin/sh case "$(uname)" in - Darwin) profile_name=darwin ;; + Darwin) ;; *) echo "Unsupported system type: $(uname)" exit 1 ;; esac -cd $(dirname $0) +cd $(dirname $0)/../.. -ige-mac-bundler spek.bundle +rm -f src/spek +make || exit 1 +strip src/spek +upx src/spek -cd Spek.app/Contents/Resources -mkdir share/locale_ -mv share/locale/{cs,da,de,eo,es,fr,it,ja,nl,pl,pt_BR,ru,sv,uk,zh_CN,zh_TW} share/locale_/ -rm -fr share/locale -mv share/locale_ share/locale -cd ../../.. +cd dist/osx +rm -fr Spek.app +mkdir -p Spek.app/Contents/MacOS +mkdir -p Spek.app/Contents/Resources +mv ../../src/spek Spek.app/Contents/MacOS/Spek +cp Info.plist Spek.app/Contents/ +cp Spek.icns Spek.app/Contents/Resources/ + +# mv share/locale/{cs,da,de,eo,es,fr,it,ja,nl,pl,pt_BR,ru,sv,uk,zh_CN,zh_TW} share/locale_/ # Make DMG image VOLUME_NAME=Spek @@ -58,11 +64,6 @@ mv $DMG_FILE $DMG_FILE.master echo "Creating distributable image..." hdiutil convert -quiet -format UDBZ -o $DMG_FILE $DMG_FILE.master -#echo "Installing end user license agreement..." -#hdiutil flatten -quiet $DMG_FILE -#/Developer/Tools/Rez /Developer/Headers/FlatCarbon/*.r dmg-data/license.r -a -o $DMG_FILE -#hdiutil unflatten -quiet $DMG_FILE - echo "Done." if [ ! "x$1" = "x-m" ]; then diff --git a/dist/osx/gtkrc b/dist/osx/gtkrc deleted file mode 100644 index 5049eda..0000000 --- a/dist/osx/gtkrc +++ /dev/null @@ -1,2 +0,0 @@ -gtk-theme-name = "Quartz" -gtk-enable-mnemonics = 0 diff --git a/dist/osx/launcher.sh b/dist/osx/launcher.sh deleted file mode 100755 index d637953..0000000 --- a/dist/osx/launcher.sh +++ /dev/null @@ -1,167 +0,0 @@ -#!/bin/sh - -if test "x$IGE_DEBUG_LAUNCHER" != x; then - set -x -fi - -if test "x$IGE_DEBUG_GDB" != x; then - EXEC="gdb --args" -else - EXEC=exec -fi - -name="`basename $0`" -tmp="`pwd`/$0" -tmp=`dirname "$tmp"` -tmp=`dirname "$tmp"` -bundle=`dirname "$tmp"` -bundle_contents="$bundle"/Contents -bundle_res="$bundle_contents"/Resources -bundle_lib="$bundle_res"/lib -bundle_bin="$bundle_res"/bin -bundle_data="$bundle_res"/share -bundle_etc="$bundle_res"/etc - -export DYLD_LIBRARY_PATH="$bundle_lib" -export XDG_CONFIG_DIRS="$bundle_etc"/xdg -export XDG_DATA_DIRS="$bundle_data" -export GTK_DATA_PREFIX="$bundle_res" -export GTK_EXE_PREFIX="$bundle_res" -export GTK_PATH="$bundle_res" - -export GTK2_RC_FILES="$bundle_etc/gtk-2.0/gtkrc" -export GDK_PIXBUF_MODULE_FILE="$bundle_etc/gdk-pixbuf-2.0/2.10.0/gdk-pixbuf.loaders" -export PANGO_SYSCONFDIR="$bundle_etc" - -APP=spek -I18NDIR="$bundle_data/locale" -# Set the locale-related variables appropriately: -unset LANG LC_MESSAGES LC_MONETARY LC_COLLATE - -# Has a language ordering been set? -# If so, set LC_MESSAGES and LANG accordingly; otherwise skip it. -# First step uses sed to clean off the quotes and commas, to change - to _, and change the names for the chinese scripts from "Hans" to CN and "Hant" to TW. -APPLELANGUAGES=`defaults read .GlobalPreferences AppleLanguages | sed -En -e 's/\-/_/' -e 's/Hant/TW/' -e 's/Hans/CN/' -e 's/[[:space:]]*\"?([[:alnum:]_]+)\"?,?/\1/p' ` -if test "$APPLELANGUAGES"; then - # A language ordering exists. - # Test, item per item, to see whether there is an corresponding locale. - for L in $APPLELANGUAGES; do - #test for exact matches: - if test -f "$I18NDIR/${L}/LC_MESSAGES/$APP.mo"; then - export LANG=$L - break - fi - #This is a special case, because often the original strings are in US - #English and there is no translation file. - if test "x$L" == "xen_US"; then - export LANG=$L - break - fi - #OK, now test for just the first two letters: - if test -f "$I18NDIR/${L:0:2}/LC_MESSAGES/$APP.mo"; then - export LANG=${L:0:2} - break - fi - #Same thing, but checking for any english variant. - if test "x${L:0:2}" == "xen"; then - export LANG=$L - break - fi; - done -fi -unset APPLELANGUAGES L - -# If we didn't get a language from the language list, try the Collation preference, in case it's the only setting that exists. -APPLECOLLATION=`defaults read .GlobalPreferences AppleCollationOrder` -if test -z ${LANG} -a -n $APPLECOLLATION; then - if test -f "$I18NDIR/${APPLECOLLATION:0:2}/LC_MESSAGES/$APP.mo"; then - export LANG=${APPLECOLLATION:0:2} - fi -fi -if test ! -z $APPLECOLLATION; then - export LC_COLLATE=$APPLECOLLATION -fi -unset APPLECOLLATION - -# Continue by attempting to find the Locale preference. -APPLELOCALE=`defaults read .GlobalPreferences AppleLocale` - -if test -f "$I18NDIR/${APPLELOCALE:0:5}/LC_MESSAGES/$APP.mo"; then - if test -z $LANG; then - export LANG="${APPLELOCALE:0:5}" - fi - -elif test -z $LANG -a -f "$I18NDIR/${APPLELOCALE:0:2}/LC_MESSAGES/$APP.mo"; then - export LANG="${APPLELOCALE:0:2}" -fi - -#Next we need to set LC_MESSAGES. If at all possilbe, we want a full -#5-character locale to avoid the "Locale not supported by C library" -#warning from Gtk -- even though Gtk will translate with a -#two-character code. -if test -n $LANG; then -#If the language code matches the applelocale, then that's the message -#locale; otherwise, if it's longer than two characters, then it's -#probably a good message locale and we'll go with it. - if test $LANG == ${APPLELOCALE:0:5} -o $LANG != ${LANG:0:2}; then - export LC_MESSAGES=$LANG -#Next try if the Applelocale is longer than 2 chars and the language -#bit matches $LANG - elif test $LANG == ${APPLELOCALE:0:2} -a $APPLELOCALE > ${APPLELOCALE:0:2}; then - export LC_MESSAGES=${APPLELOCALE:0:5} -#Fail. Get a list of the locales in $PREFIX/share/locale that match -#our two letter language code and pick the first one, special casing -#english to set en_US - elif test $LANG == "en"; then - export LC_MESSAGES="en_US" - else - LOC=`find $PREFIX/share/locale -name $LANG???` - for L in $LOC; do - export LC_MESSAGES=$L - done - fi -else -#All efforts have failed, so default to US english - export LANG="en_US" - export LC_MESSAGES="en_US" -fi -CURRENCY=`echo $APPLELOCALE | sed -En 's/.*currency=([[:alpha:]]+).*/\1/p'` -if test "x$CURRENCY" != "x"; then -#The user has set a special currency. Gtk doesn't install LC_MONETARY files, but Apple does in /usr/share/locale, so we're going to look there for a locale to set LC_CURRENCY to. - if test -f /usr/local/share/$LC_MESSAGES/LC_MONETARY; then - if test -a `cat /usr/local/share/$LC_MESSAGES/LC_MONETARY` == $CURRENCY; then - export LC_MONETARY=$LC_MESSAGES - fi - fi - if test -z "$LC_MONETARY"; then - FILES=`find /usr/share/locale -name LC_MONETARY -exec grep -H $CURRENCY {} \;` - if test -n "$FILES"; then - export LC_MONETARY=`echo $FILES | sed -En 's%/usr/share/locale/([[:alpha:]_]+)/LC_MONETARY.*%\1%p'` - fi - fi -fi -#No currency value means that the AppleLocale governs: -if test -z "$LC_MONETARY"; then - LC_MONETARY=${APPLELOCALE:0:5} -fi -#For Gtk, which only looks at LC_ALL: -export LC_ALL=$LC_MESSAGES - -unset APPLELOCALE FILES LOC - -if test -f "$bundle_lib/charset.alias"; then - export CHARSETALIASDIR="$bundle_lib" -fi - -# Extra arguments can be added in environment.sh. -EXTRA_ARGS= -if test -f "$bundle_res/environment.sh"; then - source "$bundle_res/environment.sh" -fi - -# Strip out the argument added by the OS. -if [ x`echo "x$1" | sed -e "s/^x-psn_.*//"` == x ]; then - shift 1 -fi - -$EXEC "$bundle_contents/MacOS/$name-bin" $* $EXTRA_ARGS diff --git a/dist/osx/spek.bundle b/dist/osx/spek.bundle deleted file mode 100644 index 0142953..0000000 --- a/dist/osx/spek.bundle +++ /dev/null @@ -1,44 +0,0 @@ - - - - ${env:JHBUILD_PREFIX} - ${project} - - ${project}/launcher.sh - gtk+-2.0 - - ${project}/Info.plist - ${prefix}/bin/spek - - ${prefix}/lib/${gtkdir}/modules/*.so - - - ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/*.so - - - ${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so - - - ${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so - - - ${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/*.so - - - - ${prefix}/share/locale - - - ${prefix}/share/icons - ${prefix}/share/locale - ${prefix}/share/themes/Quartz - - ${project}/Spek.icns - - - ${project}/gtkrc - - - hicolor - - diff --git a/dist/osx/spek.modules.in b/dist/osx/spek.modules.in deleted file mode 100644 index 974537a..0000000 --- a/dist/osx/spek.modules.in +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -