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