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