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