--- deliantra/Deliantra-Client/util/gatherer 2011/12/30 06:31:41 1.3 +++ deliantra/Deliantra-Client/util/gatherer 2011/12/30 23:43:25 1.6 @@ -1,5 +1,9 @@ #!/bin/bash +# this gem of a hack gathers all fiels required by the client for the platform +# by deep magic, it works on osx, linux and windows. on MY osx, linux +# and windows, that is. + STRIP="strip" LIBEXT=so LIB0=so.? @@ -7,7 +11,7 @@ SYSLIB=/usr/lib MAKE=make ARCHNAME=x86 -GENPACK_ENVVARS= +GENPACK_ENVVARS="LD_LIBRARY_PATH=." umask 022 @@ -15,7 +19,7 @@ . ~/.setenv OS=windows - URLADER=.exe + URLADER=windowx-x86 unset PANGO PERL=/c/perl/bin/perl MAKE=nmake @@ -35,9 +39,10 @@ elif [ "$(uname -s)" = Darwin ]; then OS=darwin - URLADER=-osx105 + URLADER=darwin-x86 PANGO=1.6.0 PERL=/opt/local/bin/perl + GENPACK_ENVVARS="DYLD_LIBRARY_PATH=." SYSLIB=/opt/local/lib LIB0=dylib @@ -45,12 +50,12 @@ STRIP="strip -x" elif [ $(arch) = i686 ]; then OS=linux - URLADER=-x86 + URLADER=linux-x86 PANGO=1.5.0 PERL=/usr/bin/perl else OS=linux - URLADER=-amd64 + URLADER=linux-amd64 PANGO=1.5.0 PERL=/usr/bin/perl ARCHNAME=amd64 @@ -69,22 +74,25 @@ export EV_SIGNALFD=0 if true; then - for mod in Deliantra CFPlus; do -# for mod in common-sense AnyEvent EV JSON-XS Deliantra Compress-LZF BDB Guard CFPlus; do + for mod in deliantra/Deliantra deliantra/Deliantra-Client; do +# for mod in common-sense AnyEvent EV JSON-XS deliantra/Deliantra Compress-LZF BDB Guard deliantra/Deliantra-Client; do # for mod in CFPlus; do ( - cd /root/src/$mod - cvs update -qAdP + cd /root/src/$mod || exit + cvs update -AdP + rm -rf blib $PERL Makefile.PL /dev/null $MAKE clean >/dev/null $PERL Makefile.PL /dev/null if ! $MAKE install >log 2>&1; then + echo + echo error while building $mod cat log exit fi rm -f log $MAKE clean >/dev/null - ) + ) || exit done fi @@ -253,10 +261,6 @@ $PERL -MWin32::Exe -e '$e = new Win32::Exe"perl.exe"; $e->set_subsystem_windows; $e->write' else - # patch braindamaged pango - 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 - chmod 755 libpango-1.0.$LIB0 - for lib in mikmod vorbisfile; do cp -p $SYSLIB/lib$lib.$LIB0 . chmod 755 lib$lib.$LIB0 @@ -274,9 +278,16 @@ X11 Xext Xau Xdmcp ICE SM Xrandr Xrender Xxf86vm drm GL \ z do - rm -f lib"$lib".$SO0 + rm -f lib"$lib".$LIB0 done + if [ "$OS" != windows ]; then + # patch braindamaged pango + set libpango-1.0.$LIB0 + 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" + chmod 755 "$1" + fi + if [ "$OS" = darwin ]; then # "dll hell" is most severe on os x, because apple # does not generally give a shit for backwards compatibility, @@ -321,14 +332,11 @@ $STRIP $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl ) -printf -- urlader$URLADER >"$DIST".urlader - -echo >"$DIST".genpack genpack deliantra_S-$OS-"$ARCHNAME" '"$EXE_VER"' '"$1"' $GENPACK_ENVVARS ./perl run - -exit - - -tar cf deliantra-gnu-linux-$ARCHNAME.tar deliantra-gnu-linux-$ARCHNAME -gzip -9vf deliantra-gnu-linux-$ARCHNAME.tar -todata deliantra-gnu-linux-$ARCHNAME.tar.gz +cat >"$DIST".vars <