1 | #!/bin/bash |
1 | #!/bin/bash |
2 | |
2 | |
3 | # this gem of a hack gathers all fiels required by the client for the platform |
3 | # this gem of a hack gathers all files required by the client for the platform |
4 | # by deep magic, it works on osx, linux and windows. on MY osx, linux |
4 | # by deep magic, it works on osx, linux and windows. on MY osx, linux |
5 | # and windows, that is. |
5 | # and windows, that is. |
6 | |
6 | |
7 | STRIP="strip" |
7 | STRIP="strip" |
8 | LIBEXT=so |
8 | LIBEXT=so |
… | |
… | |
17 | |
17 | |
18 | if [ "$(uname -s)" = CYGWIN_NT-5.0 ]; then |
18 | if [ "$(uname -s)" = CYGWIN_NT-5.0 ]; then |
19 | . ~/.setenv |
19 | . ~/.setenv |
20 | |
20 | |
21 | OS=windows |
21 | OS=windows |
22 | URLADER=.exe |
22 | URLADER=windows-x86 |
23 | unset PANGO |
23 | unset PANGO |
24 | PERL=/c/perl/bin/perl |
24 | PERL=/c/perl/bin/perl |
25 | MAKE=nmake |
25 | MAKE=nmake |
26 | SYSLIB=/c/gtk/bin |
26 | SYSLIB=/c/gtk/bin |
27 | LIBEXT=dll |
27 | LIBEXT=dll |
… | |
… | |
37 | /c/gtk/bin/pango-querymodules # empty output usually |
37 | /c/gtk/bin/pango-querymodules # empty output usually |
38 | } |
38 | } |
39 | |
39 | |
40 | elif [ "$(uname -s)" = Darwin ]; then |
40 | elif [ "$(uname -s)" = Darwin ]; then |
41 | OS=darwin |
41 | OS=darwin |
42 | URLADER=-osx105 |
42 | URLADER=darwin-x86 |
43 | PANGO=1.6.0 |
43 | PANGO=1.6.0 |
44 | PERL=/opt/local/bin/perl |
44 | PERL=/opt/local/bin/perl |
45 | GENPACK_ENVVARS="DYLD_LIBRARY_PATH=." |
45 | GENPACK_ENVVARS="DYLD_LIBRARY_PATH=." |
46 | |
46 | |
47 | SYSLIB=/opt/local/lib |
47 | SYSLIB=/opt/local/lib |
48 | LIB0=dylib |
48 | LIB0=dylib |
49 | SO=bundle |
49 | SO=bundle |
50 | STRIP="strip -x" |
50 | STRIP="strip -x" |
51 | elif [ $(arch) = i686 ]; then |
51 | elif [ $(arch) = i686 ]; then |
52 | OS=linux |
52 | OS=linux |
53 | URLADER=-x86 |
53 | URLADER=linux-x86 |
54 | PANGO=1.5.0 |
54 | PANGO=1.5.0 |
55 | PERL=/usr/bin/perl |
55 | PERL=/usr/bin/perl |
56 | else |
56 | else |
57 | OS=linux |
57 | OS=linux |
58 | URLADER=-amd64 |
58 | URLADER=linux-amd64 |
59 | PANGO=1.5.0 |
59 | PANGO=1.5.0 |
60 | PERL=/usr/bin/perl |
60 | PERL=/usr/bin/perl |
61 | ARCHNAME=amd64 |
61 | ARCHNAME=amd64 |
62 | fi |
62 | fi |
63 | |
63 | |
… | |
… | |
70 | #PANGO=1.6.0 |
70 | #PANGO=1.6.0 |
71 | |
71 | |
72 | export EV_EVENTFD=0 |
72 | export EV_EVENTFD=0 |
73 | export EV_INOTIFY=0 |
73 | export EV_INOTIFY=0 |
74 | export EV_SIGNALFD=0 |
74 | export EV_SIGNALFD=0 |
75 | |
|
|
76 | if true; then |
|
|
77 | for mod in deliantra/Deliantra deliantra/Deliantra-Client; do |
|
|
78 | # for mod in common-sense AnyEvent EV JSON-XS deliantra/Deliantra Compress-LZF BDB Guard deliantra/Deliantra-Client; do |
|
|
79 | # for mod in CFPlus; do |
|
|
80 | ( |
|
|
81 | cd /root/src/$mod || exit |
|
|
82 | cvs update -AdP |
|
|
83 | rm -rf blib |
|
|
84 | set -x |
|
|
85 | $PERL Makefile.PL </dev/null >/dev/null |
|
|
86 | $MAKE clean >/dev/null |
|
|
87 | $PERL Makefile.PL </dev/null >/dev/null |
|
|
88 | if ! $MAKE install >log 2>&1; then |
|
|
89 | echo |
|
|
90 | echo error while building $mod |
|
|
91 | cat log |
|
|
92 | exit |
|
|
93 | fi |
|
|
94 | rm -f log |
|
|
95 | $MAKE clean >/dev/null |
|
|
96 | ) || exit |
|
|
97 | done |
|
|
98 | fi |
|
|
99 | |
75 | |
100 | cat <<EOF >"$DIST"/pango.rc |
76 | cat <<EOF >"$DIST"/pango.rc |
101 | [Pango] |
77 | [Pango] |
102 | ModuleFiles = pango.modules |
78 | ModuleFiles = pango.modules |
103 | EOF |
79 | EOF |
… | |
… | |
106 | exec 5>"$DIST"/pango.modules |
82 | exec 5>"$DIST"/pango.modules |
107 | pango-querymodules | grep ^/ | while read lib rest; do |
83 | pango-querymodules | grep ^/ | while read lib rest; do |
108 | base=$(basename "$lib") |
84 | base=$(basename "$lib") |
109 | [ "$base" = pango-basic-x.$LIBEXT ] && continue |
85 | [ "$base" = pango-basic-x.$LIBEXT ] && continue |
110 | cp -p "$lib" "$DIST"/. |
86 | cp -p "$lib" "$DIST"/. |
111 | echo "$base $rest" >&5 |
87 | echo "./$base $rest" >&5 # using ./ seems to help pango not to rummage around in /usr/lib etc. |
112 | done |
88 | done |
113 | ) |
89 | ) |
114 | |
90 | |
115 | ############################################################################# |
91 | ############################################################################# |
116 | |
92 | |
… | |
… | |
282 | rm -f lib"$lib".$LIB0 |
258 | rm -f lib"$lib".$LIB0 |
283 | done |
259 | done |
284 | |
260 | |
285 | if [ "$OS" != windows ]; then |
261 | if [ "$OS" != windows ]; then |
286 | # patch braindamaged pango |
262 | # patch braindamaged pango |
|
|
263 | |
|
|
264 | if [ "$OS" != darwin ]; then |
287 | set libpango-1.0.$LIB0 |
265 | set libpango-1.0.$LIB0 |
288 | perl -pe 's{/u(?=sr/lib(32)?/pango)}{/\x00}g; s{\Q'$PANGO'\E\x00}{y.t.u\x00}g' <"$1" >"$1~" && mv "$1~" "$1" |
266 | perl -pe 's{/u(?=sr/lib(32)?/pango)}{.\x00}g;' <"$1" >"$1~" && mv "$1~" "$1" |
|
|
267 | else |
|
|
268 | set lib*pango-1.0.0.dylib |
|
|
269 | perl -pe 's{/o(?=pt/local/.../pango)}{.\x00}g;' <"$1" >"$1~" && mv "$1~" "$1" |
|
|
270 | fi |
289 | chmod 755 "$1" |
271 | chmod 755 "$1" |
290 | fi |
272 | fi |
291 | |
273 | |
292 | if [ "$OS" = darwin ]; then |
274 | if [ "$OS" = darwin ]; then |
293 | # "dll hell" is most severe on os x, because apple |
275 | # "dll hell" is most severe on os x, because apple |
… | |
… | |
327 | patchlibs "$lib" |
309 | patchlibs "$lib" |
328 | mv "$lib" "libdeliantra-$stem.dylib" |
310 | mv "$lib" "libdeliantra-$stem.dylib" |
329 | done |
311 | done |
330 | fi |
312 | fi |
331 | |
313 | |
332 | [ "$OS" = linux ] && chrpath -d perl # debian perls have an rpath. really. |
314 | [ "$OS" = linux ] && chrpath -d perl $(find pm -name "*.so") # debian perls have an rpath, many modules too |
333 | $STRIP $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl |
315 | $STRIP $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl |
|
|
316 | |
|
|
317 | : >timidity.cfg |
334 | ) |
318 | ) |
335 | |
319 | |
336 | printf -- urlader$URLADER >"$DIST".urlader |
320 | cat >"$DIST".vars <<EOF |
|
|
321 | G_URLADER="$URLADER" |
|
|
322 | G_OS="$OS" |
|
|
323 | G_ARCHNAME="$ARCHNAME" |
|
|
324 | G_ENVVARS="$GENPACK_ENVVARS" |
|
|
325 | G_COMMAND="./perl run" |
|
|
326 | EOF |
337 | |
327 | |
338 | echo >"$DIST".genpack genpack deliantra_S-$OS-"$ARCHNAME" '"$EXE_VER"' '"$1"' $GENPACK_ENVVARS ./perl run |
|
|
339 | |
|
|
340 | exit |
|
|
341 | |
|
|
342 | |
|
|
343 | tar cf deliantra-gnu-linux-$ARCHNAME.tar deliantra-gnu-linux-$ARCHNAME |
|
|
344 | gzip -9vf deliantra-gnu-linux-$ARCHNAME.tar |
|
|
345 | todata deliantra-gnu-linux-$ARCHNAME.tar.gz |
|
|
346 | |
|
|