ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/makebin.osx
Revision: 1.9
Committed: Mon Sep 29 03:44:12 2008 UTC (15 years, 7 months ago) by root
Branch: MAIN
CVS Tags: rel-0_9978, rel-0_9977
Changes since 1.8: +11 -7 lines
Log Message:
*** empty log message ***

File Contents

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