ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/cf.schmorp.de/Deliantra-Client/makebin.linux
Revision: 1.26
Committed: Fri Jul 29 08:35:35 2011 UTC (12 years, 11 months ago) by root
Branch: MAIN
Changes since 1.25: +1 -1 lines
Log Message:
avoid triggering undefined behaviour

File Contents

# User Rev Content
1 root 1.1 #!/bin/bash
2    
3 root 1.21 # ./configure --disable-joystick --disable-cdrom --disable-alsa-shared --disable-esd-shared --disable-arts --disable-nas --disable-diskaudio --disable-dga --disable-video-fbcon --disable-video-directfb --disable-video-svga --disable-timidity
4    
5 root 1.1 # Convert a gtk2-perl program to a standalone linux binary
6    
7 root 1.17 EV_EVENTFD=
8 root 1.20
9     if [ $(arch) = i686 ]; then
10     PERL=/usr
11     PERLLIB=/usr/lib/perl5/
12     PP=/usr/bin/pp
13     LIBDB=db-4.6
14     ARCHNAME=x86
15     PERLARCH=i486-linux-gnu-thread-multi
16     else
17     PERL=/usr
18     PERLLIB=/usr/lib/perl5/
19     PP=/usr/local/bin/pp
20     LIBDB=db-4.7
21     ARCHNAME=amd64
22     PERLARCH=x86_64-linux-gnu-thread-multi
23     fi
24    
25 root 1.4 PANGO=1.5.0
26 root 1.3 #PERL=/opt/perl
27     #PERLLIB=/opt/perl/lib/perl5/
28 root 1.4 #PANGO=1.6.0
29 root 1.1
30 root 1.23 export EV_EVENTFD=0
31     export EV_INOTIFY=0
32     export EV_SIGNALFD=0
33    
34     for mod in common-sense AnyEvent EV JSON-XS Deliantra Compress-LZF BDB Guard; do
35 root 1.8 (
36     cd /root/src/$mod
37 root 1.13 $PERL/bin/perl Makefile.PL </dev/null
38 root 1.8 make clean
39 root 1.13 $PERL/bin/perl Makefile.PL </dev/null
40     make install || exit
41     make clean
42     )
43 root 1.8 done
44 root 1.5
45 root 1.1 (
46 root 1.19 # # patch braindamaged pango
47 root 1.5 perl -pe 's{/u(?=sr/lib(32)?/pango)}{/\x00}g; s{\Q'$PANGO'\E\x00}{y.t.u\x00}g' </usr/lib/libpango-1.0.so.0 >pango-1.0.so.0
48     printf "%s" "$PANGO" >pangoversion
49 root 1.19 #pangoversion;root/pangoversion
50 root 1.1 cat <<EOF
51 root 1.20 pango-1.0.so.0;shlib/$PERLARCH/libpango-1.0.so.0
52     /usr/lib/libglib-2.0.so.0;shlib/$PERLARCH/libglib-2.0.so.0
53     /usr/lib/libstdc++.so.6;shlib/$PERLARCH/libstdc++.so.6
54     /lib/libgcc_s.so.1;shlib/$PERLARCH/libgcc_s.so.1
55     pango-1.0.so.0;shlib/$PERLARCH/libpango-1.0.so.0
56 root 1.11 docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst
57 root 1.1 EOF
58 root 1.24 #/usr/lib/pango/$PANGO;root/usr/lib/pango/$PANGO
59 root 1.1
60 root 1.19 cat <<EOF >pango.rc
61     [Pango]
62     ModuleFiles = pango.modules
63     EOF
64     echo "pango.rc;root/pango.rc"
65    
66     cat >fonts.conf <<EOF
67     <?xml version="1.0"?>
68     <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
69     <fontconfig>
70    
71     <match target="pattern"> <test qual="any" name="family"> <string>mono</string> </test> <edit name="family" mode="assign"> <string>monospace</string> </edit> </match>
72    
73     <match target="pattern"> <test qual="any" name="family"> <string>sans serif</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match>
74    
75     <match target="pattern"> <test qual="any" name="family"> <string>sans</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match>
76    
77     <cachedir>fontconfig-cache</cachedir>
78    
79     <config>
80     <blank>
81     <int>0x0020</int><int>0x00A0</int><int>0x00AD</int><int>0x034F</int><int>0x0600</int><int>0x0601</int><int>0x0602</int><int>0x0603</int><int>0x06DD</int><int>0x070F</int><int>0x115F</int><int>0x1160</int><int>0x1680</int><int>0x17B4</int><int>0x17B5</int><int>0x180E</int><int>0x2000</int><int>0x2001</int><int>0x2002</int><int>0x2003</int><int>0x2004</int><int>0x2005</int><int>0x2006</int><int>0x2007</int><int>0x2008</int><int>0x2009</int><int>0x200A</int><int>0x200B</int><int>0x200C</int><int>0x200D</int><int>0x200E</int><int>0x200F</int><int>0x2028</int><int>0x2029</int><int>0x202A</int><int>0x202B</int><int>0x202C</int><int>0x202D</int><int>0x202E</int><int>0x202F</int><int>0x205F</int><int>0x2060</int><int>0x2061</int><int>0x2062</int><int>0x2063</int><int>0x206A</int><int>0x206B</int><int>0x206C</int><int>0x206D</int><int>0x206E</int><int>0x206F</int><int>0x2800</int><int>0x3000</int><int>0x3164</int><int>0xFEFF</int><int>0xFFA0</int><int>0xFFF9</int><int>0xFFFA</int><int>0xFFFB</int>
82     </blank>
83     </config>
84    
85     </fontconfig>
86     EOF
87     echo "fonts.conf;root/fonts.conf"
88    
89     (
90     cat /usr/lib/pango/$PANGO/module-files.d/* | grep ^/usr | while read so rest; do
91     base=$(basename "$so")
92 root 1.24 echo "$so;root/$base" # puts them in twice
93 root 1.19 echo "$base $rest" >&5
94     done
95     ) 5>pango.modules
96     echo "pango.modules;root/pango.modules"
97    
98 root 1.11 perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST
99 root 1.1
100     ) >addlist
101    
102 root 1.19 trap "rm addlist pangoversion pango-1.0.so.0 fonts.conf" 0
103 root 1.1
104 root 1.5 $PERL/bin/perl Makefile.PL
105 root 1.13 make clean
106     $PERL/bin/perl Makefile.PL
107     make install || exit
108 root 1.1
109 root 1.5 wait
110    
111 root 1.21 #-l asound -l esd \
112 root 1.1 LD_LIBRARY_PATH=/lib:/usr/lib \
113 root 1.20 $PP -C -I /root/src/Deliantra \
114 root 1.7 -M AnyEvent::Impl::EV \
115 root 1.14 -M attributes \
116 root 1.25 -M utf8 \
117 root 1.11 -a "blib/arch/auto/Deliantra/Client/Client.so;lib/auto/Deliantra/Client/Client.so" \
118 root 1.20 -l $LIBDB \
119 root 1.1 -l glib-2.0 -l gobject-2.0 -l gmodule-2.0 \
120     -l pangoft2-1.0 \
121 root 1.21 -l SDL \
122 root 1.1 -l SDL_mixer -l vorbisfile -l vorbis -l ogg -l smpeg -l stdc++ \
123 root 1.26 -l SDL_image -l png12 -l jpeg -l z \
124 root 1.20 -o deliantra-gnu-linux-$ARCHNAME -A addlist bin/deliantra || exit
125 root 1.1
126 root 1.15 make clean
127    
128 root 1.20 tar cf deliantra-gnu-linux-$ARCHNAME.tar deliantra-gnu-linux-$ARCHNAME
129     gzip -9vf deliantra-gnu-linux-$ARCHNAME.tar
130     todata deliantra-gnu-linux-$ARCHNAME.tar.gz
131 root 1.16