1 | #!/bin/bash |
1 | #!/bin/bash |
|
|
2 | |
|
|
3 | # ./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 |
2 | |
4 | |
3 | # Convert a gtk2-perl program to a standalone linux binary |
5 | # Convert a gtk2-perl program to a standalone linux binary |
4 | |
6 | |
|
|
7 | EV_EVENTFD= |
|
|
8 | |
|
|
9 | if [ $(arch) = i686 ]; then |
5 | PERL=/usr |
10 | PERL=/usr |
6 | PERLLIB=/usr/lib/perl5/ |
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 | |
7 | PANGO=1.5.0 |
25 | PANGO=1.5.0 |
8 | #PERL=/opt/perl |
26 | #PERL=/opt/perl |
9 | #PERLLIB=/opt/perl/lib/perl5/ |
27 | #PERLLIB=/opt/perl/lib/perl5/ |
10 | #PANGO=1.6.0 |
28 | #PANGO=1.6.0 |
11 | |
29 | |
|
|
30 | export EV_EVENTFD=0 |
|
|
31 | export EV_INOTIFY=0 |
|
|
32 | export EV_SIGNALFD=0 |
|
|
33 | |
12 | for mod in AnyEvent EV JSON-XS Deliantra Compress-LZF BDB; do |
34 | for mod in common-sense AnyEvent EV JSON-XS Deliantra Compress-LZF BDB Guard; do |
13 | ( |
35 | ( |
14 | cd /root/src/$mod |
36 | cd /root/src/$mod |
15 | $PERL/bin/perl Makefile.PL </dev/null |
37 | $PERL/bin/perl Makefile.PL </dev/null |
16 | make clean |
38 | make clean |
17 | $PERL/bin/perl Makefile.PL </dev/null |
39 | $PERL/bin/perl Makefile.PL </dev/null |
… | |
… | |
19 | make clean |
41 | make clean |
20 | ) |
42 | ) |
21 | done |
43 | done |
22 | |
44 | |
23 | ( |
45 | ( |
24 | # patch braindamaged pango |
46 | # # patch braindamaged pango |
25 | 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 |
47 | 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 |
26 | printf "%s" "$PANGO" >pangoversion |
48 | printf "%s" "$PANGO" >pangoversion |
|
|
49 | #pangoversion;root/pangoversion |
27 | cat <<EOF |
50 | cat <<EOF |
28 | pangoversion;root/pangoversion |
51 | pango-1.0.so.0;shlib/$PERLARCH/libpango-1.0.so.0 |
29 | pango-1.0.so.0;shlib/i486-linux-gnu-thread-multi/libpango-1.0.so.0 |
52 | /usr/lib/libglib-2.0.so.0;shlib/$PERLARCH/libglib-2.0.so.0 |
30 | /usr/lib/libglib-2.0.so.0;shlib/i486-linux-gnu-thread-multi/libglib-2.0.so.0 |
53 | /usr/lib/libstdc++.so.6;shlib/$PERLARCH/libstdc++.so.6 |
31 | /usr/lib/libstdc++.so.6;shlib/i486-linux-gnu-thread-multi/libstdc++.so.6 |
54 | /lib/libgcc_s.so.1;shlib/$PERLARCH/libgcc_s.so.1 |
32 | /usr/lib/libaudio.so.2;shlib/i486-linux-gnu-thread-multi/libaudio.so.2 |
55 | pango-1.0.so.0;shlib/$PERLARCH/libpango-1.0.so.0 |
33 | /lib/libgcc_s.so.1;shlib/i486-linux-gnu-thread-multi/libgcc_s.so.1 |
|
|
34 | /usr/lib/pango/$PANGO;root/usr/lib/pango/$PANGO |
|
|
35 | docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst |
56 | docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst |
36 | EOF |
57 | EOF |
|
|
58 | #/usr/lib/pango/$PANGO;root/usr/lib/pango/$PANGO |
|
|
59 | |
|
|
60 | 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 | echo "$so;root/$base" # puts them in twice |
|
|
93 | echo "$base $rest" >&5 |
|
|
94 | done |
|
|
95 | ) 5>pango.modules |
|
|
96 | echo "pango.modules;root/pango.modules" |
37 | |
97 | |
38 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
98 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
39 | |
99 | |
40 | ) >addlist |
100 | ) >addlist |
41 | |
101 | |
42 | trap "rm addlist pangoversion pango-1.0.so.0" 0 |
102 | trap "rm addlist pangoversion pango-1.0.so.0 fonts.conf" 0 |
43 | |
103 | |
44 | $PERL/bin/perl Makefile.PL |
104 | $PERL/bin/perl Makefile.PL |
45 | make clean |
105 | make clean |
46 | $PERL/bin/perl Makefile.PL |
106 | $PERL/bin/perl Makefile.PL |
47 | make install || exit |
107 | make install || exit |
48 | |
108 | |
49 | wait |
109 | wait |
50 | |
110 | |
|
|
111 | #-l asound -l esd \ |
51 | LD_LIBRARY_PATH=/lib:/usr/lib \ |
112 | LD_LIBRARY_PATH=/lib:/usr/lib \ |
52 | $PERL/bin/pp -C -I /root/src/Deliantra \ |
113 | $PP -C -I /root/src/Deliantra \ |
53 | -M AnyEvent::Impl::EV \ |
114 | -M AnyEvent::Impl::EV \ |
54 | -M attributes \ |
115 | -M attributes \ |
|
|
116 | -M utf8 \ |
55 | -a "blib/arch/auto/Deliantra/Client/Client.so;lib/auto/Deliantra/Client/Client.so" \ |
117 | -a "blib/arch/auto/Deliantra/Client/Client.so;lib/auto/Deliantra/Client/Client.so" \ |
56 | -l db-4.4 \ |
118 | -l $LIBDB \ |
57 | -l glib-2.0 -l gobject-2.0 -l gmodule-2.0 \ |
119 | -l glib-2.0 -l gobject-2.0 -l gmodule-2.0 \ |
58 | -l pangoft2-1.0 \ |
120 | -l pangoft2-1.0 \ |
59 | -l SDL -l asound \ |
121 | -l SDL \ |
60 | -l SDL_mixer -l vorbisfile -l vorbis -l ogg -l smpeg -l stdc++ \ |
122 | -l SDL_mixer -l vorbisfile -l vorbis -l ogg -l smpeg -l stdc++ \ |
61 | -l SDL_image -l png12 -l z \ |
123 | -l SDL_image -l png12 -l jpeg -l z \ |
62 | -o deliantra-gnu-linux-x86.bin -A addlist bin/deliantra || exit |
124 | -o deliantra-gnu-linux-$ARCHNAME -A addlist bin/deliantra || exit |
63 | |
125 | |
64 | make clean |
126 | make clean |
65 | |
127 | |
66 | todata deliantra-gnu-linux-x86.bin |
128 | 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 | |