osx: Update the bundle script

This commit is contained in:
Alexander Kojevnikov 2012-08-30 10:38:41 -07:00
parent 5917515756
commit c64475f36e
10 changed files with 27 additions and 286 deletions

2
.gitignore vendored
View File

@ -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

View File

@ -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 \

View File

@ -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

View File

@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>Spek</string>
<key>CFBundleGetInfoString</key>
<string>Spek 0.4</string>
<string>Spek @VERSION@</string>
<key>CFBundleIconFile</key>
<string>Spek.icns</string>
<key>CFBundleIdentifier</key>
@ -17,13 +17,13 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.4</string>
<string>@VERSION@</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.4</string>
<string>@VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright (c) 2010-2011 Alexander Kojevnikov</string>
<string>Copyright (c) 2010-2012 Alexander Kojevnikov and contributors</string>
<key>LSMinimumSystemVersion</key>
<string>10.4</string>
</dict>

10
dist/osx/README.md vendored
View File

@ -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

29
dist/osx/bundle.sh vendored
View File

@ -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

2
dist/osx/gtkrc vendored
View File

@ -1,2 +0,0 @@
gtk-theme-name = "Quartz"
gtk-enable-mnemonics = 0

167
dist/osx/launcher.sh vendored
View File

@ -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

44
dist/osx/spek.bundle vendored
View File

@ -1,44 +0,0 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<app-bundle>
<meta>
<prefix name="default">${env:JHBUILD_PREFIX}</prefix>
<destination overwrite="yes">${project}</destination>
<run-install-name-tool/>
<launcher-script>${project}/launcher.sh</launcher-script >
<gtk>gtk+-2.0</gtk>
</meta>
<plist>${project}/Info.plist</plist>
<main-binary>${prefix}/bin/spek</main-binary>
<binary>
${prefix}/lib/${gtkdir}/modules/*.so
</binary>
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/engines/*.so
</binary>
<binary>
${prefix}/lib/${gtkdir}/${pkg:${gtk}:gtk_binary_version}/printbackends/*.so
</binary>
<binary>
${prefix}/lib/gdk-pixbuf-2.0/${pkg:${gtk}:gtk_binary_version}/loaders/*.so
</binary>
<binary>
${prefix}/lib/pango/${pkg:pango:pango_module_version}/modules/*.so
</binary>
<translations name="gtk20">
${prefix}/share/locale
</translations>
<data>${prefix}/share/icons</data>
<data>${prefix}/share/locale</data>
<data>${prefix}/share/themes/Quartz</data>
<data dest="${bundle}/Contents/Resources">
${project}/Spek.icns
</data>
<data dest="${bundle}/Contents/Resources/etc/${gtkdir}/gtkrc">
${project}/gtkrc
</data>
<icon-theme icons="auto">
hicolor
</icon-theme>
</app-bundle>

View File

@ -1,45 +0,0 @@
<?xml version="1.0"?>
<!DOCTYPE moduleset SYSTEM "moduleset.dtd">
<?xml-stylesheet type="text/xsl" href="moduleset.xsl"?>
<moduleset>
<include href="http://github.com/jralls/gtk-osx-build/raw/master/modulesets-stable/gtk-osx.modules"/>
<repository type="tarball" name="spek" default="yes" href="http://spek.googlecode.com/files/"/>
<repository type="tarball" name="libav" href="http://libav.org/releases/"/>
<repository type="tarball" name="cairographics-dev" href="http://cairographics.org/snapshots/"/>
<repository type="git" name="github.com" href="git://github.com/"/>
<autotools id="cairo" autogen-sh="configure" autogenargs="--enable-pdf --enable-quartz --enable-xlib=no --without-x">
<branch module="cairo-1.11.2.tar.gz" version="1.11.2" repo="cairographics-dev"/>
<dependencies>
<dep package="pixman"/>
</dependencies>
<after>
<dep package="meta-gtk-osx-bootstrap"/>
<dep package="fontconfig"/>
<dep package="freetype"/>
</after>
</autotools>
<autotools id="gtk-quartz-engine">
<branch module="jralls/gtk-quartz-engine" repo="github.com"/>
<after>
<dep package="meta-gtk-osx-core"/>
</after>
</autotools>
<autotools id="libav" autogenargs="--disable-static --enable-shared --enable-gpl --enable-version3 --disable-doc --disable-ffmpeg --disable-ffplay --disable-ffprobe --disable-ffserver --disable-avdevice --disable-swscale --enable-pthreads --disable-encoders --disable-muxers --disable-devices --disable-filters" autogen-sh="configure" autogen-template="%(srcdir)s/%(autogen-sh)s --prefix=%(prefix)s --libdir=%(libdir)s %(autogenargs)s">
<branch module="libav-0.6.2.tar.bz2" version="0.6.2" repo="libav" hash="sha1:b79dc56a08f4ef07b41d1a78b2251f21fde8b81d"/>
</autotools>
<autotools id="spek" autogen-sh="configure">
<branch module="spek-@VERSION@.tar.xz" version="@VERSION@" repo="spek"/>
<dependencies>
<dep package="meta-gtk-osx-bootstrap"/>
<dep package="meta-gtk-osx-core"/>
<dep package="cairo"/>
<dep package="gtk-quartz-engine"/>
<dep package="libav"/>
</dependencies>
</autotools>
</moduleset>