root/trunk/uploadr/README.osx

Revision 537, 9.9 kB (checked in by jdecq, 9 months ago)

=changes to create and use xulrunner 1.9.1 universal Mac OS X libraries

Line 
1 Flickr Uploadr
2
3 Copyright (c) 2007-2008 Yahoo! Inc.  All rights reserved.  This library is
4 free software; you can redistribute it and/or modify it under the terms of
5 the GNU General Public License (GPL), version 2 only.  This library is
6 distributed WITHOUT ANY WARRANTY, whether express or implied. See the GNU
7 GPL for more details (http://www.gnu.org/licenses/gpl.html)
8
9 ------------------------------------------------------------------------
10
11 This guide uses UPLOADR to indicate the root of the Flickr Uploadr
12 source tree on your filesystem.  It probably shouldn't contain spaces.
13
14 You can obtain the Flickr Uploadr source code from either a tarball or
15 from Subversion.
16
17 Download tarball:
18   http://flickr.com/tools/uploadr/
19
20 Checkout from Subversion:
21   $ svn co http://code.flickr.com/svn/trunk/uploadr UPLOADR
22
23
24 XULRunner
25 ------------------------------------------------------------------------
26
27 you'll have to build it until 1.9.1 is released
28 Good luck!
29
30 finish with :
31 make -C obj-xulrunner/ppc/xulrunner/installer/ CHOWN_ROOT=~/UPLOADR/chown_root CHOWN_REVERT=~/UPLOADR/chown_revert
32 install the resulting xulrunner-1.9.1b3pre.en-US.mac-pkg.dmg
33
34
35 (rsync -rl mozilla/obj-xulrunner/ppc/dist/universal/xulrunner/XUL.framework/ MacUploadr.app/Contents/Frameworks)
36
37
38 XULRunner trunk builds:
39   ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/
40
41 Note: You want the version *without* 'sdk' in the name.
42
43 Install the Mac version of XULRunner, which will live in
44 /Library/Frameworks.  Then pull it into your fake Uploadr distribution:
45   $ mkdir UPLOADR/MacUploadr.app/Contents/Frameworks
46   $ sudo mv /Library/Frameworks/XUL.framework \
47     UPLOADR/MacUploadr.app/Contents/Frameworks
48
49 Install MacPorts if you haven't already:
50   http://svn.macosforge.org/repository/macports/downloads/MacPorts-1.5.0/
51
52 The Mozilla tools require the IDL library:
53   $ sudo port install libidl (sudo /opt/local/bin/port install libidl)
54
55
56 Gecko SDK
57 ------------------------------------------------------------------------
58
59 To build the XPCOM components you will need the Gecko SDK. For PPC Mac:
60   http://developer.mozilla.org/en/docs/Gecko_SDK#Downloading
61
62 For Intel Mac:
63 http://developer.mozilla.org/en/docs/Gecko_SDK#Downloading
64 was http://www.oxymoronical.com/view/1114
65
66 Place the SDK(s) appropriately:
67   UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.mac (Intel Mac)
68   UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.ppc (PPC Mac)
69
70 These SDKs are from the Gecko 1.8/1.9 series and so are only safe to use
71 if the XPCOM components use only frozen interfaces.  Fortunately,
72 Uploadr currently falls into this category.
73
74
75 API Keys
76 ------------------------------------------------------------------------
77
78 You'll need your own API key and secret from Flickr to build Uploadr.
79 These can be obtained at http://flickr.com/services/api/.  The key
80 and secret must be placed in flKey.cpp in the spaces provided. Copy
81 flKey.cpp.template to flKey.cpp and insert your keys:
82
83   UPLOADR/MacUploadr.app/Contents/Resources/components/flKey.cpp.template
84   UPLOADR/MacUploadr.app/Contents/Resources/components/flKey.cpp
85
86 The API key is stored as a string.  The secret is stored as individual
87 characters so it is not easily readable from the binary.
88
89 There are blocks to keep both a Windows and Mac key/secret in the same
90 source file (you certainly don't have to, though).  This is mainly
91 important for the official builds.
92
93 Libintl static linking
94 ------------------------------------------------------------------------
95 Because of dynamic/static linker weirdness, before building GraphicsMagick,
96 and Exiv, move libintl.dylibout of the way:
97   $ sudo mv /opt/local/lib/libintl.dylib /opt/local/lib/libintl.dylib.sav
98 you might need to do that for all the versions of libintl you have on your system
99
100 GraphicsMagick
101 ------------------------------------------------------------------------
102
103 Install prerequisites with MacPorts:
104   $ sudo port install jpeg configure.flags=-O3
105   $ sudo port install tiff configure.flags=-O3
106   $ sudo port install libpng
107
108 Download GraphicsMagick source (try and stick with 1.1.10):
109   ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.1/GraphicsMagick-1.1.10.tar.bz2
110
111 jde - trying 1.2.5 (ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/1.2/GraphicsMagick-1.2.5.tar.bz2) to match WINDOWS
112
113 Configure and install GraphicsMagick:
114   $ ./configure \
115     CFLAGS="-O3" \
116     CXXFLAGS="-O3" \
117     CPPFLAGS="-I/opt/local/include -I/usr/local/include" \
118     LDFLAGS="-L/opt/local/lib -L/usr/local/lib" \
119     --without-x --without-perl \
120     --disable-installed \
121     --without-dps --without-fpx --without-jbig --without-jp2 \
122     --without-lcms --without-trio --without-ttf --without-wmf \
123     --with-quantum-depth=16
124   $ make && sudo make install
125
126 Because of dynamic/static linker weirdness, after building GraphicsMagick,
127 move libjpeg.dylib, libtiff.dylib and libpng.dylib out of the way:
128   $ sudo mv /opt/local/lib/libjpeg.dylib /opt/local/lib/libjpeg.dylib.sav
129   $ sudo mv /opt/local/lib/libtiff.dylib /opt/local/lib/libtiff.dylib.sav
130   $ sudo mv /opt/local/lib/libpng.dylib /opt/local/lib/libpng.dylib.sav
131
132 For Mac, the magic.mgk, modules.mgk and delegates.mgk files must be in
133 Contents/lib/GraphicsMagick-<version>/config/.  Like on Windows, these
134 are included in the tarball/Subversion trees.
135
136
137
138 Exiv2
139 ------------------------------------------------------------------------
140
141 Download Exiv2 source from:
142   http://exiv2.org/download.html
143
144 In Unix-land, it's easy!
145   $ sudo port install libiconv
146   $ sudo port install expat
147   $ sudo port install xml2 (jde - does not exist: so libxml2?)
148   $ ./configure --prefix=/opt/local --disable-shared --with-expat=/opt/local
149   $ make && sudo make install
150
151 Again because of static linker weirdness, after building Exiv2, move the
152 dynamic libraries out of the way:
153   $ sudo mv /opt/local/lib/libiconv.dylib /opt/local/lib/libiconv.dylib.sav
154   $ sudo mv /opt/local/lib/libexpat.dylib /opt/local/lib/libexpat.dylib.sav
155   $ sudo mv /opt/local/lib/libxml2.dylib /opt/local/lib/libxml2.dylib.sav
156
157
158 FFmpeg
159 ------------------------------------------------------------------------
160
161 Check out the most recent version of FFmpeg:
162   $ svn co svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
163   $ cd ffmpeg
164
165 Then build:
166   $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \
167     --disable-vhook --disable-mmx --enable-static --disable-shared  \
168     --extra-cflags=-fno-common --disable-debug --enable-swscale
169   $ make && sudo make install
170
171 jde : encountered:
172 > make(6189) malloc: *** vm_allocate(size=4272951296) failed (error
173 > code=3)
174 > make(6189) malloc: *** error: can't allocate region
175 > make(6189) malloc: *** set a breakpoint in szone_error to debug
176 > make: *** virtual memory exhausted.  Stop.
177 >
178
179 $ which make
180 /usr/bin/make
181 $ make --version
182 GNU Make 3.80
183
184 port install gmake
185 $ which gmake
186 /opt/local/bin/gmake
187 $ gmake --version
188 GNU Make 3.81
189
190 and used gmake instead of make
191
192
193 Building XPCOM components
194 ------------------------------------------------------------------------
195
196 If you make any changes to the IDL files defining the XPCOM interfaces,
197 you must increment the BuildID defined in:
198   UPLOADR/MacUploadr.app/Contents/Resources/application.ini
199
200 Use the Makefile in:
201   UPLOADR/MacUploadr.app/Contents/Resources/components/
202
203 http://developer.mozilla.org/en/docs/Gecko_SDK#Issues_with_the_OS_X_SDK
204
205 Running `make ppc gm ; make ppc key` will build the PPC binaries as
206 gm.dylib.ppc and key.dylib.ppc.  `make mac gm ; make mac key` will
207 build gm.dylib.mac and key.dylib.mac.  These architecture-dependent
208 files can be combined on an Intel Mac to leave gm.dylib and key.dylib
209 by running `make universal gm ; make universal key`.
210
211 Make sure by running otool -Lv that you are not depending on libintl, which is not intalled by default on Mac Os X
212
213 Running Flickr Uploadr
214 ------------------------------------------------------------------------
215 cp MacUploadr.app/Contents/Frameworks/Versions/1.9..../xulrunner-bin MacUploadr.app/Contents/MacOS/xulrunner ???
216
217 The app can be launched by double-clicking on MacUploadr.app in Finder.
218
219 Launch Uploadr from Terminal to get debug windows:
220   $ chmod a+w MacUploadr.app/Contents/MacOS/xulrunner
221   $ chmod a+x MacUploadr.app/Contents/MacOS/xulrunner
222   $ MacUploadr.app/Contents/MacOS/xulrunner -jsconsole
223
224
225 Packaging
226 ------------------------------------------------------------------------
227
228 The nice background image for the DMGs must be recreated each time you
229 change version numbers.
230   o Start Disk Utility and create a new image called "Flickr Uploadr
231     $(VERSION)" (substitute your version)
232   o Create a folder there called "Flickr Uploadr.app" and a symbolic
233     link called "Applications"
234   o Copy one of the installer images from mac_installer/ in as ".i.png"
235   o Create a symbolic link to that image as "i.png"
236   o Open the image with Finder and press Command+J to set folder options
237       o Select "This window only"
238       o Set the "Icon size" to 128px
239       o Uncheck "Snap to grid"
240       o Set the background picture to your "i.png" symbolic link (this
241         is rather finicky)
242       o Close the settings window
243   o Delete the "i.png" symbolic link (the hidden file will remain)
244   o Arrange the icons appropriately
245   o Close the window
246
247 After all of that, copy the .DS_Store file into your source tree, the
248 Makefile will take care of everything else (substitute your version):
249   $ cp /Volumes/Flickr\ Uploadr\ $(VERSION)/.DS_Store \
250     UPLOADR/mac_installer/DS_Store
251
252 Unmount and delete the disk image you created.
253
254 One-command builds for all eight languages:
255   $ make mac all
256
257 NOTE: This will fail at the MAR build steps, unless you have the Mozilla
258 tools built and installed. See README.updates for this, or you can
259 skip the MAR build step (recommended for outside developers):
260   $ make mac all-build
261
262 Or to build a single language:
263   $ make mac build en-US
264
265
Note: See TracBrowser for help on using the browser.