All 2 entries tagged Handbrake

No other Warwick Blogs use the tag Handbrake on entries | View entries tagged Handbrake at Technorati | There are no images tagged Handbrake on this blog

January 03, 2013

Handbrake on SLED 11 SP2 revisited

Follow-up to Handbrake on SLED 11 SP2 from Mike's blag

I decided to figure out what needed to be done to build the currently current version of Handbrake, 0.9.8, on SLED 11 SP2.

If you don't already have it, get the SLE-SDK from http://download.novell.com/Download?buildid=NgW3ToaagDQ~ and use YaST to add it as an Add on Product.

Install these packages: doxygen yasm patch autoconf automake libbz2-devel libwebkit-devel libnotify-devel libgudev-1_0-devel gstreamer-0_10-plugins-base-devel dbus-1-glib-devel libtool gcc gcc-c++ intltool gtk2-devel glib2-devel zlib-devel libogg-devel

Then run the following commands. hbinstdir is where Handbrake gets installed to, change the value if you want. You can omit the lines relating to libdvdcss if you already have that installed somewhere Handbrake will find it, or if you don't want to be able to rip any DVDs that use CSS.

$ hbinstdir=/local/myapps/handbrake/
$ mkdir handbrakebuild
$ cd handbrakebuild
$ curl http://ftp.gnu.org/gnu/automake/automake-1.12.tar.gz | tar xvfz -
$ cd automake-1.12/
$ ./configure --prefix="${hbinstdir}" && make && make install
$ cd "${hbinstdir}"share/aclocal
$ for i in /usr/share/aclocal/*;do ln -s $i;done
$ cd -
$ cd ..
$ curl http://fribidi.org/download/fribidi-0.19.5.tar.bz2 | tar xvfj -
$ cd fribidi-0.19.5/
$ ./configure --prefix="${hbinstdir}" && make && make install
$ cd ..
$ curl http://download.videolan.org/pub/libdvdcss/1.2.12/libdvdcss-1.2.12.tar.bz2 | tar xvfj -
$ cd libdvdcss-1.2.12/
$ ./configure --prefix="${hbinstdir}" && make && make install
$ cd ..
$ export PATH="${hbinstdir}bin:${PATH}"
$ export FRIBIDI_LIBS="-L${hbinstdir}lib/ -lfribidi"
$ export FRIBIDI_CFLAGS="-I${hbinstdir}include/"
$ export LDFLAGS="-L${hbinstdir}lib/ -lfribidi"
$ curl -L "http://downloads.sourceforge.net/project/handbrake/0.9.8/HandBrake-0.9.8.tar.bz2?r=http%3A%2F%2Fhandbrake.fr%2Fdownloads.php&ts=1356991772&use_mirror=garr" | tar xvfj -
$ cd HandBrake-0.9.8
$ sed -i 's/autoreconf -I m4 -fiv/sh autogen.sh/' contrib/libvorbis/module.defs
$ ./configure --prefix="${hbinstdir}" --launch --launch-jobs=0 --verbose

Assuming the build process finishes without errors then install

$ cd build && make install

The binaries have been compiled against fribidi-0.19.5 but they're dynamically linked. So if you have the version of fribidi that's included with SLED installed the binaries will find and use that by default. If you don't have fribidi installed, they'll be looking for something that doesn't exist. So to make the binaries look at the right version of fribidi they need to be run in a wrapper

$ cd "${hbinstdir}/bin"
$ mv ghb ghb.real
$ mv HandBrakeCLI HandBrakeCLI.real
$ cat > ghb << EOF
#!/bin/bash
dir="\$(dirname "\$( cd "\$( dirname "\$0" )" && pwd )")"
PATH="\${dir}/bin:\${PATH}"
LD_LIBRARY_PATH="\${dir}/lib"
ghb.real
EOF
$ chmod u+x ghb
$ cat > HandBrakeCLI << EOF
#!/bin/bash
dir="\$(dirname "\$( cd "\$( dirname "\$0" )" && pwd )")"
PATH="\${dir}/bin:\${PATH}"
LD_LIBRARY_PATH="\${dir}/lib"
HandBrakeCLI.real
EOF
$ chmod u+x HandBrakeCLI

Run Handbrake with

$ /replace_with_whatever_you_set_hbinstdir_to/bin/ghb

The tweak to libvorbis/module.defs comes from http://benjisimon.blogspot.co.uk/2012/04/gotcha-of-day-building-handbrake-on.html

Initially I used LIBRARY_PATH=${hbinstdir}lib/ instead of LDFLAGS but system locations are searched before anything specified in LIBRARY_PATH and if you have fribidi-devel installed that's found first and the Handbrake build fails.

I also initially used export PKG_CONFIG_PATH="${hbinstdir}/lib/pkgconfig/" instead of FRIBIDI_CFLAGS and FRIBIDI_LIBS but the Handbrake build process was still finding the system version. I eventually realised the Handbrake build process sets it's own value for PKG_CONFIG_PATH which overwrites anything you've set.



April 10, 2012

Handbrake on SLED 11 SP2

The recently released Handbrake 0.9.6 doesn't build on SLED 11 SP2, which is a shame. It's probably possible to make it build if you have more patience and knowledge of such things than I have, but 0.9.5 builds fine.

Get HandBrake-0.9.5.tar.bz2 from http://sourceforge.net/projects/handbrake/files/0.9.5/

If you don't already have it, get the SLE-SDK from http://download.novell.com/Download?buildid=NgW3ToaagDQ~ and use YaST to add it as an Add on Product.

Become root and install the packages you need

$ zypper in -y -l yasm patch autoconf automake libbz2-devel libwebkit-devel libnotify-devel libgudev-1_0-devel fribidi-devel  gstreamer-0_10-plugins-base-devel dbus-1-glib-devel libtool gcc gcc-c++ intltool gtk2-devel glib2-devel zlib-devel

Then as your your regular usercode you can do

$ cd /tmp
$ tar xf ~/HandBrake-0.9.5.tar.bz2
$ cd HandBrake-0.9.5
$ ./configure --prefix=/local/handbrake --launch --launch-jobs=0 && cd build && make install

--launch-jobs=0 causes the build process to make use of however many cores/cpus your machine has. On a machine with an Intel Core i7-2600 @ 3.40GHz it took under two minutes. Assuming all goes well, run it with

$ /local/handbrake/bin/ghb

Search this blog

Tags

RSS2.0 Atom
Not signed in
Sign in

Powered by BlogBuilder
© MMXXIV