#!/bin/bash # Convert a gtk2-perl program to a standalone OS X binary PERL=/opt/local PERLLIB=/usr/lib/perl5 PANGO=1.6.0 umask 022 if false; then for mod in AnyEvent EV JSON-XS Deliantra Compress-LZF BDB; do ( cd /root/src/$mod $PERL/bin/perl Makefile.PL pango.rc echo "pango.rc;root/pango.rc" ( grep ^/opt /opt/local/etc/pango/pango.modules | while read so rest; do base=$(basename "$so") echo "$so;root/$base" echo "$base $rest" >&5 done ) 5>pango.modules echo "pango.modules;root/pango.modules" for lib in \ db-4.6 \ glib-2.0.0 gobject-2.0.0 gmodule-2.0.0 \ pango-1.0.0 pangoft2-1.0.0 \ SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0 \ vorbisfile vorbis.0 ogg.0 \ png12 jpeg.62 z.1 \ fontconfig.1 expat.1 freetype.6 intl.8 iconv.2; do echo "/opt/local/lib/lib$lib.dylib;shlib/darwin-2level/lib$lib.dylib" done cat >>fonts.conf < mono monospace sans serif sans-serif sans sans-serif fontconfig-cache 0x00200x00A00x00AD0x034F0x06000x06010x06020x06030x06DD0x070F0x115F0x11600x16800x17B40x17B50x180E0x20000x20010x20020x20030x20040x20050x20060x20070x20080x20090x200A0x200B0x200C0x200D0x200E0x200F0x20280x20290x202A0x202B0x202C0x202D0x202E0x202F0x205F0x20600x20610x20620x20630x206A0x206B0x206C0x206D0x206E0x206F0x28000x30000x31640xFEFF0xFFA00xFFF90xFFFA0xFFFB EOF echo "fonts.conf;root/fonts.conf" ) >addlist #cat pango.modules;exit trap "rm -f addlist pango.rc pango.modules fonts.conf" 0 cd /root/src/deliantra/Deliantra-Client #$PERL/bin/perl Makefile.PL #make clean #$PERL/bin/perl Makefile.PL make install || exit DYLD_LIBRARY_PATH=/opt/local/lib \ $PERL/bin/pp -C \ -z 9 \ -M AnyEvent::Impl::EV \ -M attributes \ -a "blib/arch/auto/Deliantra/Client/Client.bundle;lib/auto/Deliantra/Client/Client.bundle" \ -o deliantra -A addlist bin/deliantra || exit fi # for other OS'es, we would be finished now, but for OS X, this is just one third of the process :/ # create the app VER=$(perl -e 'require "DC.pm"; print $DC::VERSION') APP="Deliantra MORPG Client $VER" rm -rf "Deliantra MORPG Client "*.app mkdir "$APP".app "$APP".app/Contents "$APP".app/Contents/MacOS "$APP".app/Contents/Resources ln deliantra "$APP".app/Contents/MacOS/run ln osx/deliantra.icns "$APP".app/Contents/Resources/ cat >"$APP.app/Contents/Info.plist" < CFBundleDevelopmentRegion English CFBundleDisplayName Deliantra MORPG Client CFBundleExecutable run CFBundleGetInfoString Deliantra MORPG Client $VER (www.deliantra.net) CFBundleIconFile deliantra.icns CFBundleIdentifier net.deliantra.client CFBundleInfoDictionaryVersion 6.0 CFBundleName Deliantra MORPG Client CFBundlePackageType APPL CFBundleShortVersionString $VER CFBundleVersionString $VER.$(date "+%Y.%m.%d.%H.%M.%S") CFBundleSignature ???? LSHasLocalizedDisplayName LSMinimumSystemVersion 10.5 NSAppleScriptEnabled NSHumanReadableCopyright Deliantra MORPG Client - Copyright 2008 The Deliantra Team EOF rm -rf dmg mkdir dmg mv "$APP.app" dmg/ # now, the last third, putting all this into a dmg hdiutil create -srcfolder dmg -volname "Deliantra MORPG Client" -ov -format UDZO ~user/"Deliantra_MORPG_Client-$VER".dmg ls -l ~user/"Deliantra_MORPG_Client-$VER".dmg rm -rf dmg