… | |
… | |
5 | # port install libsdl +no_x11 libsdl_mixer libsdl_image libvorbis libpng jpeg pango db46 libogg p5-libwww-perl p5-yaml db52 |
5 | # port install libsdl +no_x11 libsdl_mixer libsdl_image libvorbis libpng jpeg pango db46 libogg p5-libwww-perl p5-yaml db52 |
6 | # port install bash wget |
6 | # port install bash wget |
7 | # need to patch libSDL_image from /opt/local/lib/libjpeg.dylib to ./libjpeg.8.dylib |
7 | # need to patch libSDL_image from /opt/local/lib/libjpeg.dylib to ./libjpeg.8.dylib |
8 | # ln -s db46/db.h /opt/local/include |
8 | # ln -s db46/db.h /opt/local/include |
9 | # ln -s db46/libdb.dylib /opt/local/lib |
9 | # ln -s db46/libdb.dylib /opt/local/lib |
10 | # /opt/local/bin/cpan Pod::POM |
10 | # /opt/local/bin/cpan Pod::POM PAR::Packer |
11 | |
11 | |
12 | #export MACOSX_DEPLOYMENT_TARGET=10.3 # maybe it helps |
12 | #export MACOSX_DEPLOYMENT_TARGET=10.3 # maybe it helps |
13 | #export MACOSX_DEPLOYMENT_TARGET=10.5 # nope |
13 | #export MACOSX_DEPLOYMENT_TARGET=10.5 # nope |
14 | |
14 | |
15 | cvs update |
15 | cvs update |
… | |
… | |
17 | PREFIX=/opt/local |
17 | PREFIX=/opt/local |
18 | PERL=$PREFIX |
18 | PERL=$PREFIX |
19 | DB1=4 |
19 | DB1=4 |
20 | DB2=6 |
20 | DB2=6 |
21 | |
21 | |
|
|
22 | umask 022 |
|
|
23 | |
22 | ln -sf $PREFIX/include/db$DB1$DB2/db.h $PREFIX/include/db.h |
24 | ln -sf $PREFIX/include/db$DB1$DB2/db.h $PREFIX/include/db.h |
23 | rm -f $PREFIX/lib/libdb-$DB1.$DB2.dylib |
25 | rm -f $PREFIX/lib/libdb-$DB1.$DB2.dylib |
24 | cp -p $PREFIX/lib/db$DB1$DB2/libdb-$DB1.$DB2.dylib $PREFIX/lib/libdb-$DB1.$DB2.dylib |
26 | cp -p $PREFIX/lib/db$DB1$DB2/libdb-$DB1.$DB2.dylib $PREFIX/lib/libdb-$DB1.$DB2.dylib |
25 | |
27 | |
26 | eval $(perl -V:sitelib) |
|
|
27 | PERLLIB=$sitelib |
|
|
28 | |
|
|
29 | OPTLIBS=( |
28 | OPTLIBS=( |
30 | db-4.6 |
29 | db-4.6 |
31 | glib-2.0.0 gobject-2.0.0 gmodule-2.0.0 |
30 | gthread-2.0.0 glib-2.0.0 gobject-2.0.0 gmodule-2.0.0 |
32 | pango-1.0.0 pangoft2-1.0.0 |
31 | pango-1.0.0 pangoft2-1.0.0 ffi.5 |
33 | SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0 |
32 | SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0 |
34 | vorbisfile vorbis.0 ogg.0 |
|
|
35 | png14.14 jpeg.8 tiff.3 z.1 |
33 | png14.14 jpeg.8 tiff.3 z.1 bz2.1.0 |
|
|
34 | smpeg-0.4.0 |
|
|
35 | vorbisfile.3 vorbis.0 ogg.0 mikmod.3 FLAC.8 |
36 | fontconfig.1 expat.1 freetype.6 intl.8 iconv.2 |
36 | fontconfig.1 expat.1 freetype.6 intl.8 iconv.2 |
37 | ) |
37 | ) |
38 | |
38 | |
39 | declare -A deliantrified |
39 | declare -A deliantrified |
40 | |
40 | |
|
|
41 | patchlibs() { |
|
|
42 | <"$1" \ |
|
|
43 | perl -0777 -pe ' |
|
|
44 | s%('"$PREFIX/lib[^\x00]*/lib"'([^\x00/]+)\.dylib\x00)% |
|
|
45 | my $s = $1; |
|
|
46 | my $r = "libdeliantra-$2.dylib\x00"; |
|
|
47 | (length $r) <= (length $s) |
|
|
48 | or die "lib replacement <$r> larger than <$s>\n"; |
|
|
49 | substr $s, 0, length $r, $r; |
|
|
50 | $s |
|
|
51 | %ge |
|
|
52 | ' \ |
|
|
53 | >"$1~" && mv "$1~" "$1" || exit 67 |
|
|
54 | } |
|
|
55 | |
|
|
56 | patchbundle() { |
|
|
57 | [ -e "$1.unpatched" ] && [ "$1.unpatched" -ot "$1" ] && ln -f "$1.unpatched" "$1" |
|
|
58 | ln -f "$1" "$1.unpatched" |
|
|
59 | patchlibs "$1" || exit |
|
|
60 | } |
|
|
61 | |
41 | deliantrify_lib() { |
62 | deliantrify_lib() { |
42 | local lib="$1" |
63 | local lib="$1" |
43 | |
64 | |
44 | [ "${deliantrified["$lib"]}" ] && exit 0 |
65 | [ "${deliantrified["$lib"]}" ] && return |
45 | deliantrified["$lib"]=+ |
66 | deliantrified["$lib"]=+ |
46 | |
67 | |
47 | ( |
|
|
48 | cd $PREFIX/lib || exit 69 |
|
|
49 | echo "deliantrifying $lib" |
68 | echo "deliantrifying $lib" |
50 | cp -p lib$lib.dylib libdeliantra-$lib.dylib || exit 68 |
69 | cp -p $PREFIX/lib/lib$lib.dylib $PREFIX/lib/libdeliantra-$lib.dylib || exit 68 |
51 | install_name_tool -id libdeliantra-$lib.dylib libdeliantra-$lib.dylib |
70 | install_name_tool -id libdeliantra-$lib.dylib $PREFIX/lib/libdeliantra-$lib.dylib |
52 | for lib2 in $(otool -L libdeliantra-$lib.dylib | perl -ne 'print "$1\n" if m%'"$PREFIX/lib/lib"'(\S+).dylib%'); do |
71 | for lib2 in $(otool -L $PREFIX/lib/lib$lib.dylib | perl -ne 'print "$1\n" if m%'"$PREFIX/lib/lib"'(\S+).dylib%'); do |
53 | deliantrify_lib "$lib2" |
72 | deliantrify_lib "$lib2" || exit |
54 | install_name_tool -change lib$lib2.dylib libdeliantra-$lib2.dylib libdeliantra-$lib.dylib |
73 | #install_name_tool -change $PREFIX/lib/lib$lib2.dylib libdeliantra-$lib2.dylib $PREFIX/lib/libdeliantra-$lib.dylib |
55 | done |
74 | done |
56 | ) || exit |
75 | patchlibs $PREFIX/lib/libdeliantra-$lib.dylib || exit |
|
|
76 | ln -s $PREFIX/lib/libdeliantra-$lib.dylib /opt/libdeliantra |
57 | } |
77 | } |
58 | |
|
|
59 | # don't ask... |
|
|
60 | #for lib in "${OPTLIBS[@]}"; do |
|
|
61 | # deliantrify_lib "$lib" |
|
|
62 | #done |
|
|
63 | |
|
|
64 | umask 022 |
|
|
65 | |
78 | |
66 | if true; then |
79 | if true; then |
67 | for mod in common-sense AnyEvent EV JSON-XS Compress-LZF BDB Guard deliantra/Deliantra; do |
80 | for mod in common-sense AnyEvent EV JSON-XS Compress-LZF BDB Guard deliantra/Deliantra; do |
68 | ( |
81 | ( |
69 | mkdir -p /root/src/$mod || exit 77 |
82 | mkdir -p /root/src/$mod || exit 77 |
… | |
… | |
78 | make clean |
91 | make clean |
79 | ) || exit |
92 | ) || exit |
80 | done |
93 | done |
81 | fi |
94 | fi |
82 | |
95 | |
83 | exit 0 |
96 | if true; then |
|
|
97 | # don't ask... |
|
|
98 | rm -rf /opt/libdeliantra |
|
|
99 | mkdir /opt/libdeliantra |
|
|
100 | for lib in "${OPTLIBS[@]}"; do |
|
|
101 | deliantrify_lib "$lib" || exit |
|
|
102 | done |
|
|
103 | fi |
|
|
104 | |
|
|
105 | DYLD_LIBRARY_PATH=/opt/libdeliantra:$DYLD_LIBRARY_PATH |
84 | |
106 | |
85 | if true; then |
107 | if true; then |
86 | |
108 | |
87 | ( |
109 | ( |
88 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
110 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
… | |
… | |
99 | echo "pango.rc;root/pango.rc" |
121 | echo "pango.rc;root/pango.rc" |
100 | |
122 | |
101 | ( |
123 | ( |
102 | grep ^/opt /opt/local/etc/pango/pango.modules | while read so rest; do |
124 | grep ^/opt /opt/local/etc/pango/pango.modules | while read so rest; do |
103 | base=$(basename "$so") |
125 | base=$(basename "$so") |
|
|
126 | ln -f "$so" "$so.deliantra" |
|
|
127 | patchlibs "$so.deliantra" |
104 | echo "$so;root/$base" |
128 | echo "$so.deliantra;root/$base" |
105 | echo "$base $rest" >&5 |
129 | echo "$base $rest" >&5 |
106 | done |
130 | done |
107 | ) 5>pango.modules |
131 | ) 5>pango.modules |
108 | echo "pango.modules;root/pango.modules" |
132 | echo "pango.modules;root/pango.modules" |
109 | |
133 | |
110 | for lib in "${OPTLIBS[@]}"; do |
134 | for lib in "${OPTLIBS[@]}"; do |
111 | echo "/opt/local/lib/lib$lib.dylib;shlib/darwin-multi-2level/lib$lib.dylib" |
135 | echo "/opt/local/lib/libdeliantra-$lib.dylib;shlib/darwin-multi-2level/libdeliantra-$lib.dylib" |
112 | done |
136 | done |
113 | |
137 | |
114 | ) >addlist |
138 | ) >addlist |
115 | |
139 | |
116 | #cat pango.modules;exit |
140 | #cat pango.modules;exit |
… | |
… | |
120 | $PERL/bin/perl Makefile.PL |
144 | $PERL/bin/perl Makefile.PL |
121 | make clean |
145 | make clean |
122 | $PERL/bin/perl Makefile.PL |
146 | $PERL/bin/perl Makefile.PL |
123 | make install || exit |
147 | make install || exit |
124 | |
148 | |
125 | DYLD_LIBRARY_PATH=/opt/local/lib \ |
149 | eval $(perl -V:installsitearch) |
|
|
150 | patchbundle "$installsitearch/auto/BDB/BDB.bundle" |
|
|
151 | patchbundle "$installsitearch/auto/Deliantra/Client/Client.bundle" |
|
|
152 | |
126 | $PERL/bin/pp -C \ |
153 | $PERL/bin/pp -C \ |
127 | -z 9 \ |
154 | -z 9 \ |
128 | -M AnyEvent::Impl::EV \ |
155 | -M AnyEvent::Impl::EV \ |
129 | -M attributes \ |
156 | -M attributes \ |
130 | -a "blib/arch/auto/Deliantra/Client/Client.bundle;lib/auto/Deliantra/Client/Client.bundle" \ |
157 | -a "$installsitearch/auto/Deliantra/Client/Client.bundle;lib/auto/Deliantra/Client/Client.bundle" \ |
131 | -o deliantra -A addlist bin/deliantra || exit |
158 | -o deliantra -A addlist bin/deliantra || exit |
132 | |
159 | |
133 | fi |
160 | fi |
134 | |
161 | |
135 | # for other OS'es, we would be finished now, but for OS X, this is just one third of the process :/ |
162 | # for other OS'es, we would be finished now, but for OS X, this is just one third of the process :/ |
… | |
… | |
179 | <key>LSMinimumSystemVersion</key> |
206 | <key>LSMinimumSystemVersion</key> |
180 | <string>10.5</string> |
207 | <string>10.5</string> |
181 | <key>NSAppleScriptEnabled</key> |
208 | <key>NSAppleScriptEnabled</key> |
182 | <false/> |
209 | <false/> |
183 | <key>NSHumanReadableCopyright</key> |
210 | <key>NSHumanReadableCopyright</key> |
184 | <string>Deliantra MORPG Client - Copyright 2008,2009 The Deliantra Team</string> |
211 | <string>Deliantra MORPG Client - Copyright 2008,2009,2010,2011 The Deliantra Team</string> |
185 | </dict> |
212 | </dict> |
186 | </plist> |
213 | </plist> |
187 | EOF |
214 | EOF |
188 | |
215 | |
189 | rm -rf dmg |
216 | rm -rf dmg |
… | |
… | |
244 | |
271 | |
245 | DMG="Deliantra_MORPG_Client-$VER".dmg |
272 | DMG="Deliantra_MORPG_Client-$VER".dmg |
246 | |
273 | |
247 | hdiutil create -srcfolder dmg -volname "Deliantra MORPG Client" -ov -format UDZO ~user/"$DMG" |
274 | hdiutil create -srcfolder dmg -volname "Deliantra MORPG Client" -ov -format UDZO ~user/"$DMG" |
248 | ls -l ~user/"$DMG" |
275 | ls -l ~user/"$DMG" |
249 | rm -rf dmg |
276 | #rm -rf dmg |
250 | |
277 | |
251 | chmod 644 ~user/$DMG |
278 | chmod 644 ~user/$DMG |
252 | echo http://data.plan9.de/"$DMG" |
279 | echo http://data.plan9.de/"$DMG" |
253 | rsync -avPessh ~user/"$DMG" ruth:/var/www/data.plan9.de/. |
280 | rsync -avPessh ~user/"$DMG" rijk.plan9.de:/var/www/data.plan9.de/. |
254 | |
281 | |
255 | |
282 | |
256 | |
283 | |