ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/util/gatherer
(Generate patch)

Comparing deliantra/Deliantra-Client/util/gatherer (file contents):
Revision 1.4 by root, Fri Dec 30 06:52:07 2011 UTC vs.
Revision 1.8 by root, Wed Jan 4 09:16:40 2012 UTC

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
7STRIP="strip" 7STRIP="strip"
8LIBEXT=so 8LIBEXT=so
17 17
18if [ "$(uname -s)" = CYGWIN_NT-5.0 ]; then 18if [ "$(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
40elif [ "$(uname -s)" = Darwin ]; then 40elif [ "$(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"
51elif [ $(arch) = i686 ]; then 51elif [ $(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
56else 56else
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
62fi 62fi
63 63
72export EV_EVENTFD=0 72export EV_EVENTFD=0
73export EV_INOTIFY=0 73export EV_INOTIFY=0
74export EV_SIGNALFD=0 74export EV_SIGNALFD=0
75 75
76if true; then 76if 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 81 cd /root/src/$mod || exit
82 cvs update -AdP 82 cvs update -AdP
83 rm -rf blib
83 $PERL Makefile.PL </dev/null >/dev/null 84 $PERL Makefile.PL </dev/null >/dev/null
84 $MAKE clean >/dev/null 85 $MAKE clean >/dev/null
85 $PERL Makefile.PL </dev/null >/dev/null 86 $PERL Makefile.PL </dev/null >/dev/null
86 if ! $MAKE install >log 2>&1; then 87 if ! $MAKE install >log 2>&1; then
88 echo
89 echo error while building $mod
87 cat log 90 cat log
88 exit 91 exit
89 fi 92 fi
90 rm -f log 93 rm -f log
91 $MAKE clean >/dev/null 94 $MAKE clean >/dev/null
102 exec 5>"$DIST"/pango.modules 105 exec 5>"$DIST"/pango.modules
103 pango-querymodules | grep ^/ | while read lib rest; do 106 pango-querymodules | grep ^/ | while read lib rest; do
104 base=$(basename "$lib") 107 base=$(basename "$lib")
105 [ "$base" = pango-basic-x.$LIBEXT ] && continue 108 [ "$base" = pango-basic-x.$LIBEXT ] && continue
106 cp -p "$lib" "$DIST"/. 109 cp -p "$lib" "$DIST"/.
107 echo "$base $rest" >&5 110 echo "./$base $rest" >&5 # using ./ seems to help pango not to rummage around in /usr/lib etc.
108 done 111 done
109) 112)
110 113
111############################################################################# 114#############################################################################
112 115
256 259
257 # convert perl to a non-console-app 260 # convert perl to a non-console-app
258 $PERL -MWin32::Exe -e '$e = new Win32::Exe"perl.exe"; $e->set_subsystem_windows; $e->write' 261 $PERL -MWin32::Exe -e '$e = new Win32::Exe"perl.exe"; $e->set_subsystem_windows; $e->write'
259 262
260 else 263 else
261 # patch braindamaged pango
262 perl -pe 's{/u(?=sr/lib(32)?/pango)}{/\x00}g; s{\Q'$PANGO'\E\x00}{y.t.u\x00}g' <$SYSLIB/libpango-1.0.$LIB0 >libpango-1.0.$LIB0
263 chmod 755 libpango-1.0.$LIB0
264
265 for lib in mikmod vorbisfile; do 264 for lib in mikmod vorbisfile; do
266 cp -p $SYSLIB/lib$lib.$LIB0 . 265 cp -p $SYSLIB/lib$lib.$LIB0 .
267 chmod 755 lib$lib.$LIB0 266 chmod 755 lib$lib.$LIB0
268 done 267 done
269 fi 268 fi
277 for lib in \ 276 for lib in \
278 dl c m rt pthread nsl crypt \ 277 dl c m rt pthread nsl crypt \
279 X11 Xext Xau Xdmcp ICE SM Xrandr Xrender Xxf86vm drm GL \ 278 X11 Xext Xau Xdmcp ICE SM Xrandr Xrender Xxf86vm drm GL \
280 z 279 z
281 do 280 do
282 rm -f lib"$lib".$SO0 281 rm -f lib"$lib".$LIB0
283 done 282 done
283
284 if [ "$OS" != windows ]; then
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
291 set libpango-1.0.$LIB0
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
294 chmod 755 "$1"
295 fi
284 296
285 if [ "$OS" = darwin ]; then 297 if [ "$OS" = darwin ]; then
286 # "dll hell" is most severe on os x, because apple 298 # "dll hell" is most severe on os x, because apple
287 # does not generally give a shit for backwards compatibility, 299 # does not generally give a shit for backwards compatibility,
288 # alwayss ships outdated libraries and often provides libraries 300 # alwayss ships outdated libraries and often provides libraries
320 patchlibs "$lib" 332 patchlibs "$lib"
321 mv "$lib" "libdeliantra-$stem.dylib" 333 mv "$lib" "libdeliantra-$stem.dylib"
322 done 334 done
323 fi 335 fi
324 336
325 [ "$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
326 $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
327) 341)
328 342
329printf -- urlader$URLADER >"$DIST".urlader 343cat >"$DIST".vars <<EOF
344G_URLADER="$URLADER"
345G_OS="$OS"
346G_ARCHNAME="$ARCHNAME"
347G_ENVVARS="$GENPACK_ENVVARS"
348G_COMMAND="./perl run"
349EOF
330 350
331echo >"$DIST".genpack genpack deliantra_S-$OS-"$ARCHNAME" '"$EXE_VER"' '"$1"' $GENPACK_ENVVARS ./perl run
332
333exit
334
335
336tar cf deliantra-gnu-linux-$ARCHNAME.tar deliantra-gnu-linux-$ARCHNAME
337gzip -9vf deliantra-gnu-linux-$ARCHNAME.tar
338todata deliantra-gnu-linux-$ARCHNAME.tar.gz
339

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines