ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/Deliantra-Client/makebin.osx
Revision: 1.10
Committed: Fri Dec 5 14:49:09 2008 UTC (15 years, 7 months ago) by root
Branch: MAIN
CVS Tags: rel-2_02, rel-2_0, rel-2_03
Changes since 1.9: +3 -2 lines
Log Message:
*** empty log message ***

File Contents

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