1 | #!/bin/bash |
1 | #!/opt/local/bin/bash |
2 | |
2 | |
3 | # Convert a gtk2-perl program to a standalone OS X binary |
3 | # Convert a gtk2-perl program to a standalone OS X binary |
4 | |
4 | |
|
|
5 | # port install libsdl +no_x11 libsdl_mixer libsdl_image libvorbis libpng jpeg pango db46 libogg p5-libwww-perl p5-yaml db52 |
|
|
6 | # port install bash wget |
5 | # need to patch libSDL_image from /opt/local/lib/libjpeg.dylib to ./libjpeg.62.dylib |
7 | # need to patch libSDL_image from /opt/local/lib/libjpeg.dylib to ./libjpeg.8.dylib |
|
|
8 | # ln -s db46/db.h /opt/local/include |
|
|
9 | # ln -s db46/libdb.dylib /opt/local/lib |
|
|
10 | # /opt/local/bin/cpan Pod::POM |
6 | |
11 | |
7 | #export MACOSX_DEPLOYMENT_TARGET=10.3 # maybe it helps |
12 | #export MACOSX_DEPLOYMENT_TARGET=10.3 # maybe it helps |
8 | export MACOSX_DEPLOYMENT_TARGET=10.5 # nope |
13 | #export MACOSX_DEPLOYMENT_TARGET=10.5 # nope |
9 | |
14 | |
|
|
15 | cvs update |
|
|
16 | |
10 | PERL=/opt/local |
17 | PREFIX=/opt/local |
11 | PERLLIB=/usr/lib/perl5 |
18 | PERL=$PREFIX |
|
|
19 | DB1=4 |
|
|
20 | DB2=6 |
|
|
21 | |
|
|
22 | ln -sf $PREFIX/include/db$DB1$DB2/db.h $PREFIX/include/db.h |
|
|
23 | rm -f $PREFIX/lib/libdb-$DB1.$DB2.dylib |
|
|
24 | cp -p $PREFIX/lib/db$DB1$DB2/libdb-$DB1.$DB2.dylib $PREFIX/lib/libdb-$DB1.$DB2.dylib |
|
|
25 | |
|
|
26 | eval $(perl -V:sitelib) |
|
|
27 | PERLLIB=$sitelib |
|
|
28 | |
|
|
29 | OPTLIBS=( |
|
|
30 | db-4.6 |
|
|
31 | glib-2.0.0 gobject-2.0.0 gmodule-2.0.0 |
|
|
32 | pango-1.0.0 pangoft2-1.0.0 |
|
|
33 | SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0 |
|
|
34 | vorbisfile vorbis.0 ogg.0 |
|
|
35 | png14.14 jpeg.8 tiff.3 z.1 |
|
|
36 | fontconfig.1 expat.1 freetype.6 intl.8 iconv.2 |
|
|
37 | ) |
|
|
38 | |
|
|
39 | declare -A deliantrified |
|
|
40 | |
|
|
41 | deliantrify_lib() { |
|
|
42 | local lib="$1" |
|
|
43 | |
|
|
44 | [ "${deliantrified["$lib"]}" ] && exit 0 |
|
|
45 | deliantrified["$lib"]=+ |
|
|
46 | |
|
|
47 | ( |
|
|
48 | cd $PREFIX/lib || exit 69 |
|
|
49 | echo "deliantrifying $lib" |
|
|
50 | cp -p lib$lib.dylib libdeliantra-$lib.dylib || exit 68 |
|
|
51 | install_name_tool -id libdeliantra-$lib.dylib libdeliantra-$lib.dylib |
|
|
52 | for lib2 in $(otool -L libdeliantra-$lib.dylib | perl -ne 'print "$1\n" if m%'"$PREFIX/lib/lib"'(\S+).dylib%'); do |
|
|
53 | deliantrify_lib "$lib2" |
|
|
54 | install_name_tool -change lib$lib2.dylib libdeliantra-$lib2.dylib libdeliantra-$lib.dylib |
|
|
55 | done |
|
|
56 | ) || exit |
|
|
57 | } |
|
|
58 | |
|
|
59 | # don't ask... |
|
|
60 | #for lib in "${OPTLIBS[@]}"; do |
|
|
61 | # deliantrify_lib "$lib" |
|
|
62 | #done |
12 | |
63 | |
13 | umask 022 |
64 | umask 022 |
14 | |
65 | |
15 | if true; then |
66 | if true; then |
16 | for mod in AnyEvent EV JSON-XS deliantra/Deliantra Compress-LZF BDB; do |
67 | for mod in common-sense AnyEvent EV JSON-XS Compress-LZF BDB Guard deliantra/Deliantra; do |
17 | ( |
68 | ( |
|
|
69 | mkdir -p /root/src/$mod || exit 77 |
18 | cd /root/src/$mod |
70 | cd /root/src/$mod |
19 | set -x |
71 | set -x |
20 | pwd |
72 | pwd |
21 | rsync -avPessh 10.0.0.1:src/$mod/. . --del |
73 | rsync -avPessh 10.0.0.1:src/$mod/. . --del --exclude "*.tar.gz" --delete-excluded |
22 | $PERL/bin/perl Makefile.PL </dev/null |
74 | $PERL/bin/perl Makefile.PL </dev/null |
23 | make clean |
75 | make clean |
24 | $PERL/bin/perl Makefile.PL </dev/null |
76 | $PERL/bin/perl Makefile.PL </dev/null |
25 | make install || exit |
77 | make install || exit |
26 | make clean |
78 | make clean |
27 | ) || exit |
79 | ) || exit |
28 | done |
80 | done |
29 | fi |
81 | fi |
30 | |
82 | |
|
|
83 | exit 0 |
|
|
84 | |
31 | if true; then |
85 | if true; then |
32 | |
86 | |
33 | ( |
87 | ( |
34 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
88 | perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST |
35 | |
89 | |
36 | echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst" |
90 | echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst" |
37 | |
91 | |
38 | #pangoversion;root/pangoversion |
92 | #pangoversion;root/pangoversion |
39 | #/opt/local/lib/libglib-2.0.so.0;shlib/darwin-2level/libglib-2.0.dylib |
93 | #/opt/local/lib/libglib-2.0.so.0;shlib/darwin-multi-2level/libglib-2.0.dylib |
40 | #/lib/libgcc_s.so.1;shlib/darwin-2level/libgcc_s.so.1 |
94 | #/lib/libgcc_s.so.1;shlib/darwin-multi-2level/libgcc_s.so.1 |
41 | #/opt/local/lib/libstdc++.so.6;shlib/darwin-2level/libstdc++.so.6 |
95 | #/opt/local/lib/libstdc++.so.6;shlib/darwin-multi-2level/libstdc++.so.6 |
42 | #/opt/local/lib/libaudio.so.2;shlib/darwin-2level/libaudio.so.2 |
96 | #/opt/local/lib/libaudio.so.2;shlib/darwin-multi-2level/libaudio.so.2 |
43 | |
97 | |
44 | ( echo "[Pango]"; echo "ModuleFiles = pango.modules" ) > pango.rc |
98 | ( echo "[Pango]"; echo "ModuleFiles = pango.modules" ) > pango.rc |
45 | echo "pango.rc;root/pango.rc" |
99 | echo "pango.rc;root/pango.rc" |
46 | |
100 | |
47 | ( |
101 | ( |
… | |
… | |
51 | echo "$base $rest" >&5 |
105 | echo "$base $rest" >&5 |
52 | done |
106 | done |
53 | ) 5>pango.modules |
107 | ) 5>pango.modules |
54 | echo "pango.modules;root/pango.modules" |
108 | echo "pango.modules;root/pango.modules" |
55 | |
109 | |
56 | for lib in \ |
110 | for lib in "${OPTLIBS[@]}"; do |
57 | db-4.6 \ |
|
|
58 | glib-2.0.0 gobject-2.0.0 gmodule-2.0.0 \ |
|
|
59 | pango-1.0.0 pangoft2-1.0.0 \ |
|
|
60 | SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0 \ |
|
|
61 | vorbisfile vorbis.0 ogg.0 \ |
|
|
62 | png12 jpeg.62 z.1 \ |
|
|
63 | fontconfig.1 expat.1 freetype.6 intl.8 iconv.2; |
|
|
64 | do |
|
|
65 | echo "/opt/local/lib/lib$lib.dylib;shlib/darwin-2level/lib$lib.dylib" |
111 | echo "/opt/local/lib/lib$lib.dylib;shlib/darwin-multi-2level/lib$lib.dylib" |
66 | done |
112 | done |
67 | |
113 | |
68 | cat >>fonts.conf <<EOF |
|
|
69 | <?xml version="1.0"?> |
|
|
70 | <!DOCTYPE fontconfig SYSTEM "fonts.dtd"> |
|
|
71 | <fontconfig> |
|
|
72 | |
|
|
73 | <match target="pattern"> <test qual="any" name="family"> <string>mono</string> </test> <edit name="family" mode="assign"> <string>monospace</string> </edit> </match> |
|
|
74 | |
|
|
75 | <match target="pattern"> <test qual="any" name="family"> <string>sans serif</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match> |
|
|
76 | |
|
|
77 | <match target="pattern"> <test qual="any" name="family"> <string>sans</string> </test> <edit name="family" mode="assign"> <string>sans-serif</string> </edit> </match> |
|
|
78 | |
|
|
79 | <cachedir>fontconfig-cache</cachedir> |
|
|
80 | |
|
|
81 | <config> |
|
|
82 | <blank> |
|
|
83 | <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> |
|
|
84 | </blank> |
|
|
85 | </config> |
|
|
86 | |
|
|
87 | </fontconfig> |
|
|
88 | EOF |
|
|
89 | echo "fonts.conf;root/fonts.conf" |
|
|
90 | |
|
|
91 | ) >addlist |
114 | ) >addlist |
92 | |
115 | |
93 | #cat pango.modules;exit |
116 | #cat pango.modules;exit |
94 | |
117 | |
95 | trap "rm -f addlist pango.rc pango.modules fonts.conf" 0 |
118 | trap "rm -f addlist pango.rc pango.modules fonts.conf" 0 |
96 | |
|
|
97 | cd /root/src/deliantra/Deliantra-Client |
|
|
98 | |
119 | |
99 | $PERL/bin/perl Makefile.PL |
120 | $PERL/bin/perl Makefile.PL |
100 | make clean |
121 | make clean |
101 | $PERL/bin/perl Makefile.PL |
122 | $PERL/bin/perl Makefile.PL |
102 | make install || exit |
123 | make install || exit |
… | |
… | |
158 | <key>LSMinimumSystemVersion</key> |
179 | <key>LSMinimumSystemVersion</key> |
159 | <string>10.5</string> |
180 | <string>10.5</string> |
160 | <key>NSAppleScriptEnabled</key> |
181 | <key>NSAppleScriptEnabled</key> |
161 | <false/> |
182 | <false/> |
162 | <key>NSHumanReadableCopyright</key> |
183 | <key>NSHumanReadableCopyright</key> |
163 | <string>Deliantra MORPG Client - Copyright 2008 The Deliantra Team</string> |
184 | <string>Deliantra MORPG Client - Copyright 2008,2009 The Deliantra Team</string> |
164 | </dict> |
185 | </dict> |
165 | </plist> |
186 | </plist> |
166 | EOF |
187 | EOF |
167 | |
188 | |
168 | rm -rf dmg |
189 | rm -rf dmg |