13 June 2008 @ 11:00 am
How I installed Facebook "Open Platform"  
  1. Download from http://developers.facebook.com/fbopen/
  2. Wait for the download to complete.
  3. Wait some more.
  4. Extract the archive. Note the implicit dependency of a unixish system.
  5. Find some PHP code, and SQL dump, and the frighteningly huge (29M) "libfbml.tar.gz"
  6. Read the README
  7. Set up a webserver with PHP, and try running some of the provided code.
  8. Set up a web server with PHP 5
  9. Set up a MySQL instance. No, this code will not work with another database.
  10. Try loading the data.
  11. Edit the data dump to be backwards compatible.
  12. Grep through the provided PHP for any instances of "FBOPEN:SETUP". Follow the instructions at each step, including hard-coding the database IP address and authentication parameters.
  13. Debug authentication issues. Store the password for the fbopen-specific account using OLD_PASSWORD instead of PASSWORD.
  14. At this point, PHP code can run, connect to the database, and fail because functions are missing - presumably these functions are provided by the mysterious libFBML
  15. Extract libfbml.tar.gz. Find another README.
  16. "The libfbml package depends on firefox-2.0.0.4, which itself requires that several open source packages be installed. firefox-2.0.0.4-source.tar.bz2 is included with this release and resides in the dependencies subdirectory. Please note that firefox-2.0.0.4 relies on the below products".
  17. This explains the large download. Take a shot.
  18. Download the dependencies (in each case, get the EXACT version stated in the README):
    • glib-2.14.6
    • pkg-config-0.20
    • atk-1.9.1
    • freetype-2.3.4
    • fontconfig-2.3.97
    • libpng-1.2.25
    • cairo-1.2.6
    • tiff-3.7.4
    • pango-1.18.4
    • gtk+-2.10.13
    • libIDL-0.8.8
    • libXft-2.1.12
    • xproto-7.0.7
    • xrender-0.8.3
  19. build-all.py claims to be a script that will build and install everything. Read the script to see what it will do, because it WILL hork my machine (Advice to anybody reproducing my pain = do this on a readily disposable and replaceable OS install, right?).
  20. Note that each part of the script that requires escalated privileges is wrapped in sudo. Make sure it doesn't do anything malicious or stupid.
  21. With all of the dependency tarballs downloaded into the dependencies folder, launch build-all.py. Each time it fails, take a shot.
  22. Fiddle with PATH and LD_LIBRARY_PATH until the first build works.
  23. Firewall blocks ftp by returning an HTML error page, half the packages were be broken, starting with atk. Redownload from http URLs. Take a shot.
  24. fontconfig uses macros that are not recognized by some versions of gcc. After researching the meaning and intent of these macros, delete them. Since build-all.py has no concept of "continue", comment all successfully installed packages out of the "packages" list.
  25. The build for cairo was unable to find some of the system packages. Manually set the PKG_CONFIG_PATH environment variable.
  26. Start the build again. Watch for 15 minutes. Go home.
  27. The build for xrender cannot find "render" in package-config. Find a "render" development package for your linux system that includes the file render.pc
  28. Now that build-all.py has finished with the dependencies of the big-stupid dependency of libfbml, it will compile Firefox. This will take a while, but eventually fails with references to "XFreePixmap", "Xfree", "XCreatePixmap", etc.
  29. Hack the Firefox Makefiles to correctly load Xrender. Of course, the sed snippet was broken by the MLM, but the intent is decipherable.
  30. Get lunch.
  31. Compilation error in libFBML - the bastards are using goto - and using it wrong!
  32. Refactor the Facebook code to not use goto
  33. Comment out everything in build-all.py that would rebuild firefox or dependencies. Try again.
  34. WTF? "namespace-scope anonymous aggregates must be static". What does that mean? Is that even english?
  35. Make fbjs.h the first include from fbml.cpp. Cross fingers, take a shot, and try again.
  36. "phpize" is missing. Install php-devel for PHP5.
  37. Can't locate object method "path" via package "Autom4te::Request" at /usr/bin/autom4te line 81.
  38. rm -rf ext/autom4te.cache. These geniuses left garbage in the build directory.
  39. Yay! build-all.py finally worked!
  40. restart apache
  41. Crap. Needs still more PHP modules.
  42. Install Apache headers and development tools.
  43. Rebuild PHP5 from source, with all modules.
  44. Rebuild PHP5 from source, with all modules except sqlite.
  45. Recompile libfbml with the new rebuilt PHP
  46. Sacrifice a small animal to the Ogdru Jahad and their 369 incomprehensibly foul children.
  47. Restart apache.
  48. It worked! Have a beer.
 
 
( Read 18 commentsPost a new comment )
Auto-defenestration has never been this fun[info]m00t on June 13th, 2008 11:38 pm (UTC)
/wrists
St. Sean the Amused[info]seanb on June 13th, 2008 11:40 pm (UTC)
Yes, that would have been much faster and less painful. Where's Rippy the Razor when you need him?