root/trunk/uploadr/README.osx

Revision 530, 9.5 kB (checked in by jdecq, 9 months ago)

=Update Readme to tell to build xulrunner 1.9.1

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