1 | #!/bin/bash |
1 | #!/bin/bash |
2 | |
2 | |
3 | # Convert a gtk2-perl program to a standalone OS X binary |
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 | export MACOSX_DEPLOYMENT_TARGET=10.5 # nope |
4 | |
9 | |
5 | PERL=/opt/local |
10 | PERL=/opt/local |
6 | PERLLIB=/usr/lib/perl5 |
11 | PERLLIB=/usr/lib/perl5 |
7 | PANGO=1.6.0 |
|
|
8 | |
12 | |
9 | if false; then |
13 | umask 022 |
|
|
14 | |
|
|
15 | if true; then |
10 | for mod in AnyEvent EV JSON-XS Deliantra Compress-LZF BDB; do |
16 | for mod in AnyEvent EV JSON-XS deliantra/Deliantra Compress-LZF BDB; do |
11 | ( |
17 | ( |
12 | cd /root/src/$mod |
18 | cd /root/src/$mod |
|
|
19 | set -x |
|
|
20 | pwd |
|
|
21 | rsync -avPessh 10.0.0.1:src/$mod/. . --del |
13 | $PERL/bin/perl Makefile.PL </dev/null |
22 | $PERL/bin/perl Makefile.PL </dev/null |
14 | make clean |
23 | make clean |
15 | $PERL/bin/perl Makefile.PL </dev/null |
24 | $PERL/bin/perl Makefile.PL </dev/null |
16 | make install || exit |
25 | make install || exit |
17 | make clean |
26 | make clean |
18 | ) |
27 | ) || exit |
19 | done |
28 | done |
20 | fi |
29 | fi |
|
|
30 | |
|
|
31 | if true; then |
21 | |
32 | |
22 | ( |
33 | ( |
23 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
34 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
24 | |
35 | |
25 | echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst" |
36 | echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst" |
… | |
… | |
83 | |
94 | |
84 | trap "rm -f addlist pango.rc pango.modules fonts.conf" 0 |
95 | trap "rm -f addlist pango.rc pango.modules fonts.conf" 0 |
85 | |
96 | |
86 | cd /root/src/deliantra/Deliantra-Client |
97 | cd /root/src/deliantra/Deliantra-Client |
87 | |
98 | |
88 | #$PERL/bin/perl Makefile.PL |
99 | $PERL/bin/perl Makefile.PL |
89 | #make clean |
100 | make clean |
90 | #$PERL/bin/perl Makefile.PL |
101 | $PERL/bin/perl Makefile.PL |
91 | make install || exit |
102 | make install || exit |
92 | |
103 | |
93 | DYLD_LIBRARY_PATH=/opt/local/lib \ |
104 | DYLD_LIBRARY_PATH=/opt/local/lib \ |
94 | $PERL/bin/pp -C \ |
105 | $PERL/bin/pp -C \ |
|
|
106 | -z 9 \ |
95 | -M AnyEvent::Impl::EV \ |
107 | -M AnyEvent::Impl::EV \ |
96 | -M attributes \ |
108 | -M attributes \ |
97 | -a "blib/arch/auto/Deliantra/Client/Client.bundle;lib/auto/Deliantra/Client/Client.bundle" \ |
109 | -a "blib/arch/auto/Deliantra/Client/Client.bundle;lib/auto/Deliantra/Client/Client.bundle" \ |
98 | -o deliantra-macosx-10.5.bin -A addlist bin/deliantra || exit |
110 | -o deliantra -A addlist bin/deliantra || exit |
99 | |
111 | |
|
|
112 | fi |
100 | |
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 | <string>10.5</string> |
|
|
160 | <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 | cat >dmg/README.txt <<EOF |
|
|
174 | Hello! |
|
|
175 | |
|
|
176 | This disk image contains the Deliantra MORPG game client. |
|
|
177 | |
|
|
178 | 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 | 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 | # now, the last third, putting all this into a dmg |
|
|
223 | |
|
|
224 | 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 | rm -rf dmg |
|
|
229 | |
|
|
230 | chmod 644 ~user/$DMG |
|
|
231 | echo http://data.plan9.de/"$DMG" |
|
|
232 | rsync -avPessh ~user/"$DMG" ruth:/var/www/data.plan9.de/. |
|
|
233 | |
|
|
234 | |
|
|
235 | |