ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/makebin.osx
(Generate patch)

Comparing deliantra/Deliantra-Client/makebin.osx (file contents):
Revision 1.12 by root, Sun Mar 29 22:28:12 2009 UTC vs.
Revision 1.20 by root, Mon Dec 26 03:58:12 2011 UTC

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
8export MACOSX_DEPLOYMENT_TARGET=10.5 # nope 13#export MACOSX_DEPLOYMENT_TARGET=10.5 # nope
9 14
10cvs update 15cvs update
11 16
12PERL=/opt/local 17PREFIX=/opt/local
13PERLLIB=/usr/lib/perl5 18PERL=$PREFIX
19DB1=4
20DB2=6
21
22ln -sf $PREFIX/include/db$DB1$DB2/db.h $PREFIX/include/db.h
23rm -f $PREFIX/lib/libdb-$DB1.$DB2.dylib
24cp -p $PREFIX/lib/db$DB1$DB2/libdb-$DB1.$DB2.dylib $PREFIX/lib/libdb-$DB1.$DB2.dylib
25
26eval $(perl -V:sitelib)
27PERLLIB=$sitelib
28
29OPTLIBS=(
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
39declare -A deliantrified
40
41deliantrify_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
14 63
15umask 022 64umask 022
16 65
17if true; then 66if true; then
18 for mod in AnyEvent EV JSON-XS deliantra/Deliantra Compress-LZF BDB Guard; do 67 for mod in common-sense AnyEvent EV JSON-XS Compress-LZF BDB Guard deliantra/Deliantra; do
19 ( 68 (
20 mkdir -p /root/src/$mod || exit 77 69 mkdir -p /root/src/$mod || exit 77
21 cd /root/src/$mod 70 cd /root/src/$mod
22 set -x 71 set -x
23 pwd 72 pwd
24 rsync -avPessh 10.0.0.1:src/$mod/. . --del 73 rsync -avPessh 10.0.0.1:src/$mod/. . --del --exclude "*.tar.gz" --delete-excluded
25 $PERL/bin/perl Makefile.PL </dev/null 74 $PERL/bin/perl Makefile.PL </dev/null
26 make clean 75 make clean
27 $PERL/bin/perl Makefile.PL </dev/null 76 $PERL/bin/perl Makefile.PL </dev/null
28 make install || exit 77 make install || exit
29 make clean 78 make clean
30 ) || exit 79 ) || exit
31 done 80 done
32fi 81fi
33 82
83exit 0
84
34if true; then 85if true; then
35 86
36( 87(
37 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
38 89
39 echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst" 90 echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst"
40 91
41#pangoversion;root/pangoversion 92#pangoversion;root/pangoversion
42#/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
43#/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
44#/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
45#/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
46 97
47 ( echo "[Pango]"; echo "ModuleFiles = pango.modules" ) > pango.rc 98 ( echo "[Pango]"; echo "ModuleFiles = pango.modules" ) > pango.rc
48 echo "pango.rc;root/pango.rc" 99 echo "pango.rc;root/pango.rc"
49 100
50 ( 101 (
54 echo "$base $rest" >&5 105 echo "$base $rest" >&5
55 done 106 done
56 ) 5>pango.modules 107 ) 5>pango.modules
57 echo "pango.modules;root/pango.modules" 108 echo "pango.modules;root/pango.modules"
58 109
59 for lib in \ 110 for lib in "${OPTLIBS[@]}"; do
60 db-4.6 \
61 glib-2.0.0 gobject-2.0.0 gmodule-2.0.0 \
62 pango-1.0.0 pangoft2-1.0.0 \
63 SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0 \
64 vorbisfile vorbis.0 ogg.0 \
65 png12 jpeg.62 z.1 \
66 fontconfig.1 expat.1 freetype.6 intl.8 iconv.2;
67 do
68 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"
69 done 112 done
70 113
71) >addlist 114) >addlist
72 115
73#cat pango.modules;exit 116#cat pango.modules;exit
74 117
75trap "rm -f addlist pango.rc pango.modules fonts.conf" 0 118trap "rm -f addlist pango.rc pango.modules fonts.conf" 0
76
77cd /root/src/deliantra/Deliantra-Client
78 119
79$PERL/bin/perl Makefile.PL 120$PERL/bin/perl Makefile.PL
80make clean 121make clean
81$PERL/bin/perl Makefile.PL 122$PERL/bin/perl Makefile.PL
82make install || exit 123make install || exit
138 <key>LSMinimumSystemVersion</key> 179 <key>LSMinimumSystemVersion</key>
139 <string>10.5</string> 180 <string>10.5</string>
140 <key>NSAppleScriptEnabled</key> 181 <key>NSAppleScriptEnabled</key>
141 <false/> 182 <false/>
142 <key>NSHumanReadableCopyright</key> 183 <key>NSHumanReadableCopyright</key>
143 <string>Deliantra MORPG Client - Copyright 2008 The Deliantra Team</string> 184 <string>Deliantra MORPG Client - Copyright 2008,2009 The Deliantra Team</string>
144</dict> 185</dict>
145</plist> 186</plist>
146EOF 187EOF
147 188
148rm -rf dmg 189rm -rf dmg

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines