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