Changeset 319

Show
Ignore:
Timestamp:
04/01/08 23:43:23 (2 years ago)
Author:
rcrowley
Message:

Documentation\!

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/uploadr/MacUploadr.app/Contents/Resources/components/Makefile

    r275 r319  
    3737        @echo "  mac (Intel)" 
    3838        @echo "  ppc" 
    39         @echo "  linux
     39        @echo "  linux - not implemented
    4040        @echo "  universal (combines mac and ppc dylibs using lipo)" 
    4141        @echo "Components:" 
  • trunk/uploadr/README

    r303 r319  
    1212------------------------------------------------------------------------ 
    1313 
    14 Download the Flickr Uploadr source archive from: 
     14This guide uses UPLOADR to indicate the root of the Flickr Uploadr 
     15source tree on your filesystem.  It probably shouldn't contain spaces 
     16(C:\Documents and Settings\you\My Documents\Flickr Uploadr is probably 
     17a bad idea). 
     18 
     19You can obtain the Flickr Uploadr source code from either a tarball or 
     20from Subversion. 
     21 
     22Download tarball: 
    1523  http://flickr.com/tools/uploadr/ 
    1624 
    17 XULRunner trunk builds can be found at: 
     25Checkout from Subversion: 
     26  $ svn co http://code.flickr.com/svn/trunk/uploadr UPLOADR 
     27 
     28XULRunner trunk builds: 
    1829  ftp://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/latest-trunk/ 
    1930 
    20 If you are on Windows, download a version of XULRunner trunk and unzip 
    21 it into: 
     31Windows 
     32------- 
     33 
     34Download a version of XULRunner trunk and unzip it into: 
    2235  UPLOADR/MacUploadr.app/Contents/Resources/ 
    2336 
    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): 
     37Under Windows, you'll also need bits from Mozilla's Wintools: 
     38  http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip 
     39 
     40Extract that and copy glib-1.2.dll and libIDL-0.6.dll from 
     41wintools/buildtools/windows/bin/x86/ to your gecko-sdk.win/bin/ directory. 
     42 
     43Mac 
     44--- 
     45 
     46Install the Mac version of XULRunner, which will live in 
     47/Library/Frameworks.  Then pull it into your fake Uploadr distribution: 
    2748  $ mkdir UPLOADR/MacUplaodr.app/Contents/Frameworks 
    2849  $ 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 
     52Install MacPorts if you haven't already: 
     53  http://svn.macosforge.org/repository/macports/downloads/MacPorts-1.5.0/ 
     54 
     55TODO: libIDL from MacPorts 
     56 
     57 
     58 
     59Gecko SDK 
     60------------------------------------------------------------------------ 
     61 
     62To build the XPCOM components you will need the Gecko SDK.  For PPC Mac 
     63and Windows: 
    3364  http://developer.mozilla.org/en/docs/Gecko_SDK#Downloading 
    3465 
    35 An Intel Mac version is available here
     66For Intel Mac
    3667  http://www.oxymoronical.com/view/1114 
    3768 
    38 The SDKs should be placed in the following directories
     69Place the SDK(s) appropriately
    3970  UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.mac (Intel Mac) 
    4071  UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.ppc (PPC Mac) 
    4172  UPLOADR/MacUploadr.app/Contents/Resources/gecko-sdk.win (Windows) 
    4273 
    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. 
     74These SDKs are from the Gecko 1.8 series and so are only safe to use 
     75if the XPCOM components use only frozen interfaces.  Fortunately, 
     76Uploadr currently falls into this category. 
    5377 
    5478 
     
    5983You'll need your own API key and secret from Flickr to build Uploadr. 
    6084These 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
     85and secret must be placed in flKey.cpp as indicated
    6286  UPLOADR/MacUploadr.app/Contents/Resources/components/flKey.cpp 
    6387 
     
    6589characters so it is not easily readable from the binary. 
    6690 
     91There are blocks to keep both a Windows and Mac key/secret in the same 
     92source file (you certainly don't have to, though).  This is mainly 
     93important for the official builds. 
     94 
    6795 
    6896 
     
    73101------- 
    74102 
    75 Download GraphicsMagick Windows SOURCE from
     103Download GraphicsMagick Windows SOURCE
    76104  ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/windows/ 
    77105 
    78106Go to the VisualMagick/configure directory of the GraphicsMagick Windows 
    79 source directory.  Edit the project configuration as follows
     107source directory.  Edit the project configuration
    80108  o Set the active configuration to "Release" 
    81109  o Change the Use of MFC under Configuration Properties > General to 
     
    89117 
    90118Open the solution and let Visual Studio 8 have its way with the Visual 
    91 Studio 7 solution file.  Make the following changes
     119Studio 7 solution file.  Edit the project configuration
    92120  o Change the Runtime Library for the CORE_Magick++ project under 
    93121    Configuration Properties > C/C++ > Code Generation to 
     
    100128extraneous.  In 1.1.7, the errors that will likely show up in a 
    101129try/catch block can be fixed by changing "exception" to "std::exception" 
    102 and adding "&" to make all of the catches happen by reference. 
     130and adding "&" to make all of the catches happen by reference.  The 
     131official builds are build with 1.1.10 and will soon move to 1.1.11. 
    103132 
    104133Add the path to your GraphicsMagick build's VisualMagick\lib directory 
     
    106135include path. 
    107136 
    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: 
     137The magic.mgk, modules.mgk and delegates.mgk files must be in the root of 
     138the application (next to application.ini).  These files are included in 
     139the tarball and Subversion checkouts, so you shouldn't have to worry. 
     140 
     141Mac 
     142--- 
     143 
     144Install prerequisites with MacPorts: 
    118145  $ sudo port install jpeg configure.flags=-O3 
    119146  $ sudo port install tiff configure.flags=-O3 
    120147  $ sudo port install libpng 
    121   $ sudo port install libidl 
    122  
    123 Download GraphicsMagick from
     148  $ sudo port install libidl # TODO: Move north? 
     149 
     150Download GraphicsMagick source
    124151  ftp://ftp.graphicsmagick.org/pub/GraphicsMagick/ 
    125152 
    126 Configure and install GraphicsMagick like this
     153Configure and install GraphicsMagick
    127154  $ ./configure \ 
    128155    CFLAGS="-O3" \ 
     
    138165 
    139166Because of dynamic/static linker weirdness, after building GraphicsMagick, 
    140 move libjpeg.dylib, libtiff.dylib and libpng.dylib out of the way like this
     167move libjpeg.dylib, libtiff.dylib and libpng.dylib out of the way
    141168  $ sudo mv /opt/local/lib/libjpeg.dylib /opt/local/lib/libjpeg.dylib.sav 
    142169  $ sudo mv /opt/local/lib/libtiff.dylib /opt/local/lib/libtiff.dylib.sav 
     
    144171 
    145172For Mac, the magic.mgk, modules.mgk and delegates.mgk files must be in 
    146 Contents/lib/GraphicsMagick-<version>/config/. 
     173Contents/lib/GraphicsMagick-<version>/config/.  Like on Windows, these 
     174are included in the tarball/Subversion trees. 
    147175 
    148176 
     
    157185------- 
    158186 
    159 Just like GraphicsMagick, let Visual Studio 8 eat the 7.1 project files 
    160 and then make the following changes: 
     187Download and install Expat for Windows: 
     188  http://sourceforge.net/project/showfiles.php?group_id=10127 
     189 
     190Just like GraphicsMagick, let Visual Studio 8 eat the 7.1 project files. 
     191Edit the project configuration: 
    161192  o Disable every project in the Exiv2 solution except exiv2lib and xmpsdk 
    162193  o Change the Runtime Library for remaining projects under 
     
    176207  o Set the exiv2lib project's Configuration Properties > Librarian > 
    177208    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 
     210Copy libexpat.dll from "C:\Program Files\Expat 2.0.1\Bin" to 
     211"UPLOADR\MacUploadr.app\Contents\Resources". 
     212 
     213Ignore the rest of the Exiv2 README. 
    183214 
    184215Mac 
     
    192223  $ make && sudo make install 
    193224 
    194 Again because of static linker weirdness, after building Exiv2, run 
    195 these commands. 
     225Again because of static linker weirdness, after building Exiv2, move the 
     226dynamic libraries out of the way: 
    196227  $ sudo mv /opt/local/lib/libiconv.dylib /opt/local/lib/libiconv.dylib.sav 
    197228  $ sudo mv /opt/local/lib/libexpat.dylib /opt/local/lib/libexpat.dylib.sav 
     
    203234------------------------------------------------------------------------ 
    204235 
    205 Checkout FFmpeg like this: 
     236Windows 
     237------- 
     238 
     239FFmpeg will not build in Visual Studio but can be linked by Visual 
     240Studio.  This means we need a full MSys environment.  My apologies. 
     241 
     242Do all of the MSys/MinGW stuff to get up and running: 
     243  http://arrozcru.no-ip.org/ffmpeg_wiki/tiki-index.php 
     244 
     245Additionally add in dependencies like zlib: 
     246  http://wiki.videolan.org/Win32CompileMSYS 
     247 
     248Check out and build the magic version of FFmpeg: 
    206249  $ svn co -r 10885 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg 
    207250  $ cd ffmpeg 
    208  
    209 Windows 
    210 ------- 
    211  
    212 Do all of the MSys/MinGW stuff to get up and running. 
    213   http://arrozcru.no-ip.org/ffmpeg_wiki/tiki-index.php 
    214  
    215 Additionally add in dependencies like zlib this way: 
    216   http://wiki.videolan.org/Win32CompileMSYS 
    217  
    218 Once that's all up and running, time to configure/make/install. 
    219251  $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 
    220252    --enable-memalign-hack --enable-static --disable-shared \ 
     
    228260--- 
    229261 
     262Check out the magic version of FFmpeg: 
     263  $ svn co -r 10885 svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg 
     264  $ cd ffmpeg 
     265 
     266Then build: 
    230267  $ ./configure --disable-ffserver --disable-ffplay --enable-gpl \ 
    231268    --disable-vhook --disable-mmx --enable-static --disable-shared \ 
     
    238275------------------------------------------------------------------------ 
    239276 
     277If you make any changes to the IDL files defining the XPCOM interfaces, 
     278you must increment the BuildID defined in: 
     279  UPLOADR/MacUploadr.app/Contents/Resources/application.ini 
     280 
    240281Windows 
    241282------- 
     
    244285  UPLOADR/MacUploadr.app/Contents/Resources/components/*.vcproj 
    245286 
     287The two projects will generate gm.dll and key.dll. 
     288 
    246289Mac 
    247290--- 
     
    250293  UPLOADR/MacUploadr.app/Contents/Resources/components/ 
    251294 
    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/ 
     295Running `make ppc gm ; make ppc key` will build the PPC binaries as 
     296gm.dylib.ppc and key.dylib.ppc.  `make mac gm ; make mac key` will 
     297build gm.dylib.mac and key.dylib.mac.  These architecture-dependent 
     298files can be combined on an Intel Mac to leave gm.dylib and key.dylib 
     299by running `make universal gm ; make universal key`. 
     300 
     301 
     302 
     303Running Flickr Uploadr 
     304------------------------------------------------------------------------ 
     305 
     306Windows 
     307------- 
    267308 
    268309Copy 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  
     310of your app, UPLOADR/MacUploadr.app/Contents/Resources/, rename it to 
     311"Flickr Uploadr.exe" and double-click it to run Uploadr. 
     312 
     313You can hack the icons.ico file into the executable using Resource 
     314Hacker: 
     315  http://angusj.com/resourcehacker/ 
     316 
     317Create a shortcut to this executable and append the "-console 
     318-jsconsole" parameters to launch Uploadr with both debug windows open. 
     319 
     320Mac 
     321--- 
     322 
     323The app can be launched by double-clicking on MacUploadr.app in Finder. 
     324 
     325Launch Uploadr from Terminal to get debug windows: 
     326  $ MacUploadr.app/Contents/MacOS/xulrunner -jsconsole 
     327 
     328 
     329 
     330Packaging 
     331------------------------------------------------------------------------ 
     332 
     333Windows 
     334------- 
     335 
     336Windows installers are created using NSIS, specifically the Unicode 
     337version built from their CVS: 
     338  http://forums.winamp.com/showthread.php?threadid=277381 
     339 
     340Building the NSIS package will likely fail if you do not have Visual 
     341Studio 8 installed.  The installer references vcredist_x86.exe.  For 
     342controlled experimentation it is OK to omit this installation step by 
     343commenting line 110 in UPLOADR/windows_install_build.nsi. 
     344 
     345One-command builds for all eight languages: 
     346  $ make win all 
     347 
     348If you do not want to create update files (see below): 
     349  $ make win all-build 
     350 
     351Mac 
     352--- 
     353 
     354One-command builds for all eight languages: 
     355  $ make mac all 
     356 
     357If you do not want to create update files (see below): 
     358  $ make mac all-build 
     359 
     360 
     361 
     362Software Update 
     363------------------------------------------------------------------------ 
     364 
     365Uploadr phones home to Flickr about once a day to check for updates, 
     366available as MAR files.  Details: 
     367  http://wiki.mozilla.org/Software_Update 
     368 
     369Actually creating software updates means actually building Mozilla. 
     370This is not for the faint of heart. 
     371 
     372Start by satisfying prerequisites for your platform: 
     373  http://developer.mozilla.org/en/docs/Windows_Build_Prerequisites 
    301374  http://developer.mozilla.org/en/docs/Mac_OS_X_Build_Prerequisites 
    302375 
    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 
     376Configure your build, using the UPLOADR/mozconfig file.  Make sure to 
     377comment the Mac-specific line if you're on Windows: 
     378  http://developer.mozilla.org/en/docs/Configuring_Build_Options 
     379 
     380Now checkout and build Mozilla: 
     381  $ cvs -d :pserver:anonymous:anonymous@cvs-mirror.mozilla.org:/cvsroot \ 
     382    co mozilla/client.mk 
    313383  $ cd mozilla 
    314384  $ make -f client.mk checkout 
    315385  $ make -f client.mk build 
    316386 
    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  
     387Once you have your Mozilla tree built, the Packaging section above can 
     388complete properly.  Alternatively, if you just want to build the MAR 
     389files: 
     390  $ make win all-mar 
     391  --OR-- 
     392  $ make mac all-mar 
  • trunk/uploadr/extensions/helloworld/content/overlay.js

    r297 r319  
    7070// After reorder: called after the photo list is reordered for any reason. 
    7171//   Callback argument: boolean, true if the user dragged photos around, 
    72 //   false if the photos were sorted by date taken 
     72//     false if the photos were sorted by date taken 
    7373//   See also: mouse.js, threads.js 
    7474extension.after_reorder.add(function(from_user) { 
     
    9494 
    9595// After one upload: called after an individual upload finishes. 
    96 //   Callback argument: Photo object, success/failure boolean 
     96//   Callback arguments: Photo object, success/failure boolean 
    9797//   See also: upload.js 
    9898extension.after_one_upload.add(function(photo, success) { 
     
    110110// After upload: called after a batch of uploads finishes. 
    111111//   Callback arguments: array of successful Photo objects, array of failed 
    112 //   Photo objects 
     112//     Photo objects 
    113113//   See also: photos.js, upload.js 
    114114extension.after_upload.add(function(photo_ids, failed) {