Changeset 319
- Timestamp:
- 04/01/08 23:43:23 (2 years ago)
- Files:
-
- trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile (modified) (1 diff)
- trunk/uploadr/README (modified) (17 diffs)
- trunk/uploadr/extensions/helloworld/content/overlay.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile
r275 r319 37 37 @echo " mac (Intel)" 38 38 @echo " ppc" 39 @echo " linux "39 @echo " linux - not implemented" 40 40 @echo " universal (combines mac and ppc dylibs using lipo)" 41 41 @echo "Components:" trunk/uploadr/README
r303 r319 12 12 ------------------------------------------------------------------------ 13 13 14 Download the Flickr Uploadr source archive from: 14 This guide uses UPLOADR to indicate the root of the Flickr Uploadr 15 source tree on your filesystem. It probably shouldn't contain spaces 16 (C:\Documents and Settings\you\My Documents\Flickr Uploadr is probably 17 a bad idea). 18 19 You can obtain the Flickr Uploadr source code from either a tarball or 20 from Subversion. 21 22 Download tarball: 15 23 http://flickr.com/tools/uploadr/ 16 24 17 XULRunner trunk builds can be found at: 25 Checkout from Subversion: 26 $ svn co http://code.flickr.com/svn/trunk/uploadr UPLOADR 27 28 XULRunner trunk builds: 18 29 ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/ 19 30 20 If you are on Windows, download a version of XULRunner trunk and unzip 21 it into: 31 Windows 32 ------- 33 34 Download a version of XULRunner trunk and unzip it into: 22 35 UPLOADR/MacUploadr.app/Contents/Resources/ 23 36 24 If you are on a Mac you have two more steps. First install the Mac 25 version of XULRunner, which will live in /Library/Frameworks. Then 26 run this (substituting your path to UPLOADR as necessary): 37 Under Windows, you'll also need bits from Mozilla's Wintools: 38 http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip 39 40 Extract that and copy glib-1.2.dll and libIDL-0.6.dll from 41 wintools/buildtools/windows/bin/x86/ to your gecko-sdk.win/bin/ directory. 42 43 Mac 44 --- 45 46 Install the Mac version of XULRunner, which will live in 47 /Library/Frameworks. Then pull it into your fake Uploadr distribution: 27 48 $ mkdir UPLOADR/MacUplaodr.app/Contents/Frameworks 28 49 $ sudo mv /Library/Frameworks/XUL.framework \ 29 UPLOADR/MacUploadr.app/Contents/Frameworks 30 31 To build the XPCOM components you will need the Gecko SDK. PPC Mac 32 and Windows versions are available here: 50 UPLOADR/MacUploadr.app/Contents/Frameworks 51 52 Install MacPorts if you haven't already: 53 http://svn.macosforge.org/repository/macports/downloads/MacPorts-1.5.0/ 54 55 TODO: libIDL from MacPorts 56 57 58 59 Gecko SDK 60 ------------------------------------------------------------------------ 61 62 To build the XPCOM components you will need the Gecko SDK. For PPC Mac 63 and Windows: 33 64 http://developer.mozilla.org/en/docs/Gecko_SDK#Downloading 34 65 35 An Intel Mac version is available here:66 For Intel Mac: 36 67 http://www.oxymoronical.com/view/1114 37 68 38 The SDKs should be placed in the following directories:69 Place the SDK(s) appropriately: 39 70 UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.mac (Intel Mac) 40 71 UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.ppc (PPC Mac) 41 72 UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.win (Windows) 42 73 43 The Windows XPCOM extensions can be built using Visual Studio 2005. 44 The Mac XPCOM extensions can be built using the included Makefile. 45 Running `make` with no arguments will give you the available targets. 46 47 Under Windows, you'll also need bits from Mozilla's Wintools. You can 48 download Wintools here: 49 http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip 50 51 Extract that and copy glib-1.2.dll and libIDL-0.6.dll from 52 wintools/buildtools/windows/bin/x86/ to your gecko-sdk.win/bin/ directory. 74 These SDKs are from the Gecko 1.8 series and so are only safe to use 75 if the XPCOM components use only frozen interfaces. Fortunately, 76 Uploadr currently falls into this category. 53 77 54 78 … … 59 83 You'll need your own API key and secret from Flickr to build Uploadr. 60 84 These can be obtained at http://flickr.com/services/api/. The key 61 and secret must be placed in flKey.cpp as indicated . This file is at:85 and secret must be placed in flKey.cpp as indicated: 62 86 UPLOADR/MacUploadr.app/Contents/Resources/components/flKey.cpp 63 87 … … 65 89 characters so it is not easily readable from the binary. 66 90 91 There are blocks to keep both a Windows and Mac key/secret in the same 92 source file (you certainly don't have to, though). This is mainly 93 important for the official builds. 94 67 95 68 96 … … 73 101 ------- 74 102 75 Download GraphicsMagick Windows SOURCE from:103 Download GraphicsMagick Windows SOURCE: 76 104 ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/windows/ 77 105 78 106 Go to the VisualMagick/configure directory of the GraphicsMagick Windows 79 source directory. Edit the project configuration as follows:107 source directory. Edit the project configuration: 80 108 o Set the active configuration to "Release" 81 109 o Change the Use of MFC under Configuration Properties > General to … … 89 117 90 118 Open the solution and let Visual Studio 8 have its way with the Visual 91 Studio 7 solution file. Make the following changes:119 Studio 7 solution file. Edit the project configuration: 92 120 o Change the Runtime Library for the CORE_Magick++ project under 93 121 Configuration Properties > C/C++ > Code Generation to … … 100 128 extraneous. In 1.1.7, the errors that will likely show up in a 101 129 try/catch block can be fixed by changing "exception" to "std::exception" 102 and adding "&" to make all of the catches happen by reference. 130 and adding "&" to make all of the catches happen by reference. The 131 official builds are build with 1.1.10 and will soon move to 1.1.11. 103 132 104 133 Add the path to your GraphicsMagick build's VisualMagick\lib directory … … 106 135 include path. 107 136 108 For Windows, the magic.mgk, modules.mgk and delegates.mgk files must be 109 in the root of the application (with application.ini). 110 111 Mac 112 --- 113 114 First make sure you install MacPorts from: 115 http://svn.macosforge.org/repository/macports/downloads/MacPorts-1.5.0/ 116 117 Then run these commands: 137 The magic.mgk, modules.mgk and delegates.mgk files must be in the root of 138 the application (next to application.ini). These files are included in 139 the tarball and Subversion checkouts, so you shouldn't have to worry. 140 141 Mac 142 --- 143 144 Install prerequisites with MacPorts: 118 145 $ sudo port install jpeg configure.flags=-O3 119 146 $ sudo port install tiff configure.flags=-O3 120 147 $ sudo port install libpng 121 $ sudo port install libidl 122 123 Download GraphicsMagick from:148 $ sudo port install libidl # TODO: Move north? 149 150 Download GraphicsMagick source: 124 151 ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/ 125 152 126 Configure and install GraphicsMagick like this:153 Configure and install GraphicsMagick: 127 154 $ ./configure \ 128 155 CFLAGS="-O3" \ … … 138 165 139 166 Because of dynamic/static linker weirdness, after building GraphicsMagick, 140 move libjpeg.dylib, libtiff.dylib and libpng.dylib out of the way like this:167 move libjpeg.dylib, libtiff.dylib and libpng.dylib out of the way: 141 168 $ sudo mv /opt/local/lib/libjpeg.dylib /opt/local/lib/libjpeg.dylib.sav 142 169 $ sudo mv /opt/local/lib/libtiff.dylib /opt/local/lib/libtiff.dylib.sav … … 144 171 145 172 For Mac, the magic.mgk, modules.mgk and delegates.mgk files must be in 146 Contents/lib/GraphicsMagick-<version>/config/. 173 Contents/lib/GraphicsMagick-<version>/config/. Like on Windows, these 174 are included in the tarball/Subversion trees. 147 175 148 176 … … 157 185 ------- 158 186 159 Just like GraphicsMagick, let Visual Studio 8 eat the 7.1 project files 160 and then make the following changes: 187 Download and install Expat for Windows: 188 http://sourceforge.net/project/showfiles.php?group_id=10127 189 190 Just like GraphicsMagick, let Visual Studio 8 eat the 7.1 project files. 191 Edit the project configuration: 161 192 o Disable every project in the Exiv2 solution except exiv2lib and xmpsdk 162 193 o Change the Runtime Library for remaining projects under … … 176 207 o Set the exiv2lib project's Configuration Properties > Librarian > 177 208 General > Link Library Dependencies to "Yes" 178 o Copy libexpat.dll from C:\Program Files\Expat 2.0.1\Bin to 179 UPLOADR\MacUploadr.app\Contents\Resources 180 o Ignore the rest of the Exiv2 README 181 182 209 210 Copy libexpat.dll from "C:\Program Files\Expat 2.0.1\Bin" to 211 "UPLOADR\MacUploadr.app\Contents\Resources". 212 213 Ignore the rest of the Exiv2 README. 183 214 184 215 Mac … … 192 223 $ make && sudo make install 193 224 194 Again because of static linker weirdness, after building Exiv2, run195 these commands. 225 Again because of static linker weirdness, after building Exiv2, move the 226 dynamic libraries out of the way: 196 227 $ sudo mv /opt/local/lib/libiconv.dylib /opt/local/lib/libiconv.dylib.sav 197 228 $ sudo mv /opt/local/lib/libexpat.dylib /opt/local/lib/libexpat.dylib.sav … … 203 234 ------------------------------------------------------------------------ 204 235 205 Checkout FFmpeg like this: 236 Windows 237 ------- 238 239 FFmpeg will not build in Visual Studio but can be linked by Visual 240 Studio. This means we need a full MSys environment. My apologies. 241 242 Do all of the MSys/MinGW stuff to get up and running: 243 http://arrozcru.no-ip.org/ffmpeg_wiki/tiki-index.php 244 245 Additionally add in dependencies like zlib: 246 http://wiki.videolan.org/Win32CompileMSYS 247 248 Check out and build the magic version of FFmpeg: 206 249 $ svn co -r 10885 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg 207 250 $ cd ffmpeg 208 209 Windows210 -------211 212 Do all of the MSys/MinGW stuff to get up and running.213 http://arrozcru.no-ip.org/ffmpeg_wiki/tiki-index.php214 215 Additionally add in dependencies like zlib this way:216 http://wiki.videolan.org/Win32CompileMSYS217 218 Once that's all up and running, time to configure/make/install.219 251 $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 220 252 --enable-memalign-hack --enable-static --disable-shared \ … … 228 260 --- 229 261 262 Check out the magic version of FFmpeg: 263 $ svn co -r 10885 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg 264 $ cd ffmpeg 265 266 Then build: 230 267 $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 231 268 --disable-vhook --disable-mmx --enable-static --disable-shared \ … … 238 275 ------------------------------------------------------------------------ 239 276 277 If you make any changes to the IDL files defining the XPCOM interfaces, 278 you must increment the BuildID defined in: 279 UPLOADR/MacUploadr.app/Contents/Resources/application.ini 280 240 281 Windows 241 282 ------- … … 244 285 UPLOADR/MacUploadr.app/Contents/Resources/components/*.vcproj 245 286 287 The two projects will generate gm.dll and key.dll. 288 246 289 Mac 247 290 --- … … 250 293 UPLOADR/MacUploadr.app/Contents/Resources/components/ 251 294 252 After rebuilding the XPCOM extensions you must increment the BuildID 253 defined in: 254 UPLOADR/MacUploadr.app/Contents/Resources/application.ini 255 256 257 258 Building Flickr Uploadr 259 ------------------------------------------------------------------------ 260 261 Windows 262 ------- 263 264 On Windows, there is very little left to be done. The root of your 265 application is actually: 266 UPLOADR/MacUploadr.app/Contents/Resources/ 295 Running `make ppc gm ; make ppc key` will build the PPC binaries as 296 gm.dylib.ppc and key.dylib.ppc. `make mac gm ; make mac key` will 297 build gm.dylib.mac and key.dylib.mac. These architecture-dependent 298 files can be combined on an Intel Mac to leave gm.dylib and key.dylib 299 by running `make universal gm ; make universal key`. 300 301 302 303 Running Flickr Uploadr 304 ------------------------------------------------------------------------ 305 306 Windows 307 ------- 267 308 268 309 Copy xulrunner-stub.exe from the xulrunner/ directory into the root 269 of your app, rename it to "Flickr Uploadr.exe" and double-click it 270 to run Uploadr. 271 272 Mac 273 --- 274 275 On Mac, the app can be launched by double-clicking on MacUploadr.app 276 in Finder. 277 278 279 280 Software Update Service 281 ------------------------------------------------------------------------ 282 283 Windows 284 ------- 285 286 ? 287 288 Mac 289 --- 290 291 Info on how to build MAR files is here: 292 293 http://wiki.mozilla.org/Software_Update:HowToManuallyGenerateMARFiles 294 295 Start with your mozconfig file, XULRunner style: 296 297 http://developer.mozilla.org/en/docs/XULRunner:Build_Instructions 298 299 Then a regular Mozilla build environment, following these: 300 310 of your app, UPLOADR/MacUploadr.app/Contents/Resources/, rename it to 311 "Flickr Uploadr.exe" and double-click it to run Uploadr. 312 313 You can hack the icons.ico file into the executable using Resource 314 Hacker: 315 http://angusj.com/resourcehacker/ 316 317 Create a shortcut to this executable and append the "-console 318 -jsconsole" parameters to launch Uploadr with both debug windows open. 319 320 Mac 321 --- 322 323 The app can be launched by double-clicking on MacUploadr.app in Finder. 324 325 Launch Uploadr from Terminal to get debug windows: 326 $ MacUploadr.app/Contents/MacOS/xulrunner -jsconsole 327 328 329 330 Packaging 331 ------------------------------------------------------------------------ 332 333 Windows 334 ------- 335 336 Windows installers are created using NSIS, specifically the Unicode 337 version built from their CVS: 338 http://forums.winamp.com/showthread.php?threadid=277381 339 340 Building the NSIS package will likely fail if you do not have Visual 341 Studio 8 installed. The installer references vcredist_x86.exe. For 342 controlled experimentation it is OK to omit this installation step by 343 commenting line 110 in UPLOADR/windows_install_build.nsi. 344 345 One-command builds for all eight languages: 346 $ make win all 347 348 If you do not want to create update files (see below): 349 $ make win all-build 350 351 Mac 352 --- 353 354 One-command builds for all eight languages: 355 $ make mac all 356 357 If you do not want to create update files (see below): 358 $ make mac all-build 359 360 361 362 Software Update 363 ------------------------------------------------------------------------ 364 365 Uploadr phones home to Flickr about once a day to check for updates, 366 available as MAR files. Details: 367 http://wiki.mozilla.org/Software_Update 368 369 Actually creating software updates means actually building Mozilla. 370 This is not for the faint of heart. 371 372 Start by satisfying prerequisites for your platform: 373 http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites 301 374 http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites 302 375 303 Altogether, at this point it should look like this: 304 305 ~/.mozconfig: 306 mk_add_options MOZ_CO_PROJECT=all 307 ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk 308 ac_add_options --disable-javaxpcom 309 ac_add_options --enable-application=xulrunner 310 311 $ cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot co \ 312 mozilla/client.mk 376 Configure your build, using the UPLOADR/mozconfig file. Make sure to 377 comment the Mac-specific line if you're on Windows: 378 http://developer.mozilla.org/en/docs/Configuring_Build_Options 379 380 Now checkout and build Mozilla: 381 $ cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot \ 382 co mozilla/client.mk 313 383 $ cd mozilla 314 384 $ make -f client.mk checkout 315 385 $ make -f client.mk build 316 386 317 There may be an easier way, something like what Songbird does: 318 319 http://publicsvn.songbirdnest.com/browser/trunk/build/mozconfig/ \ 320 xulrunner.windows.debug.i686.mozconfig 321 387 Once you have your Mozilla tree built, the Packaging section above can 388 complete properly. Alternatively, if you just want to build the MAR 389 files: 390 $ make win all-mar 391 --OR-- 392 $ make mac all-mar trunk/uploadr/extensions/helloworld/content/overlay.js
r297 r319 70 70 // After reorder: called after the photo list is reordered for any reason. 71 71 // Callback argument: boolean, true if the user dragged photos around, 72 // false if the photos were sorted by date taken72 // false if the photos were sorted by date taken 73 73 // See also: mouse.js, threads.js 74 74 extension.after_reorder.add(function(from_user) { … … 94 94 95 95 // After one upload: called after an individual upload finishes. 96 // Callback argument : Photo object, success/failure boolean96 // Callback arguments: Photo object, success/failure boolean 97 97 // See also: upload.js 98 98 extension.after_one_upload.add(function(photo, success) { … … 110 110 // After upload: called after a batch of uploads finishes. 111 111 // Callback arguments: array of successful Photo objects, array of failed 112 // Photo objects112 // Photo objects 113 113 // See also: photos.js, upload.js 114 114 extension.after_upload.add(function(photo_ids, failed) {