Wednesday, March 4, 2009

New Directions for Building HandBrake SVN

Update (5/15/09): I have working binaries available in my PPA repository. Directions for adding it to your package manager are available here.

A couple of months ago, the HandBrake devs implemented some major changes to the build procedure for HandBrake from the project's SVN repository. I'm not really sure why they did this, but it seems to have cut a couple of dependencies, which is nice*. Here's the new method that worked for me on Ubuntu 8.10 Intrepid Ibex and 9.04 Jaunty Jackalope (adapted from their build instructions in the readme).

Step 1: download the dependencies
In a terminal, type:
sudo aptitude install subversion build-essential m4 wget autotools-dev yasm autoconf intltool libtool libbz2-dev zlib1g-dev libglib2.0-dev libdbus-glib-1-dev libgtk2.0-dev libhal-dev libhal-storage-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev automake1.9 libnotify-dev libwebkit-dev
Update (6/18/09): as of svn 2550, libgtkhtml-3.14-dev was replaced by libwebkit-dev.
Users of OpenSuSE may need to download the additional dependencies zypper and in to build the CLI, as well as gtkhml2 and gtkhtml2-devel to build the GUI. Users of Red Hat/Fedora or derivatives may need to install the package groups "Development Tools," "Development Libraries," "X Software Development," and "GNOME Software Development," as well as zlib-devel, bzip2-devel, dbus-glib-devel, hal-devel, gtkhtml3-devel, gstreamer-devel, and gstreamer-plugins-base-devel.

Step 2: download the source from HandBrake's SVN repository
in a terminal, type:
svn checkout svn://svn.handbrake.fr/HandBrake/trunk hb-trunk
This will download a bunch of stuff and finish by telling you which revision you have checked out.

Step 3: switch to your newly created directory
in a terminal, type:
cd hb-trunk
Step 4: prepare the source for building
in a terminal, type:
./configure --launch
This command should take care of most of the remaining steps, i.e. making a scratch directory and compiling the source for both the CLI and GUI interfaces.

Step 5: install the GTK GUI
in a terminal, type:
cd build/gtk ; sudo make install
In you experienced any errors during Steps 4 or 5, you can attempt to run through the build functions manually:
In a terminal, type:
rm -rf build ; mkdir build ; cd build
then:
../configure ; make
and finally:
cd gtk ; make ; sudo make install


*Interestingly, the build process no longer invokes/requires jam, which had always been a vestigial requirement left over from HandBrake's roots in the venerable BeOS.

6 comments:

Unknown said...

Thanks for your help.

Anonymous said...

Great directions for compiling up the latest unstable version. Thanks for taking the time to write this. According to the handbrake wiki (http://trac.handbrake.fr/wiki/CompileGuide) one can use the following to bring down the stable code via svn:

svn://svn.handbrake.fr/HandBrake/tags/0.9.3

When I do that using your guide, I get build errors. I was wondering if you know how one can compile the stable version and if you'd be kind enough to post the steps to do so. I'd use the deb, but I'm under Arch LINUX and there isn't a package for HB 0.9.3 stable.

Thank you!

Hunter K. said...

@Cesar
My pleasure. Let me know if you have any questions or run into any issues with the program.

@Anonymous
Yes, the stable code still uses the older build procedure and dependencies, which are covered in this post: http://filthypants.blogspot.com/2008/09/how-to-compile-handbrake-gtk-gui-from.html

Just replace the svn address in that post with the one you mentioned in your comment and you should be all set. Let me know if you run into any issues and I'll do what I can to help.

Pob said...

Thanks for your instructions,I have run into some issues however, this may just be me being a noob to compiling source but after I had run ./configure --launch it completed with what looks like no errors.
Am I missing something as I do not know how to execute the application after this? Should there be a binary installed somewhere or should the handbrake or Handbrake be in my path?

Pob said...

I figured it out using http://trac.handbrake.fr/wiki/CompileOnLinux it turns out the gui binary was created, to quote from the site: Assuming that all goes well, you should now have a HandBrakeCLI binary in the build directory and a ghb binary in the build/gtk/src directory. You can execute it in place or copy it wherever you like.
Indeed I do, thanks for your instructions, I may to move away from acidrip. :)

Hunter K. said...

@Pob
Glad you got it going. Just to add, if you went through the 'make ; make install' step, the program will be installed in your path and can be executed by typing 'ghb' into a terminal.

Analytics Tracking Footer