Index: trunk/uploadr/README =================================================================== --- trunk/uploadr/README (revision 303) +++ trunk/uploadr/README (revision 319) @@ -12,43 +12,67 @@ ------------------------------------------------------------------------ -Download the Flickr Uploadr source archive from: +This guide uses UPLOADR to indicate the root of the Flickr Uploadr +source tree on your filesystem. It probably shouldn't contain spaces +(C:\Documents and Settings\you\My Documents\Flickr Uploadr is probably +a bad idea). + +You can obtain the Flickr Uploadr source code from either a tarball or +from Subversion. + +Download tarball: http://flickr.com/tools/uploadr/ -XULRunner trunk builds can be found at: +Checkout from Subversion: + $ svn co http://code.flickr.com/svn/trunk/uploadr UPLOADR + +XULRunner trunk builds: ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/ -If you are on Windows, download a version of XULRunner trunk and unzip -it into: +Windows +------- + +Download a version of XULRunner trunk and unzip it into: UPLOADR/MacUploadr.app/Contents/Resources/ -If you are on a Mac you have two more steps. First install the Mac -version of XULRunner, which will live in /Library/Frameworks. Then -run this (substituting your path to UPLOADR as necessary): +Under Windows, you'll also need bits from Mozilla's Wintools: + http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip + +Extract that and copy glib-1.2.dll and libIDL-0.6.dll from +wintools/buildtools/windows/bin/x86/ to your gecko-sdk.win/bin/ directory. + +Mac +--- + +Install the Mac version of XULRunner, which will live in +/Library/Frameworks. Then pull it into your fake Uploadr distribution: $ mkdir UPLOADR/MacUplaodr.app/Contents/Frameworks $ sudo mv /Library/Frameworks/XUL.framework \ - UPLOADR/MacUploadr.app/Contents/Frameworks - -To build the XPCOM components you will need the Gecko SDK. PPC Mac -and Windows versions are available here: + UPLOADR/MacUploadr.app/Contents/Frameworks + +Install MacPorts if you haven't already: + http://svn.macosforge.org/repository/macports/downloads/MacPorts-1.5.0/ + +TODO: libIDL from MacPorts + + + +Gecko SDK +------------------------------------------------------------------------ + +To build the XPCOM components you will need the Gecko SDK. For PPC Mac +and Windows: http://developer.mozilla.org/en/docs/Gecko_SDK#Downloading -An Intel Mac version is available here: +For Intel Mac: http://www.oxymoronical.com/view/1114 -The SDKs should be placed in the following directories: +Place the SDK(s) appropriately: UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.mac (Intel Mac) UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.ppc (PPC Mac) UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.win (Windows) -The Windows XPCOM extensions can be built using Visual Studio 2005. -The Mac XPCOM extensions can be built using the included Makefile. -Running `make` with no arguments will give you the available targets. - -Under Windows, you'll also need bits from Mozilla's Wintools. You can -download Wintools here: - http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip - -Extract that and copy glib-1.2.dll and libIDL-0.6.dll from -wintools/buildtools/windows/bin/x86/ to your gecko-sdk.win/bin/ directory. +These SDKs are from the Gecko 1.8 series and so are only safe to use +if the XPCOM components use only frozen interfaces. Fortunately, +Uploadr currently falls into this category. @@ -59,5 +83,5 @@ You'll need your own API key and secret from Flickr to build Uploadr. These can be obtained at http://flickr.com/services/api/. The key -and secret must be placed in flKey.cpp as indicated. This file is at: +and secret must be placed in flKey.cpp as indicated: UPLOADR/MacUploadr.app/Contents/Resources/components/flKey.cpp @@ -65,4 +89,8 @@ characters so it is not easily readable from the binary. +There are blocks to keep both a Windows and Mac key/secret in the same +source file (you certainly don't have to, though). This is mainly +important for the official builds. + @@ -73,9 +101,9 @@ ------- -Download GraphicsMagick Windows SOURCE from: +Download GraphicsMagick Windows SOURCE: ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/windows/ Go to the VisualMagick/configure directory of the GraphicsMagick Windows -source directory. Edit the project configuration as follows: +source directory. Edit the project configuration: o Set the active configuration to "Release" o Change the Use of MFC under Configuration Properties > General to @@ -89,5 +117,5 @@ Open the solution and let Visual Studio 8 have its way with the Visual -Studio 7 solution file. Make the following changes: +Studio 7 solution file. Edit the project configuration: o Change the Runtime Library for the CORE_Magick++ project under Configuration Properties > C/C++ > Code Generation to @@ -100,5 +128,6 @@ extraneous. In 1.1.7, the errors that will likely show up in a try/catch block can be fixed by changing "exception" to "std::exception" -and adding "&" to make all of the catches happen by reference. +and adding "&" to make all of the catches happen by reference. The +official builds are build with 1.1.10 and will soon move to 1.1.11. Add the path to your GraphicsMagick build's VisualMagick\lib directory @@ -106,23 +135,21 @@ include path. -For Windows, the magic.mgk, modules.mgk and delegates.mgk files must be -in the root of the application (with application.ini). - -Mac ---- - -First make sure you install MacPorts from: - http://svn.macosforge.org/repository/macports/downloads/MacPorts-1.5.0/ - -Then run these commands: +The magic.mgk, modules.mgk and delegates.mgk files must be in the root of +the application (next to application.ini). These files are included in +the tarball and Subversion checkouts, so you shouldn't have to worry. + +Mac +--- + +Install prerequisites with MacPorts: $ sudo port install jpeg configure.flags=-O3 $ sudo port install tiff configure.flags=-O3 $ sudo port install libpng - $ sudo port install libidl - -Download GraphicsMagick from: + $ sudo port install libidl # TODO: Move north? + +Download GraphicsMagick source: ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/ -Configure and install GraphicsMagick like this: +Configure and install GraphicsMagick: $ ./configure \ CFLAGS="-O3" \ @@ -138,5 +165,5 @@ Because of dynamic/static linker weirdness, after building GraphicsMagick, -move libjpeg.dylib, libtiff.dylib and libpng.dylib out of the way like this: +move libjpeg.dylib, libtiff.dylib and libpng.dylib out of the way: $ sudo mv /opt/local/lib/libjpeg.dylib /opt/local/lib/libjpeg.dylib.sav $ sudo mv /opt/local/lib/libtiff.dylib /opt/local/lib/libtiff.dylib.sav @@ -144,5 +171,6 @@ For Mac, the magic.mgk, modules.mgk and delegates.mgk files must be in -Contents/lib/GraphicsMagick-/config/. +Contents/lib/GraphicsMagick-/config/. Like on Windows, these +are included in the tarball/Subversion trees. @@ -157,6 +185,9 @@ ------- -Just like GraphicsMagick, let Visual Studio 8 eat the 7.1 project files -and then make the following changes: +Download and install Expat for Windows: + http://sourceforge.net/project/showfiles.php?group_id=10127 + +Just like GraphicsMagick, let Visual Studio 8 eat the 7.1 project files. +Edit the project configuration: o Disable every project in the Exiv2 solution except exiv2lib and xmpsdk o Change the Runtime Library for remaining projects under @@ -176,9 +207,9 @@ o Set the exiv2lib project's Configuration Properties > Librarian > General > Link Library Dependencies to "Yes" - o Copy libexpat.dll from C:\Program Files\Expat 2.0.1\Bin to - UPLOADR\MacUploadr.app\Contents\Resources - o Ignore the rest of the Exiv2 README - - + +Copy libexpat.dll from "C:\Program Files\Expat 2.0.1\Bin" to +"UPLOADR\MacUploadr.app\Contents\Resources". + +Ignore the rest of the Exiv2 README. Mac @@ -192,6 +223,6 @@ $ make && sudo make install -Again because of static linker weirdness, after building Exiv2, run -these commands. +Again because of static linker weirdness, after building Exiv2, move the +dynamic libraries out of the way: $ sudo mv /opt/local/lib/libiconv.dylib /opt/local/lib/libiconv.dylib.sav $ sudo mv /opt/local/lib/libexpat.dylib /opt/local/lib/libexpat.dylib.sav @@ -203,18 +234,19 @@ ------------------------------------------------------------------------ -Checkout FFmpeg like this: +Windows +------- + +FFmpeg will not build in Visual Studio but can be linked by Visual +Studio. This means we need a full MSys environment. My apologies. + +Do all of the MSys/MinGW stuff to get up and running: + http://arrozcru.no-ip.org/ffmpeg_wiki/tiki-index.php + +Additionally add in dependencies like zlib: + http://wiki.videolan.org/Win32CompileMSYS + +Check out and build the magic version of FFmpeg: $ svn co -r 10885 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg $ cd ffmpeg - -Windows -------- - -Do all of the MSys/MinGW stuff to get up and running. - http://arrozcru.no-ip.org/ffmpeg_wiki/tiki-index.php - -Additionally add in dependencies like zlib this way: - http://wiki.videolan.org/Win32CompileMSYS - -Once that's all up and running, time to configure/make/install. $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ --enable-memalign-hack --enable-static --disable-shared \ @@ -228,4 +260,9 @@ --- +Check out the magic version of FFmpeg: + $ svn co -r 10885 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg + $ cd ffmpeg + +Then build: $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ --disable-vhook --disable-mmx --enable-static --disable-shared \ @@ -238,4 +275,8 @@ ------------------------------------------------------------------------ +If you make any changes to the IDL files defining the XPCOM interfaces, +you must increment the BuildID defined in: + UPLOADR/MacUploadr.app/Contents/Resources/application.ini + Windows ------- @@ -244,4 +285,6 @@ UPLOADR/MacUploadr.app/Contents/Resources/components/*.vcproj +The two projects will generate gm.dll and key.dll. + Mac --- @@ -250,72 +293,100 @@ UPLOADR/MacUploadr.app/Contents/Resources/components/ -After rebuilding the XPCOM extensions you must increment the BuildID -defined in: - UPLOADR/MacUploadr.app/Contents/Resources/application.ini - - - -Building Flickr Uploadr ------------------------------------------------------------------------- - -Windows -------- - -On Windows, there is very little left to be done. The root of your -application is actually: - UPLOADR/MacUploadr.app/Contents/Resources/ +Running `make ppc gm ; make ppc key` will build the PPC binaries as +gm.dylib.ppc and key.dylib.ppc. `make mac gm ; make mac key` will +build gm.dylib.mac and key.dylib.mac. These architecture-dependent +files can be combined on an Intel Mac to leave gm.dylib and key.dylib +by running `make universal gm ; make universal key`. + + + +Running Flickr Uploadr +------------------------------------------------------------------------ + +Windows +------- Copy xulrunner-stub.exe from the xulrunner/ directory into the root -of your app, rename it to "Flickr Uploadr.exe" and double-click it -to run Uploadr. - -Mac ---- - -On Mac, the app can be launched by double-clicking on MacUploadr.app -in Finder. - - - -Software Update Service ------------------------------------------------------------------------- - -Windows -------- - -? - -Mac ---- - -Info on how to build MAR files is here: - - http://wiki.mozilla.org/Software_Update:HowToManuallyGenerateMARFiles - -Start with your mozconfig file, XULRunner style: - - http://developer.mozilla.org/en/docs/XULRunner:Build_Instructions - -Then a regular Mozilla build environment, following these: - +of your app, UPLOADR/MacUploadr.app/Contents/Resources/, rename it to +"Flickr Uploadr.exe" and double-click it to run Uploadr. + +You can hack the icons.ico file into the executable using Resource +Hacker: + http://angusj.com/resourcehacker/ + +Create a shortcut to this executable and append the "-console +-jsconsole" parameters to launch Uploadr with both debug windows open. + +Mac +--- + +The app can be launched by double-clicking on MacUploadr.app in Finder. + +Launch Uploadr from Terminal to get debug windows: + $ MacUploadr.app/Contents/MacOS/xulrunner -jsconsole + + + +Packaging +------------------------------------------------------------------------ + +Windows +------- + +Windows installers are created using NSIS, specifically the Unicode +version built from their CVS: + http://forums.winamp.com/showthread.php?threadid=277381 + +Building the NSIS package will likely fail if you do not have Visual +Studio 8 installed. The installer references vcredist_x86.exe. For +controlled experimentation it is OK to omit this installation step by +commenting line 110 in UPLOADR/windows_install_build.nsi. + +One-command builds for all eight languages: + $ make win all + +If you do not want to create update files (see below): + $ make win all-build + +Mac +--- + +One-command builds for all eight languages: + $ make mac all + +If you do not want to create update files (see below): + $ make mac all-build + + + +Software Update +------------------------------------------------------------------------ + +Uploadr phones home to Flickr about once a day to check for updates, +available as MAR files. Details: + http://wiki.mozilla.org/Software_Update + +Actually creating software updates means actually building Mozilla. +This is not for the faint of heart. + +Start by satisfying prerequisites for your platform: + http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites -Altogether, at this point it should look like this: - - ~/.mozconfig: - mk_add_options MOZ_CO_PROJECT=all - ac_add_options --with-macos-sdk=/Developer/SDKs/MacOSX10.4u.sdk - ac_add_options --disable-javaxpcom - ac_add_options --enable-application=xulrunner - - $ cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot co \ - mozilla/client.mk +Configure your build, using the UPLOADR/mozconfig file. Make sure to +comment the Mac-specific line if you're on Windows: + http://developer.mozilla.org/en/docs/Configuring_Build_Options + +Now checkout and build Mozilla: + $ cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot \ + co mozilla/client.mk $ cd mozilla $ make -f client.mk checkout $ make -f client.mk build -There may be an easier way, something like what Songbird does: - - http://publicsvn.songbirdnest.com/browser/trunk/build/mozconfig/ \ - xulrunner.windows.debug.i686.mozconfig - +Once you have your Mozilla tree built, the Packaging section above can +complete properly. Alternatively, if you just want to build the MAR +files: + $ make win all-mar + --OR-- + $ make mac all-mar Index: trunk/uploadr/extensions/helloworld/content/overlay.js =================================================================== --- trunk/uploadr/extensions/helloworld/content/overlay.js (revision 297) +++ trunk/uploadr/extensions/helloworld/content/overlay.js (revision 319) @@ -70,5 +70,5 @@ // After reorder: called after the photo list is reordered for any reason. // Callback argument: boolean, true if the user dragged photos around, -// false if the photos were sorted by date taken +// false if the photos were sorted by date taken // See also: mouse.js, threads.js extension.after_reorder.add(function(from_user) { @@ -94,5 +94,5 @@ // After one upload: called after an individual upload finishes. -// Callback argument: Photo object, success/failure boolean +// Callback arguments: Photo object, success/failure boolean // See also: upload.js extension.after_one_upload.add(function(photo, success) { @@ -110,5 +110,5 @@ // After upload: called after a batch of uploads finishes. // Callback arguments: array of successful Photo objects, array of failed -// Photo objects +// Photo objects // See also: photos.js, upload.js extension.after_upload.add(function(photo_ids, failed) { Index: trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile =================================================================== --- trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile (revision 275) +++ trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile (revision 319) @@ -37,5 +37,5 @@ @echo " mac (Intel)" @echo " ppc" - @echo " linux" + @echo " linux - not implemented" @echo " universal (combines mac and ppc dylibs using lipo)" @echo "Components:"