Wednesday, August 08, 2007

Building cross-platform VideoFox (Firefox 3 alpha pre-8 with video patches)

What caused major headaches in the past (especially if you want to do it from the same source tree) has become pretty easy and straight forward these days, at least if you are using a Mac as primary development platform and run Windows and Linux in virtual machines. If you are just curious about the video enabled Firefox, go to Chris Double's testpage and download a binary release for your platform. If your platform is not supported yet, you want to learn the internals of firefox, or build a firefox extension with native components (that's my case, more about it later ...) then the following step-by-step instructions might help:
git clone git://double.co.nz/git/firefox.git make -f client.mk build
  • after some time, and if nothing goes wrong you should have now a firefox binary
  • To build on windows, first share the folder with the cloned git repository in Parallels.
  • Start Windows XP as Parallels VM and install the mozilla build tools
  • Also install the free Microsoft Visual C++IDE and the Microsoft platform SDK
  • Map the shared folder to a network drive (Context menu).
  • Mount in C:\mozilla-build\msys\etc\fstab the network drive
  • Reboot windows to activate the mount point
  • Start the shell:
C:\mozilla-build\start-msvc8
  • Go to your mozilla source directory and run the build command again.
make -f client.mk build
  • Now it takes even longer to build, because of the Parallels VM overhead (vmware fusion might be faster ???)
  • Next comes the Linux build, but I am still waiting at 14) !!
Update:
after about 8 hours the windows build was done (on mac it was just one hour). Unfortunately the Windows XP Firefox crashed when trying to run.

Update II:
The Windows XP build did not crash, it just took extremely long to start, I guess because of the Parallels network drive.

Update III:
Now the Linux build: there are three possibilities to access the source tree from Linux: NFS, Samba and FUSE-based sshfs. Because the first two options require a lot of tricky configuration, I went for the last, below the few steps required (on Ubuntu Feisty):
  • Allow Remote Login on Mac (System Preferences > Sharing)
  • Start Linux VM
  • On Linux, install sshfs:
sudo apt-get install sshfs
  • Add user to fuse group:
sudo adduser your-linux-username fuse
  • Log off and on again to activate the group setting
  • create a directory:
mkdir firefox-source
  • mount the mac filesystem:
sudo sshfs your-mac-username@mac-IP:/Path/to/firefox-source /LinuxPath/to/firefox-source -o allow_other
  • build it again (should be straight forward on Linux, haven't done that yet)
  • To unmount:
sudo fusermount -u /LinuxPath/to/firefox-source