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.2 by root, Fri Dec 30 05:44:23 2011 UTC vs.
Revision 1.10 by root, Wed Jan 4 11:41:25 2012 UTC

1#!/bin/bash 1#!/bin/bash
2
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
5# and windows, that is.
2 6
3STRIP="strip" 7STRIP="strip"
4LIBEXT=so 8LIBEXT=so
5LIB0=so.? 9LIB0=so.?
6SO=so 10SO=so
7SYSLIB=/usr/lib 11SYSLIB=/usr/lib
8MAKE=make 12MAKE=make
9ARCHNAME=x86 13ARCHNAME=x86
10GENPACK_ENVVARS= 14GENPACK_ENVVARS="LD_LIBRARY_PATH=."
11 15
12umask 022 16umask 022
13 17
14if [ "$(uname -s)" = CYGWIN_NT-5.0 ]; then 18if [ "$(uname -s)" = CYGWIN_NT-5.0 ]; then
15 . ~/.setenv 19 . ~/.setenv
16 20
17 OS=windows 21 OS=windows
18 URLADER=.exe 22 URLADER=windows-x86
19 unset PANGO 23 unset PANGO
20 PERL=/c/perl/bin/perl 24 PERL=/c/perl/bin/perl
21 MAKE=nmake 25 MAKE=nmake
22 SYSLIB=/c/gtk/bin 26 SYSLIB=/c/gtk/bin
23 LIBEXT=dll 27 LIBEXT=dll
33 /c/gtk/bin/pango-querymodules # empty output usually 37 /c/gtk/bin/pango-querymodules # empty output usually
34 } 38 }
35 39
36elif [ "$(uname -s)" = Darwin ]; then 40elif [ "$(uname -s)" = Darwin ]; then
37 OS=darwin 41 OS=darwin
38 URLADER=-osx105 42 URLADER=darwin-x86
39 PANGO=1.6.0 43 PANGO=1.6.0
40 PERL=/opt/local/bin/perl 44 PERL=/opt/local/bin/perl
45 GENPACK_ENVVARS="DYLD_LIBRARY_PATH=."
41 46
42 SYSLIB=/opt/local/lib 47 SYSLIB=/opt/local/lib
43 LIB0=dylib 48 LIB0=dylib
44 SO=bundle 49 SO=bundle
45 STRIP="strip -x" 50 STRIP="strip -x"
46elif [ $(arch) = i686 ]; then 51elif [ $(arch) = i686 ]; then
47 OS=linux 52 OS=linux
48 URLADER=-x86 53 URLADER=linux-x86
49 PANGO=1.5.0 54 PANGO=1.5.0
50 PERL=/usr/bin/perl 55 PERL=/usr/bin/perl
51else 56else
52 OS=linux 57 OS=linux
53 URLADER=-amd64 58 URLADER=linux-amd64
54 PANGO=1.5.0 59 PANGO=1.5.0
55 PERL=/usr/bin/perl 60 PERL=/usr/bin/perl
56 ARCHNAME=amd64 61 ARCHNAME=amd64
57fi 62fi
58 63
65#PANGO=1.6.0 70#PANGO=1.6.0
66 71
67export EV_EVENTFD=0 72export EV_EVENTFD=0
68export EV_INOTIFY=0 73export EV_INOTIFY=0
69export EV_SIGNALFD=0 74export EV_SIGNALFD=0
70
71if false; then
72# for mod in common-sense AnyEvent EV JSON-XS Deliantra Compress-LZF BDB Guard CFPlus; do
73 for mod in CFPlus; do
74 (
75 cd /root/src/$mod
76 $PERL Makefile.PL </dev/null
77 $MAKE clean
78 $PERL Makefile.PL </dev/null
79 $MAKE install || exit
80 $MAKE clean
81 )
82 done
83fi
84 75
85cat <<EOF >"$DIST"/pango.rc 76cat <<EOF >"$DIST"/pango.rc
86[Pango] 77[Pango]
87ModuleFiles = pango.modules 78ModuleFiles = pango.modules
88EOF 79EOF
91 exec 5>"$DIST"/pango.modules 82 exec 5>"$DIST"/pango.modules
92 pango-querymodules | grep ^/ | while read lib rest; do 83 pango-querymodules | grep ^/ | while read lib rest; do
93 base=$(basename "$lib") 84 base=$(basename "$lib")
94 [ "$base" = pango-basic-x.$LIBEXT ] && continue 85 [ "$base" = pango-basic-x.$LIBEXT ] && continue
95 cp -p "$lib" "$DIST"/. 86 cp -p "$lib" "$DIST"/.
96 echo "$base $rest" >&5 87 echo "./$base $rest" >&5 # using ./ seems to help pango not to rummage around in /usr/lib etc.
97 done 88 done
98) 89)
99 90
100############################################################################# 91#############################################################################
101 92
245 236
246 # convert perl to a non-console-app 237 # convert perl to a non-console-app
247 $PERL -MWin32::Exe -e '$e = new Win32::Exe"perl.exe"; $e->set_subsystem_windows; $e->write' 238 $PERL -MWin32::Exe -e '$e = new Win32::Exe"perl.exe"; $e->set_subsystem_windows; $e->write'
248 239
249 else 240 else
250 # patch braindamaged pango
251 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
252 chmod 755 libpango-1.0.$LIB0
253
254 for lib in mikmod vorbisfile; do 241 for lib in mikmod vorbisfile; do
255 cp -p $SYSLIB/lib$lib.$LIB0 . 242 cp -p $SYSLIB/lib$lib.$LIB0 .
256 chmod 755 lib$lib.$LIB0 243 chmod 755 lib$lib.$LIB0
257 done 244 done
258 fi 245 fi
266 for lib in \ 253 for lib in \
267 dl c m rt pthread nsl crypt \ 254 dl c m rt pthread nsl crypt \
268 X11 Xext Xau Xdmcp ICE SM Xrandr Xrender Xxf86vm drm GL \ 255 X11 Xext Xau Xdmcp ICE SM Xrandr Xrender Xxf86vm drm GL \
269 z 256 z
270 do 257 do
271 rm -f lib"$lib".$SO0 258 rm -f lib"$lib".$LIB0
272 done 259 done
260
261 if [ "$OS" != windows ]; then
262 # patch braindamaged pango
263
264 if [ "$OS" != darwin ]; then
265 set libpango-1.0.$LIB0
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
271 chmod 755 "$1"
272 fi
273 273
274 if [ "$OS" = darwin ]; then 274 if [ "$OS" = darwin ]; then
275 # "dll hell" is most severe on os x, because apple 275 # "dll hell" is most severe on os x, because apple
276 # does not generally give a shit for backwards compatibility, 276 # does not generally give a shit for backwards compatibility,
277 # alwayss ships outdated libraries and often provides libraries 277 # alwayss ships outdated libraries and often provides libraries
309 patchlibs "$lib" 309 patchlibs "$lib"
310 mv "$lib" "libdeliantra-$stem.dylib" 310 mv "$lib" "libdeliantra-$stem.dylib"
311 done 311 done
312 fi 312 fi
313 313
314 [ "$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
315 $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
316) 318)
317 319
318printf -- urlader$URLADER >"$DIST".urlader 320cat >"$DIST".vars <<EOF
321G_URLADER="$URLADER"
322G_OS="$OS"
323G_ARCHNAME="$ARCHNAME"
324G_ENVVARS="$GENPACK_ENVVARS"
325G_COMMAND="./perl run"
326EOF
319 327
320echo >"$DIST".genpack genpack deliantra_S-$OS-"$ARCHNAME" '"$EXE_VER"' '"$1"' $GENPACK_ENVVARS ./perl run
321
322exit
323
324
325tar cf deliantra-gnu-linux-$ARCHNAME.tar deliantra-gnu-linux-$ARCHNAME
326gzip -9vf deliantra-gnu-linux-$ARCHNAME.tar
327todata deliantra-gnu-linux-$ARCHNAME.tar.gz
328

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines