ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/makebin.osx
Revision: 1.3
Committed: Wed Aug 20 18:26:03 2008 UTC (15 years, 8 months ago) by root
Branch: MAIN
CVS Tags: rel-0_9975
Changes since 1.2: +44 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 root 1.1 #!/bin/bash
2    
3     # Convert a gtk2-perl program to a standalone OS X binary
4    
5     PERL=/opt/local
6     PERLLIB=/usr/lib/perl5
7     PANGO=1.6.0
8    
9 root 1.2 umask 022
10    
11 root 1.1 if false; then
12     for mod in AnyEvent EV JSON-XS Deliantra Compress-LZF BDB; do
13     (
14     cd /root/src/$mod
15     $PERL/bin/perl Makefile.PL </dev/null
16     make clean
17     $PERL/bin/perl Makefile.PL </dev/null
18     make install || exit
19     make clean
20     )
21     done
22     fi
23    
24 root 1.2 if true; then
25    
26 root 1.1 (
27     perl -ne '/^(resources\/.*)/ and print "$1;root/Deliantra/Client/private/$1\n"' <MANIFEST
28    
29     echo "docwiki.pst;root/Deliantra/Client/private/resources/docwiki.pst"
30    
31     #pangoversion;root/pangoversion
32     #/opt/local/lib/libglib-2.0.so.0;shlib/darwin-2level/libglib-2.0.dylib
33     #/lib/libgcc_s.so.1;shlib/darwin-2level/libgcc_s.so.1
34     #/opt/local/lib/libstdc++.so.6;shlib/darwin-2level/libstdc++.so.6
35     #/opt/local/lib/libaudio.so.2;shlib/darwin-2level/libaudio.so.2
36    
37     ( echo "[Pango]"; echo "ModuleFiles = pango.modules" ) > pango.rc
38     echo "pango.rc;root/pango.rc"
39    
40     (
41     grep ^/opt /opt/local/etc/pango/pango.modules | while read so rest; do
42     base=$(basename "$so")
43     echo "$so;root/$base"
44     echo "$base $rest" >&5
45     done
46     ) 5>pango.modules
47     echo "pango.modules;root/pango.modules"
48    
49     for lib in \
50     db-4.6 \
51     glib-2.0.0 gobject-2.0.0 gmodule-2.0.0 \
52     pango-1.0.0 pangoft2-1.0.0 \
53     SDL-1.2.0 SDL_mixer-1.2.0 SDL_image-1.2.0 \
54     vorbisfile vorbis.0 ogg.0 \
55     png12 jpeg.62 z.1 \
56     fontconfig.1 expat.1 freetype.6 intl.8 iconv.2;
57     do
58     echo "/opt/local/lib/lib$lib.dylib;shlib/darwin-2level/lib$lib.dylib"
59     done
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     ) >addlist
85    
86     #cat pango.modules;exit
87    
88     trap "rm -f addlist pango.rc pango.modules fonts.conf" 0
89    
90     cd /root/src/deliantra/Deliantra-Client
91    
92     #$PERL/bin/perl Makefile.PL
93     #make clean
94     #$PERL/bin/perl Makefile.PL
95     make install || exit
96    
97     DYLD_LIBRARY_PATH=/opt/local/lib \
98     $PERL/bin/pp -C \
99 root 1.2 -z 9 \
100 root 1.1 -M AnyEvent::Impl::EV \
101     -M attributes \
102     -a "blib/arch/auto/Deliantra/Client/Client.bundle;lib/auto/Deliantra/Client/Client.bundle" \
103 root 1.2 -o deliantra -A addlist bin/deliantra || exit
104    
105     fi
106    
107     # for other OS'es, we would be finished now, but for OS X, this is just one third of the process :/
108     # create the app
109    
110     VER=$(perl -e 'require "DC.pm"; print $DC::VERSION')
111     APP="Deliantra MORPG Client $VER"
112    
113     rm -rf "Deliantra MORPG Client "*.app
114    
115     mkdir "$APP".app "$APP".app/Contents "$APP".app/Contents/MacOS "$APP".app/Contents/Resources
116    
117     ln deliantra "$APP".app/Contents/MacOS/run
118     ln osx/deliantra.icns "$APP".app/Contents/Resources/
119    
120     cat >"$APP.app/Contents/Info.plist" <<EOF
121     <?xml version="1.0" encoding="UTF-8"?>
122     <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
123     <plist version="1.0">
124     <dict>
125     <key>CFBundleDevelopmentRegion</key>
126     <string>English</string>
127     <key>CFBundleDisplayName</key>
128     <string>Deliantra MORPG Client</string>
129     <key>CFBundleExecutable</key>
130     <string>run</string>
131     <key>CFBundleGetInfoString</key>
132     <string>Deliantra MORPG Client $VER (www.deliantra.net)</string>
133     <key>CFBundleIconFile</key>
134     <string>deliantra.icns</string>
135     <key>CFBundleIdentifier</key>
136     <string>net.deliantra.client</string>
137     <key>CFBundleInfoDictionaryVersion</key>
138     <string>6.0</string>
139     <key>CFBundleName</key>
140     <string>Deliantra MORPG Client</string>
141     <key>CFBundlePackageType</key>
142     <string>APPL</string>
143     <key>CFBundleShortVersionString</key>
144     <string>$VER</string>
145     <key>CFBundleVersionString</key>
146     <string>$VER.$(date "+%Y.%m.%d.%H.%M.%S")</string>
147     <key>CFBundleSignature</key>
148     <string>????</string>
149     <key>LSHasLocalizedDisplayName</key>
150     <false/>
151     <key>LSMinimumSystemVersion</key>
152     <string>10.5</string>
153     <key>NSAppleScriptEnabled</key>
154     <false/>
155     <key>NSHumanReadableCopyright</key>
156     <string>Deliantra MORPG Client - Copyright 2008 The Deliantra Team</string>
157     </dict>
158     </plist>
159     EOF
160    
161     rm -rf dmg
162     mkdir dmg
163    
164     mv "$APP.app" dmg/
165    
166 root 1.3 cat >dmg/README.txt <<EOF
167     Hello!
168    
169     This disk image contains the Deliantra MORPG game client.
170    
171     To play it, simply double-click it, then select a good graphics resolution
172     in the Setup => Graphics tab and then go to Setup => Login, enter a nickname
173     (no spaces, only ASCII letters supported) and a password, then hit Login.
174    
175     You can also install the client application by dragging it onto your
176     harddisk or anywhere else, but it should play perfectly fine from the disk
177     image.
178    
179     The game stores configuration settings, map data, music and other resources
180     in a hidden directory called .deliantra in your home directory.
181    
182     The script "Reset Configuration" will reset the configuration and delete
183     any downloaded resources. You can use this when you no longer want to play
184     Deliantra, or when you have problems with the settings (window too large
185     etc.).
186    
187     Unfortunately, Mac OS X has quite buggy OpenGL support: make sure your
188     monitor cable is plugged in correctly when you can't go into fullscreen or
189     when the graphics look broken.
190    
191     See http://www.deliantra.net/ for more info.
192    
193     EOF
194    
195     cat >dmg/"Reset Configuration" <<EOF
196     #!/bin/sh
197    
198     rm -rf ~/.deliantra
199    
200     echo
201     echo
202     echo
203     echo
204     echo
205     echo Configuration/Cache Cleared
206    
207     EOF
208     chmod 755 dmg/"Reset Configuration"
209    
210 root 1.2 # now, the last third, putting all this into a dmg
211    
212     hdiutil create -srcfolder dmg -volname "Deliantra MORPG Client" -ov -format UDZO ~user/"Deliantra_MORPG_Client-$VER".dmg
213     ls -l ~user/"Deliantra_MORPG_Client-$VER".dmg
214     rm -rf dmg
215    
216 root 1.1
217