ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/makebin.osx
(Generate patch)

Comparing deliantra/Deliantra-Client/makebin.osx (file contents):
Revision 1.1 by root, Tue Aug 19 21:48:28 2008 UTC vs.
Revision 1.20 by root, Mon Dec 26 03:58:12 2011 UTC

1#!/bin/bash 1#!/opt/local/bin/bash
2 2
3# Convert a gtk2-perl program to a standalone OS X binary 3# Convert a gtk2-perl program to a standalone OS X binary
4 4
5# port install libsdl +no_x11 libsdl_mixer libsdl_image libvorbis libpng jpeg pango db46 libogg p5-libwww-perl p5-yaml db52
6# port install bash wget
7# need to patch libSDL_image from /opt/local/lib/libjpeg.dylib to ./libjpeg.8.dylib
8# ln -s db46/db.h /opt/local/include
9# ln -s db46/libdb.dylib /opt/local/lib
10# /opt/local/bin/cpan Pod::POM
11
12#export MACOSX_DEPLOYMENT_TARGET=10.3 # maybe it helps
13#export MACOSX_DEPLOYMENT_TARGET=10.5 # nope
14
15cvs update
16
5PERL=/opt/local 17PREFIX=/opt/local
6PERLLIB=/usr/lib/perl5 18PERL=$PREFIX
7PANGO=1.6.0 19DB1=4
20DB2=6
8 21
9if false; then 22ln -sf $PREFIX/include/db$DB1$DB2/db.h $PREFIX/include/db.h
10 for mod in AnyEvent EV JSON-XS Deliantra Compress-LZF BDB; do 23rm -f $PREFIX/lib/libdb-$DB1.$DB2.dylib
24cp -p $PREFIX/lib/db$DB1$DB2/libdb-$DB1.$DB2.dylib $PREFIX/lib/libdb-$DB1.$DB2.dylib
25
26eval $(perl -V:sitelib)
27PERLLIB=$sitelib
28
29OPTLIBS=(
30 db-4.6
31 glib-2.0.0 gobject-2.0.0 gmodule-2.0.0
32 pango-1.0.0 pangoft2-1.0.0
33 SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0
34 vorbisfile vorbis.0 ogg.0
35 png14.14 jpeg.8 tiff.3 z.1
36 fontconfig.1 expat.1 freetype.6 intl.8 iconv.2
37)
38
39declare -A deliantrified
40
41deliantrify_lib() {
42 local lib="$1"
43
44 [ "${deliantrified["$lib"]}" ] && exit 0
45 deliantrified["$lib"]=+
46
47 (
48 cd $PREFIX/lib || exit 69
49 echo "deliantrifying $lib"
50 cp -p lib$lib.dylib libdeliantra-$lib.dylib || exit 68
51 install_name_tool -id libdeliantra-$lib.dylib libdeliantra-$lib.dylib
52 for lib2 in $(otool -L libdeliantra-$lib.dylib | perl -ne 'print "$1\n" if m%'"$PREFIX/lib/lib"'(\S+).dylib%'); do
53 deliantrify_lib "$lib2"
54 install_name_tool -change lib$lib2.dylib libdeliantra-$lib2.dylib libdeliantra-$lib.dylib
55 done
56 ) || exit
57}
58
59# don't ask...
60#for lib in "${OPTLIBS[@]}"; do
61# deliantrify_lib "$lib"
62#done
63
64umask 022
65
66if true; then
67 for mod in common-sense AnyEvent EV JSON-XS Compress-LZF BDB Guard deliantra/Deliantra; do
11 ( 68 (
69 mkdir -p /root/src/$mod || exit 77
12 cd /root/src/$mod 70 cd /root/src/$mod
71 set -x
72 pwd
73 rsync -avPessh 10.0.0.1:src/$mod/. . --del --exclude "*.tar.gz" --delete-excluded
13 $PERL/bin/perl Makefile.PL </dev/null 74 $PERL/bin/perl Makefile.PL </dev/null
14 make clean 75 make clean
15 $PERL/bin/perl Makefile.PL </dev/null 76 $PERL/bin/perl Makefile.PL </dev/null
16 make install || exit 77 make install || exit
17 make clean 78 make clean
18 ) 79 ) || exit
19 done 80 done
20fi 81fi
21 82
83exit 0
84
85if true; then
86
22( 87(
23 perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST 88 perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST
24 89
25 echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst" 90 echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst"
26 91
27#pangoversion;root/pangoversion 92#pangoversion;root/pangoversion
28#/opt/local/lib/libglib-2.0.so.0;shlib/darwin-2level/libglib-2.0.dylib 93#/opt/local/lib/libglib-2.0.so.0;shlib/darwin-multi-2level/libglib-2.0.dylib
29#/lib/libgcc_s.so.1;shlib/darwin-2level/libgcc_s.so.1 94#/lib/libgcc_s.so.1;shlib/darwin-multi-2level/libgcc_s.so.1
30#/opt/local/lib/libstdc++.so.6;shlib/darwin-2level/libstdc++.so.6 95#/opt/local/lib/libstdc++.so.6;shlib/darwin-multi-2level/libstdc++.so.6
31#/opt/local/lib/libaudio.so.2;shlib/darwin-2level/libaudio.so.2 96#/opt/local/lib/libaudio.so.2;shlib/darwin-multi-2level/libaudio.so.2
32 97
33 ( echo "[Pango]"; echo "ModuleFiles = pango.modules" ) > pango.rc 98 ( echo "[Pango]"; echo "ModuleFiles = pango.modules" ) > pango.rc
34 echo "pango.rc;root/pango.rc" 99 echo "pango.rc;root/pango.rc"
35 100
36 ( 101 (
40 echo "$base $rest" >&5 105 echo "$base $rest" >&5
41 done 106 done
42 ) 5>pango.modules 107 ) 5>pango.modules
43 echo "pango.modules;root/pango.modules" 108 echo "pango.modules;root/pango.modules"
44 109
45 for lib in \ 110 for lib in "${OPTLIBS[@]}"; do
46 db-4.6 \
47 glib-2.0.0 gobject-2.0.0 gmodule-2.0.0 \
48 pango-1.0.0 pangoft2-1.0.0 \
49 SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0 \
50 vorbisfile vorbis.0 ogg.0 \
51 png12 jpeg.62 z.1 \
52 fontconfig.1 expat.1 freetype.6 intl.8 iconv.2;
53 do
54 echo "/opt/local/lib/lib$lib.dylib;shlib/darwin-2level/lib$lib.dylib" 111 echo "/opt/local/lib/lib$lib.dylib;shlib/darwin-multi-2level/lib$lib.dylib"
55 done 112 done
56 113
57 cat >>fonts.conf <<EOF
58<?xml version="1.0"?>
59<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
60<fontconfig>
61
62 <match target="pattern"> <test qual="any" name="family"> <string>mono</string> </test> <edit name="family" mode="assign"> <string>monospace</string> </edit> </match>
63
64 <match target="pattern"> <test qual="any" name="family"> <string>sans serif</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match>
65
66 <match target="pattern"> <test qual="any" name="family"> <string>sans</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match>
67
68 <cachedir>fontconfig-cache</cachedir>
69
70 <config>
71 <blank>
72 <int>0x0020</int><int>0x00A0</int><int>0x00AD</int><int>0x034F</int><int>0x0600</int><int>0x0601</int><int>0x0602</int><int>0x0603</int><int>0x06DD</int><int>0x070F</int><int>0x115F</int><int>0x1160</int><int>0x1680</int><int>0x17B4</int><int>0x17B5</int><int>0x180E</int><int>0x2000</int><int>0x2001</int><int>0x2002</int><int>0x2003</int><int>0x2004</int><int>0x2005</int><int>0x2006</int><int>0x2007</int><int>0x2008</int><int>0x2009</int><int>0x200A</int><int>0x200B</int><int>0x200C</int><int>0x200D</int><int>0x200E</int><int>0x200F</int><int>0x2028</int><int>0x2029</int><int>0x202A</int><int>0x202B</int><int>0x202C</int><int>0x202D</int><int>0x202E</int><int>0x202F</int><int>0x205F</int><int>0x2060</int><int>0x2061</int><int>0x2062</int><int>0x2063</int><int>0x206A</int><int>0x206B</int><int>0x206C</int><int>0x206D</int><int>0x206E</int><int>0x206F</int><int>0x2800</int><int>0x3000</int><int>0x3164</int><int>0xFEFF</int><int>0xFFA0</int><int>0xFFF9</int><int>0xFFFA</int><int>0xFFFB</int>
73 </blank>
74 </config>
75
76</fontconfig>
77EOF
78 echo "fonts.conf;root/fonts.conf"
79
80) >addlist 114) >addlist
81 115
82#cat pango.modules;exit 116#cat pango.modules;exit
83 117
84trap "rm -f addlist pango.rc pango.modules fonts.conf" 0 118trap "rm -f addlist pango.rc pango.modules fonts.conf" 0
85 119
86cd /root/src/deliantra/Deliantra-Client
87
88#$PERL/bin/perl Makefile.PL 120$PERL/bin/perl Makefile.PL
89#make clean 121make clean
90#$PERL/bin/perl Makefile.PL 122$PERL/bin/perl Makefile.PL
91make install || exit 123make install || exit
92 124
93DYLD_LIBRARY_PATH=/opt/local/lib \ 125DYLD_LIBRARY_PATH=/opt/local/lib \
94$PERL/bin/pp -C \ 126$PERL/bin/pp -C \
127 -z 9 \
95 -M AnyEvent::Impl::EV \ 128 -M AnyEvent::Impl::EV \
96 -M attributes \ 129 -M attributes \
97 -a "blib/arch/auto/Deliantra/Client/Client.bundle;lib/auto/Deliantra/Client/Client.bundle" \ 130 -a "blib/arch/auto/Deliantra/Client/Client.bundle;lib/auto/Deliantra/Client/Client.bundle" \
98 -o deliantra-macosx-10.5.bin -A addlist bin/deliantra || exit 131 -o deliantra -A addlist bin/deliantra || exit
99 132
133fi
100 134
135# for other OS'es, we would be finished now, but for OS X, this is just one third of the process :/
136# create the app
137
138VER=$(perl -e 'require "DC.pm"; print $DC::VERSION')
139APP="Deliantra MORPG Client $VER"
140
141rm -rf "Deliantra MORPG Client "*.app
142
143mkdir "$APP".app "$APP".app/Contents "$APP".app/Contents/MacOS "$APP".app/Contents/Resources
144
145ln deliantra "$APP".app/Contents/MacOS/run
146ln osx/deliantra.icns "$APP".app/Contents/Resources/
147
148cat >"$APP.app/Contents/Info.plist" <<EOF
149<?xml version="1.0" encoding="UTF-8"?>
150<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
151<plist version="1.0">
152<dict>
153 <key>CFBundleDevelopmentRegion</key>
154 <string>English</string>
155 <key>CFBundleDisplayName</key>
156 <string>Deliantra MORPG Client</string>
157 <key>CFBundleExecutable</key>
158 <string>run</string>
159 <key>CFBundleGetInfoString</key>
160 <string>Deliantra MORPG Client $VER (www.deliantra.net)</string>
161 <key>CFBundleIconFile</key>
162 <string>deliantra.icns</string>
163 <key>CFBundleIdentifier</key>
164 <string>net.deliantra.client</string>
165 <key>CFBundleInfoDictionaryVersion</key>
166 <string>6.0</string>
167 <key>CFBundleName</key>
168 <string>Deliantra MORPG Client</string>
169 <key>CFBundlePackageType</key>
170 <string>APPL</string>
171 <key>CFBundleShortVersionString</key>
172 <string>$VER</string>
173 <key>CFBundleVersionString</key>
174 <string>$VER.$(date "+%Y.%m.%d.%H.%M.%S")</string>
175 <key>CFBundleSignature</key>
176 <string>????</string>
177 <key>LSHasLocalizedDisplayName</key>
178 <false/>
179 <key>LSMinimumSystemVersion</key>
180 <string>10.5</string>
181 <key>NSAppleScriptEnabled</key>
182 <false/>
183 <key>NSHumanReadableCopyright</key>
184 <string>Deliantra MORPG Client - Copyright 2008,2009 The Deliantra Team</string>
185</dict>
186</plist>
187EOF
188
189rm -rf dmg
190mkdir dmg
191
192mv "$APP.app" dmg/
193
194cat >dmg/README.txt <<EOF
195Hello!
196
197This disk image contains the Deliantra MORPG game client.
198
199The client has been compiled for Intel systems only.
200
201The client uses a lot of right mouse button click pop-up menus, to emulate
202a right-click with a mouse that has only one button, use ctrl-click.
203
204To play it, simply double-click it, then select a good graphics resolution
205in the Setup => Graphics tab and then go to Setup => Login, enter a nickname
206(no spaces, only ASCII letters supported) and a password, then hit Login.
207
208You can also install the client application by dragging it onto your
209harddisk or anywhere else, but it should play perfectly fine from the disk
210image.
211
212The game stores configuration settings, map data, music and other resources
213in a hidden directory called .deliantra in your home directory.
214
215The script "Reset Configuration" will reset the configuration and delete
216any downloaded resources. You can use this when you no longer want to play
217Deliantra, or when you have problems with the settings (window too large
218etc.).
219
220Unfortunately, Mac OS X has quite buggy OpenGL support: make sure your
221monitor cable is plugged in correctly when you can't go into fullscreen or
222when the graphics look broken.
223
224See http://www.deliantra.net/ for more info.
225
226EOF
227
228cat >dmg/"Reset Configuration" <<EOF
229#!/bin/sh
230
231rm -rf ~/.deliantra
232
233echo
234echo
235echo
236echo
237echo
238echo Configuration/Cache Cleared
239
240EOF
241chmod 755 dmg/"Reset Configuration"
242
243# now, the last third, putting all this into a dmg
244
245DMG="Deliantra_MORPG_Client-$VER".dmg
246
247hdiutil create -srcfolder dmg -volname "Deliantra MORPG Client" -ov -format UDZO ~user/"$DMG"
248ls -l ~user/"$DMG"
249rm -rf dmg
250
251chmod 644 ~user/$DMG
252echo http://data.plan9.de/"$DMG"
253rsync -avPessh ~user/"$DMG" ruth:/var/www/data.plan9.de/.
254
255
256

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines