#!/bin/bash # Convert a gtk2-perl program to a standalone OS X binary # need to patch libSDL_image from /opt/local/lib/libjpeg.dylib to ./libjpeg.62.dylib #export MACOSX_DEPLOYMENT_TARGET=10.3 # maybe it helps export MACOSX_DEPLOYMENT_TARGET=10.5 # nope PERL=/opt/local PERLLIB=/usr/lib/perl5 umask 022 if true; then for mod in AnyEvent EV JSON-XS deliantra/Deliantra Compress-LZF BDB; do ( cd /root/src/$mod set -x pwd rsync -avPessh 10.0.0.1:src/$mod/. . --del $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/ cat >dmg/README.txt < Graphics tab and then go to Setup => Login, enter a nickname (no spaces, only ASCII letters supported) and a password, then hit Login. You can also install the client application by dragging it onto your harddisk or anywhere else, but it should play perfectly fine from the disk image. The game stores configuration settings, map data, music and other resources in a hidden directory called .deliantra in your home directory. The script "Reset Configuration" will reset the configuration and delete any downloaded resources. You can use this when you no longer want to play Deliantra, or when you have problems with the settings (window too large etc.). Unfortunately, Mac OS X has quite buggy OpenGL support: make sure your monitor cable is plugged in correctly when you can't go into fullscreen or when the graphics look broken. See http://www.deliantra.net/ for more info. EOF cat >dmg/"Reset Configuration" <