1 | #!/bin/bash |
1 | #!/bin/bash |
2 | |
2 | |
3 | # Convert a gtk2-perl program to a standalone linux binary |
3 | # Convert a gtk2-perl program to a standalone linux binary |
4 | |
4 | |
|
|
5 | EV_EVENTFD= |
|
|
6 | |
|
|
7 | if [ $(arch) = i686 ]; then |
5 | PERL=/usr |
8 | PERL=/usr |
6 | PERLLIB=/usr/lib/perl5/ |
9 | PERLLIB=/usr/lib/perl5/ |
|
|
10 | PP=/usr/bin/pp |
|
|
11 | LIBDB=db-4.6 |
|
|
12 | ARCHNAME=x86 |
|
|
13 | PERLARCH=i486-linux-gnu-thread-multi |
|
|
14 | else |
|
|
15 | PERL=/usr |
|
|
16 | PERLLIB=/usr/lib/perl5/ |
|
|
17 | PP=/usr/local/bin/pp |
|
|
18 | LIBDB=db-4.7 |
|
|
19 | ARCHNAME=amd64 |
|
|
20 | PERLARCH=x86_64-linux-gnu-thread-multi |
|
|
21 | fi |
|
|
22 | |
|
|
23 | PANGO=1.5.0 |
|
|
24 | #PERL=/opt/perl |
|
|
25 | #PERLLIB=/opt/perl/lib/perl5/ |
|
|
26 | #PANGO=1.6.0 |
|
|
27 | |
|
|
28 | for mod in AnyEvent EV JSON-XS Deliantra Compress-LZF BDB; do |
|
|
29 | ( |
|
|
30 | cd /root/src/$mod |
|
|
31 | $PERL/bin/perl Makefile.PL </dev/null |
|
|
32 | make clean |
|
|
33 | $PERL/bin/perl Makefile.PL </dev/null |
|
|
34 | make install || exit |
|
|
35 | make clean |
|
|
36 | ) |
|
|
37 | done |
7 | |
38 | |
8 | ( |
39 | ( |
9 | # patch braindamaged pango |
40 | # # patch braindamaged pango |
10 | perl -pe 's{/u(?=sr/lib(32)?/pango)}{/\x00}g; s{1\.5\.0\x00}{\x00.5.0\x00}g' </usr/lib/libpango-1.0.so.0 >pango-1.0.so.0 |
41 | 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 |
|
|
42 | printf "%s" "$PANGO" >pangoversion |
|
|
43 | #pangoversion;root/pangoversion |
11 | cat <<EOF |
44 | cat <<EOF |
12 | pango-1.0.so.0;shlib/i486-linux-gnu-thread-multi/libpango-1.0.so.0 |
45 | pango-1.0.so.0;shlib/$PERLARCH/libpango-1.0.so.0 |
13 | /usr/lib/libglib-2.0.so.0;shlib/i486-linux-gnu-thread-multi/libglib-2.0.so.0 |
46 | /usr/lib/libglib-2.0.so.0;shlib/$PERLARCH/libglib-2.0.so.0 |
14 | /usr/lib/libstdc++.so.6;shlib/i486-linux-gnu-thread-multi/libstdc++.so.6 |
47 | /usr/lib/libstdc++.so.6;shlib/$PERLARCH/libstdc++.so.6 |
15 | /usr/lib/libaudio.so.2;shlib/i486-linux-gnu-thread-multi/libaudio.so.2 |
48 | /usr/lib/libaudio.so.2;shlib/$PERLARCH/libaudio.so.2 |
16 | /lib/libgcc_s.so.1;shlib/i486-linux-gnu-thread-multi/libgcc_s.so.1 |
49 | /lib/libgcc_s.so.1;shlib/$PERLARCH/libgcc_s.so.1 |
17 | /usr/lib/pango/1.5.0;root/usr/lib/pango/1.5.0 |
50 | /usr/lib/pango/$PANGO;root/usr/lib/pango/$PANGO |
|
|
51 | pango-1.0.so.0;shlib/$PERLARCH/libpango-1.0.so.0 |
18 | docwiki.pst;root/CFPlus/resources/docwiki.pst |
52 | docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst |
19 | EOF |
53 | EOF |
20 | |
54 | |
|
|
55 | cat <<EOF >pango.rc |
|
|
56 | [Pango] |
|
|
57 | ModuleFiles = pango.modules |
|
|
58 | EOF |
|
|
59 | echo "pango.rc;root/pango.rc" |
|
|
60 | |
|
|
61 | cat >fonts.conf <<EOF |
|
|
62 | <?xml version="1.0"?> |
|
|
63 | <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> |
|
|
64 | <fontconfig> |
|
|
65 | |
|
|
66 | <match target="pattern"> <test qual="any" name="family"> <string>mono</string> </test> <edit name="family" mode="assign"> <string>monospace</string> </edit> </match> |
|
|
67 | |
|
|
68 | <match target="pattern"> <test qual="any" name="family"> <string>sans serif</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match> |
|
|
69 | |
|
|
70 | <match target="pattern"> <test qual="any" name="family"> <string>sans</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match> |
|
|
71 | |
|
|
72 | <cachedir>fontconfig-cache</cachedir> |
|
|
73 | |
|
|
74 | <config> |
|
|
75 | <blank> |
|
|
76 | <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> |
|
|
77 | </blank> |
|
|
78 | </config> |
|
|
79 | |
|
|
80 | </fontconfig> |
|
|
81 | EOF |
|
|
82 | echo "fonts.conf;root/fonts.conf" |
|
|
83 | |
|
|
84 | ( |
|
|
85 | cat /usr/lib/pango/$PANGO/module-files.d/* | grep ^/usr | while read so rest; do |
|
|
86 | base=$(basename "$so") |
|
|
87 | echo "$so;root/$base" |
|
|
88 | echo "$base $rest" >&5 |
|
|
89 | done |
|
|
90 | ) 5>pango.modules |
|
|
91 | echo "pango.modules;root/pango.modules" |
|
|
92 | |
21 | perl -ne '/^(resources\/.*)/ and print "$1;root/CFPlus/$1\n"' <MANIFEST |
93 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
22 | |
94 | |
23 | ) >addlist |
95 | ) >addlist |
24 | |
96 | |
25 | trap "rm addlist; rm pango-1.0.so.0" 0 |
97 | trap "rm addlist pangoversion pango-1.0.so.0 fonts.conf" 0 |
26 | |
98 | |
27 | perl Makefile.PL |
99 | $PERL/bin/perl Makefile.PL |
|
|
100 | make clean |
|
|
101 | $PERL/bin/perl Makefile.PL |
28 | make install |
102 | make install || exit |
|
|
103 | |
|
|
104 | wait |
29 | |
105 | |
30 | LD_LIBRARY_PATH=/lib:/usr/lib \ |
106 | LD_LIBRARY_PATH=/lib:/usr/lib \ |
31 | $PERL/bin/pp -C -I /root/src/Crossfire \ |
107 | $PP -C -I /root/src/Deliantra \ |
32 | -M Event::idle -M Event::io -M Event::timer -M Event::signal -M Event::var \ |
|
|
33 | -M AnyEvent::Impl::Event \ |
108 | -M AnyEvent::Impl::EV \ |
34 | -l db-4.4 \ |
109 | -M attributes \ |
|
|
110 | -a "blib/arch/auto/Deliantra/Client/Client.so;lib/auto/Deliantra/Client/Client.so" \ |
|
|
111 | -l $LIBDB \ |
35 | -l glib-2.0 -l gobject-2.0 -l gmodule-2.0 \ |
112 | -l glib-2.0 -l gobject-2.0 -l gmodule-2.0 \ |
36 | -l pangoft2-1.0 \ |
113 | -l pangoft2-1.0 \ |
37 | -l SDL -l asound -l cucul -l caca -l ncursesw \ |
114 | -l SDL -l asound \ |
38 | -l SDL_mixer -l vorbisfile -l vorbis -l ogg -l smpeg -l stdc++ \ |
115 | -l SDL_mixer -l vorbisfile -l vorbis -l ogg -l smpeg -l stdc++ \ |
39 | -l SDL_image -l png12 -l z \ |
116 | -l SDL_image -l png12 -l z \ |
40 | -o cfplus-gnu-linux-x86.bin -A addlist bin/cfplus |
117 | -o deliantra-gnu-linux-$ARCHNAME -A addlist bin/deliantra || exit |
41 | |
118 | |
|
|
119 | make clean |
|
|
120 | |
|
|
121 | tar cf deliantra-gnu-linux-$ARCHNAME.tar deliantra-gnu-linux-$ARCHNAME |
|
|
122 | gzip -9vf deliantra-gnu-linux-$ARCHNAME.tar |
|
|
123 | todata deliantra-gnu-linux-$ARCHNAME.tar.gz |
|
|
124 | |