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