--- deliantra/Deliantra-Client/util/gatherer 2011/12/30 23:43:25 1.6 +++ deliantra/Deliantra-Client/util/gatherer 2012/01/28 00:03:31 1.15 @@ -1,6 +1,6 @@ #!/bin/bash -# this gem of a hack gathers all fiels required by the client for the platform +# this gem of a hack gathers all files 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. @@ -12,6 +12,7 @@ MAKE=make ARCHNAME=x86 GENPACK_ENVVARS="LD_LIBRARY_PATH=." +EXTRA_EXTRACT= umask 022 @@ -19,7 +20,7 @@ . ~/.setenv OS=windows - URLADER=windowx-x86 + URLADER=windows-x86 unset PANGO PERL=/c/perl/bin/perl MAKE=nmake @@ -28,6 +29,7 @@ LIB0=dll SO=dll STRIP=":" # stripping the perl library kills it, and apparently, everythignis always stripped + EXTRA_EXTRACT="-MWin32::GUI::SplashScreen" # fontconfig apparently ignores env vars and always looks at ./etc/fonts/fonts.conf, # but only if . isn't actually called bin or lib. hope for the best. @@ -61,40 +63,15 @@ ARCHNAME=amd64 fi -export DIST="$(pwd)/dist/$OS-$ARCHNAME" +DISTf="dist/$OS-$ARCHNAME" +export DIST="$(pwd)/$DISTf" -rm -rf "$DIST" -mkdir -p "$DIST" +eval $("$PERL" -V:sitebinexp:) -#PERL=/opt/perl -#PANGO=1.6.0 - -export EV_EVENTFD=0 -export EV_INOTIFY=0 -export EV_SIGNALFD=0 - -if true; then - 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 || 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 +"$PERL" "$sitebinexp"/perl-libextractor \ + --perl --core-support --script deliantra $EXTRA_EXTRACT \ + --runtime-only \ + --copy "$DISTf" --exedir . --dlldir . --bindir pm/bin --libdir pm cat <"$DIST"/pango.rc [Pango] @@ -107,7 +84,7 @@ base=$(basename "$lib") [ "$base" = pango-basic-x.$LIBEXT ] && continue cp -p "$lib" "$DIST"/. - echo "$base $rest" >&5 + echo "./$base $rest" >&5 # using ./ seems to help pango not to rummage around in /usr/lib etc. done ) @@ -121,95 +98,6 @@ cp "$sitebinexp"/deliantra "$DIST"/pm/bin/ cp -p util/run "$DIST" -( - exec ) { - s/\015?\012$//; - next if /^(#|$)/; - s/\.dynob$/.'$SO'/; - - my $found; - for my $lib (@path) { - chdir $lib || next; - - my @glob = File::Glob::bsd_glob $_, 0; # explicit 0 needed - - if (@glob) { - ++$found; - - for (@glob) { - if (-d $_) { - system "rsync", "-aR", $_, "$ENV{DIST}/pm/."; - } else { - File::Path::mkpath "$ENV{OSDIST}/pm/" . dirname $_; - File::Copy::syscopy "$_", "$ENV{OSDIST}/pm/$_" - or die "$ENV{OSDIST}/pm/$_: $!"; - - if (s/\.pm$//) { - $auto = "auto/$_"; - - for my $glob ("*.'$SO'", "autosplit.ix", "*.al") { - for (bsd_glob "$auto/$glob", 0) { - File::Path::mkpath "$ENV{OSDIST}/pm/" . dirname $_; - File::Copy::syscopy "$_", "$ENV{OSDIST}/pm/$_"; - } - } - } - } - } - - last; - } - } - - warn "$_: not found\n" - unless $found; - } - ' -) || exit - ############################################################################# if [ "$OS" = windows ]; then @@ -250,17 +138,22 @@ ( cd "$DIST" - cp -p "$PERL" . - - if [ "$OS" = windows ]; then - cp -p $SYSLIB/libvorbisfile-3.dll $SYSLIB/mikmod.dll $SYSLIB/libpng12-0.dll . - cp /root/src/CFPlus/util/splash.bmp . - chmod -R u+rwX pm/auto + case "$OS" in + windows ) + cp -p $SYSLIB/libvorbisfile-3.dll $SYSLIB/mikmod.dll $SYSLIB/libpng12-0.dll $SYSLIB/jpeg.dll . + cp -p $SYSLIB/jpeg.dll . + cp /root/src/CFPlus/util/splash.bmp . + chmod -R u+rwX pm/auto + + # convert perl to a non-console-app + $PERL -MWin32::Exe -e '$e = new Win32::Exe"perl.exe"; $e->set_subsystem_windows; $e->write' + ;; + linux ) + cp -p $SYSLIB/libjpeg.so.62 . + ;; + esac - # convert perl to a non-console-app - $PERL -MWin32::Exe -e '$e = new Win32::Exe"perl.exe"; $e->set_subsystem_windows; $e->write' - - else + if [ "$OS" != windows ]; then for lib in mikmod vorbisfile; do cp -p $SYSLIB/lib$lib.$LIB0 . chmod 755 lib$lib.$LIB0 @@ -283,8 +176,14 @@ 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" + + if [ "$OS" != darwin ]; then + set libpango-1.0.$LIB0 + perl -pe 's{/u(?=sr/lib(32)?/pango)}{.\x00}g;' <"$1" >"$1~" && mv "$1~" "$1" + else + set lib*pango-1.0.0.dylib + perl -pe 's{/o(?=pt/local/.../pango)}{.\x00}g;' <"$1" >"$1~" && mv "$1~" "$1" + fi chmod 755 "$1" fi @@ -328,8 +227,10 @@ done fi - [ "$OS" = linux ] && chrpath -d perl # debian perls have an rpath. really. + [ "$OS" = linux ] && chrpath -d perl $(find pm -name "*.so") # debian perls have an rpath, many modules too $STRIP $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl + + : >timidity.cfg ) cat >"$DIST".vars <