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=windowx-x86 |
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 |
… | |
… | |
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 | |
75 | |
76 | if true; then |
76 | if true; then |
77 | for mod in deliantra/Deliantra deliantra/Deliantra-Client; do |
77 | for mod in Coro IO/AIO AnyEvent EV Urlader 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 |
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 |
79 | # for mod in CFPlus; do |
80 | ( |
80 | ( |
81 | cd /root/src/$mod || exit |
81 | cd /root/src/$mod || exit |
82 | cvs update -AdP |
82 | cvs update -AdP |
… | |
… | |
105 | exec 5>"$DIST"/pango.modules |
105 | exec 5>"$DIST"/pango.modules |
106 | pango-querymodules | grep ^/ | while read lib rest; do |
106 | pango-querymodules | grep ^/ | while read lib rest; do |
107 | base=$(basename "$lib") |
107 | base=$(basename "$lib") |
108 | [ "$base" = pango-basic-x.$LIBEXT ] && continue |
108 | [ "$base" = pango-basic-x.$LIBEXT ] && continue |
109 | cp -p "$lib" "$DIST"/. |
109 | cp -p "$lib" "$DIST"/. |
110 | echo "$base $rest" >&5 |
110 | echo "./$base $rest" >&5 # using ./ seems to help pango not to rummage around in /usr/lib etc. |
111 | done |
111 | done |
112 | ) |
112 | ) |
113 | |
113 | |
114 | ############################################################################# |
114 | ############################################################################# |
115 | |
115 | |
… | |
… | |
281 | rm -f lib"$lib".$LIB0 |
281 | rm -f lib"$lib".$LIB0 |
282 | done |
282 | done |
283 | |
283 | |
284 | if [ "$OS" != windows ]; then |
284 | if [ "$OS" != windows ]; then |
285 | # patch braindamaged pango |
285 | # patch braindamaged pango |
|
|
286 | |
|
|
287 | if [ "$OS" = darwin ]; then |
|
|
288 | set libdeliantra-pango-1.0.0.dylib |
|
|
289 | perl -pe 's{/o(?opt/local/.../pango)}{.\x00}g; s{\Q'$PANGO'\E\x00}{y.t.u\x00}g' <"$1" >"$1~" && mv "$1~" "$1" |
|
|
290 | else |
286 | set libpango-1.0.$LIB0 |
291 | set libpango-1.0.$LIB0 |
287 | 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" |
292 | 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" |
|
|
293 | fi |
288 | chmod 755 "$1" |
294 | chmod 755 "$1" |
289 | fi |
295 | fi |
290 | |
296 | |
291 | if [ "$OS" = darwin ]; then |
297 | if [ "$OS" = darwin ]; then |
292 | # "dll hell" is most severe on os x, because apple |
298 | # "dll hell" is most severe on os x, because apple |
… | |
… | |
326 | patchlibs "$lib" |
332 | patchlibs "$lib" |
327 | mv "$lib" "libdeliantra-$stem.dylib" |
333 | mv "$lib" "libdeliantra-$stem.dylib" |
328 | done |
334 | done |
329 | fi |
335 | fi |
330 | |
336 | |
331 | [ "$OS" = linux ] && chrpath -d perl # debian perls have an rpath. really. |
337 | [ "$OS" = linux ] && chrpath -d perl $(find pm -name "*.so") # debian perls have an rpath, many modules too |
332 | $STRIP $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl |
338 | $STRIP $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl |
|
|
339 | |
|
|
340 | : >timidity.cfg |
333 | ) |
341 | ) |
334 | |
342 | |
335 | cat >"$DIST".vars <<EOF |
343 | cat >"$DIST".vars <<EOF |
336 | G_URLADER="$URLADER" |
344 | G_URLADER="$URLADER" |
337 | G_OS="$OS" |
345 | G_OS="$OS" |
338 | G_ARCHNAME="$ARCHNAME" |
346 | G_ARCHNAME="$ARCHNAME" |
339 | G_ENVVARS="$GENPACK_ENVVARS" |
347 | G_ENVVARS="$GENPACK_ENVVARS" |
340 | G_ARGS="./perl run" |
348 | G_COMMAND="./perl run" |
341 | EOF |
349 | EOF |
342 | |
350 | |