ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/makebin.osx
Revision: 1.19
Committed: Sat Apr 24 08:05:16 2010 UTC (14 years ago) by root
Branch: MAIN
Changes since 1.18: +6 -8 lines
Log Message:
*** empty log message ***

File Contents

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