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.1 by root, Fri Dec 30 04:17:19 2011 UTC vs.
Revision 1.5 by root, Fri Dec 30 10:59:00 2011 UTC

1#!/bin/bash 1#!/bin/bash
2
3# this gem of a hack gathers all fiels 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
36elif [ "$(uname -s)" = Darwin ]; then 40elif [ "$(uname -s)" = Darwin ]; then
37 OS=darwin 41 OS=darwin
38 URLADER=-osx105 42 URLADER=-osx105
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"
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 75
71if false; then 76if true; then
77 for mod in deliantra/Deliantra deliantra/Deliantra-Client; do
72# for mod in common-sense AnyEvent EV JSON-XS Deliantra Compress-LZF BDB Guard CFPlus; do 78# for mod in common-sense AnyEvent EV JSON-XS deliantra/Deliantra Compress-LZF BDB Guard deliantra/Deliantra-Client; do
73 for mod in CFPlus; do 79# for mod in CFPlus; do
74 ( 80 (
75 cd /root/src/$mod 81 cd /root/src/$mod || exit
82 cvs update -AdP
83 rm -rf blib
84 set -x
76 $PERL Makefile.PL </dev/null 85 $PERL Makefile.PL </dev/null >/dev/null
77 $MAKE clean 86 $MAKE clean >/dev/null
78 $PERL Makefile.PL </dev/null 87 $PERL Makefile.PL </dev/null >/dev/null
79 $MAKE install || exit 88 if ! $MAKE install >log 2>&1; then
89 echo
90 echo error while building $mod
91 cat log
92 exit
93 fi
94 rm -f log
80 $MAKE clean 95 $MAKE clean >/dev/null
81 ) 96 ) || exit
82 done 97 done
83fi 98fi
84 99
85cat <<EOF >"$DIST"/pango.rc 100cat <<EOF >"$DIST"/pango.rc
86[Pango] 101[Pango]
167 182
168 for (@glob) { 183 for (@glob) {
169 if (-d $_) { 184 if (-d $_) {
170 system "rsync", "-aR", $_, "$ENV{DIST}/pm/."; 185 system "rsync", "-aR", $_, "$ENV{DIST}/pm/.";
171 } else { 186 } else {
172 File::Path::make_path "$ENV{OSDIST}/pm/" . dirname $_; 187 File::Path::mkpath "$ENV{OSDIST}/pm/" . dirname $_;
173 File::Copy::syscopy "$_", "$ENV{OSDIST}/pm/$_" 188 File::Copy::syscopy "$_", "$ENV{OSDIST}/pm/$_"
174 or die "$ENV{OSDIST}/pm/$_: $!"; 189 or die "$ENV{OSDIST}/pm/$_: $!";
175 190
176 if (s/\.pm$//) { 191 if (s/\.pm$//) {
177 $auto = "auto/$_"; 192 $auto = "auto/$_";
178 193
179 for my $glob ("*.'$SO'", "autosplit.ix", "*.al") { 194 for my $glob ("*.'$SO'", "autosplit.ix", "*.al") {
180 for (bsd_glob "$auto/$glob", 0) { 195 for (bsd_glob "$auto/$glob", 0) {
181 File::Path::make_path "$ENV{OSDIST}/pm/" . dirname $_; 196 File::Path::mkpath "$ENV{OSDIST}/pm/" . dirname $_;
182 File::Copy::syscopy "$_", "$ENV{OSDIST}/pm/$_"; 197 File::Copy::syscopy "$_", "$ENV{OSDIST}/pm/$_";
183 } 198 }
184 } 199 }
185 } 200 }
186 } 201 }
234} 249}
235 250
236( 251(
237 cd "$DIST" 252 cd "$DIST"
238 253
239 # # patch braindamaged pango 254 cp -p "$PERL" .
240 if [ "$OS" != windows ]; then
241 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
242 chmod 755 libpango-1.0.$LIB0
243 fi
244 255
245 if [ "$OS" = windows ]; then 256 if [ "$OS" = windows ]; then
246 cp -p $SYSLIB/libvorbisfile-3.dll $SYSLIB/mikmod.dll $SYSLIB/libpng12-0.dll . 257 cp -p $SYSLIB/libvorbisfile-3.dll $SYSLIB/mikmod.dll $SYSLIB/libpng12-0.dll .
247 cp /root/src/CFPlus/util/splash.bmp . 258 cp /root/src/CFPlus/util/splash.bmp .
248 chmod -R u+rwX pm/auto 259 chmod -R u+rwX pm/auto
260
261 # convert perl to a non-console-app
262 $PERL -MWin32::Exe -e '$e = new Win32::Exe"perl.exe"; $e->set_subsystem_windows; $e->write'
263
249 else 264 else
250 for lib in mikmod vorbisfile; do 265 for lib in mikmod vorbisfile; do
251 cp -p $SYSLIB/lib$lib.$LIB0 . 266 cp -p $SYSLIB/lib$lib.$LIB0 .
252 chmod 755 lib$lib.$LIB0 267 chmod 755 lib$lib.$LIB0
253 done 268 done
254 fi 269 fi
255 270
256 cp -p "$PERL" .
257
258 for so in $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl; do 271 for so in $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl; do
259 add_deps "$so" 272 add_deps "$so"
260 done 273 done
261 274
262 rm -f pm/auto/POSIX/*.al 275 rm -f pm/auto/POSIX/*.al
264 for lib in \ 277 for lib in \
265 dl c m rt pthread nsl crypt \ 278 dl c m rt pthread nsl crypt \
266 X11 Xext Xau Xdmcp ICE SM Xrandr Xrender Xxf86vm drm GL \ 279 X11 Xext Xau Xdmcp ICE SM Xrandr Xrender Xxf86vm drm GL \
267 z 280 z
268 do 281 do
269 rm -f lib"$lib".$SO0 282 rm -f lib"$lib".$LIB0
270 done 283 done
284
285 if [ "$OS" != windows ]; then
286 # patch braindamaged pango
287 set libpango-1.0.$LIB0
288 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"
289 chmod 755 "$1"
290 fi
271 291
272 if [ "$OS" = darwin ]; then 292 if [ "$OS" = darwin ]; then
273 # "dll hell" is most severe on os x, because apple 293 # "dll hell" is most severe on os x, because apple
274 # does not generally give a shit for backwards compatibility, 294 # does not generally give a shit for backwards compatibility,
275 # alwayss ships outdated libraries and often provides libraries 295 # alwayss ships outdated libraries and often provides libraries
313 $STRIP $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl 333 $STRIP $(find . -name "*.$SO" -o -name "*.$LIBEXT" -o -name "*.$LIB0") perl
314) 334)
315 335
316printf -- urlader$URLADER >"$DIST".urlader 336printf -- urlader$URLADER >"$DIST".urlader
317 337
318echo >"$DIST".genpack genpack deliantra_S-$OS-"$ARCHNAME" '"$EXE_VER"' '"$1"' $GENPACK_ENVVARS./perl run 338echo >"$DIST".genpack genpack deliantra_S-$OS-"$ARCHNAME" '"$EXE_VER"' '"$1"' $GENPACK_ENVVARS ./perl run
319 339
320exit 340exit
321 341
322 342
323tar cf deliantra-gnu-linux-$ARCHNAME.tar deliantra-gnu-linux-$ARCHNAME 343tar cf deliantra-gnu-linux-$ARCHNAME.tar deliantra-gnu-linux-$ARCHNAME

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines