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