root/trunk/uploadr/README.osx

Revision 377, 7.7 kB (checked in by mygrant, 2 years ago)

Fix some typos, update some instructions

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