Skip to main content
Home
badllama.com
  • Search
  • Log In

Install Handbrake on Gentoo

bchavet's picture

Wed, 06/13/2012 - 15:53 by bchavet

"HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows."

Unfortunately, there is no ebuild for it in portage, and building it by hand is kind of a pain. Fortunately, it is easy enough to add a portage overlay to get it installed.

Most of the credit for this needs to go to "newtonian" who posted an initial method at http://forums.gentoo.org/viewtopic-t-868401-start-0.html. There are some modifications needed in order to make it work with a current gentoo install, though.

  1. Create a new portage overlay directory for handbrake
    mkdir -p /usr/local/portage/media-video/handbrake/
  2. If /usr/local/portage is not already part of your overlay path, add it to make.conf
    echo 'PORTDIR_OVERLAY=/usr/local/portage' >> /etc/make.conf
  3. Create a new ebuild file at /usr/local/portage/media-video/handbrake/handbrake-9999.ebuild with the following contents
    # Copyright 1999-2007 Gentoo Foundation
    # Distributed under the terms of the GNU General Public License v2
    # $Header: $
    
    EAPI="2"
    ESVN_REPO_URI="svn://svn.handbrake.fr/HandBrake/trunk"
    
    PYTHON_DEPEND="2"
    
    inherit subversion gnome2-utils python
    
    DESCRIPTION="Open-source DVD to MPEG-4 converter."
    HOMEPAGE="http://handbrake.fr/"
    
    LICENSE="GPL-2"
    SLOT="0"
    KEYWORDS="~x86 ~amd64"
    
    IUSE="css gtk"
    RDEPEND="css? ( media-libs/libdvdcss )
    	     gtk? (	>=x11-libs/gtk+-2.8
         			dev-libs/glib
    	     		dev-libs/dbus-glib
         			x11-libs/libnotify
    	     		media-libs/gstreamer
    		     	media-libs/gst-plugins-base
                            media-plugins/gst-plugins-meta
                            dev-util/intltool
         			>=sys-fs/udev-171-r8
                            net-libs/webkit-gtk:2
    	     )"
    DEPEND="=sys-devel/automake-1.11*
            app-arch/bzip2
            sys-libs/zlib
        	dev-lang/yasm
            dev-libs/fribidi
    	    >=dev-lang/python-2.4.6
    	    || ( >=net-misc/wget-1.11.4 >=net-misc/curl-7.19.4 ) 
    	    $RDEPEND"
    
    src_configure() {
    	./configure $(use_enable gtk) --disable-gtk-update || die "configure failed"
    }
    
    src_compile() {
    	WANT_AUTOMAKE="1.11" make -C build || die "failed compiling ${PN}"
    }
    
    src_install() {
    	WANT_AUTOMAKE="1.11" make -C build DESTDIR="${D}" install || die "failed installing ${PN}"
    }
    
    pkg_setup() {
    	python_set_active_version 2
    	python_pkg_setup
    }
    
    pkg_preinst() {
    	gnome2_icon_savelist
    }
    
    pkg_postinst() {
    	gnome2_icon_cache_update
    }
    
    pkg_postrm() {
    	gnome2_icon_cache_update
    }
  4. Create the ebuild manifest
    cd /usr/local/portage/media-video/handbrake
    ebuild handbrake-9999.ebuild digest
  5. Emerge handbrake
    emerge -av handbrake
Powered by Backdrop CMS