1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python2_7 )
8 inherit autotools eutils gnome2-utils python-any-r1 xdg-utils
10 if [[ ${PV} = *9999* ]]; then
11 EGIT_REPO_URI="https://github.com/HandBrake/HandBrake.git"
15 MY_P="HandBrake-${PV}"
16 SRC_URI="https://download2.handbrake.fr/${PV}/${MY_P}-source.tar.bz2 -> ${P}.tar.bz2"
17 S="${WORKDIR}/${MY_P}"
18 KEYWORDS="~amd64 ~x86"
21 DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder"
22 HOMEPAGE="http://handbrake.fr/"
26 IUSE="+fdk gstreamer gtk libav libav-aac x265"
28 REQUIRED_USE="^^ ( fdk libav-aac )"
34 >=media-libs/libbluray-1.0
37 media-libs/libsamplerate
45 libav? ( >=media-video/libav-12.3:0=[fdk?] )
46 !libav? ( >=media-video/ffmpeg-3.4:0=[fdk?] )
48 media-libs/gstreamer:1.0
49 media-libs/gst-plugins-base:1.0
50 media-libs/gst-plugins-good:1.0
51 media-libs/gst-plugins-bad:1.0
52 media-libs/gst-plugins-ugly:1.0
53 media-plugins/gst-plugins-a52dec:1.0
54 media-plugins/gst-plugins-libav:1.0
55 media-plugins/gst-plugins-x264:1.0
67 fdk? ( media-libs/fdk-aac )
68 x265? ( >=media-libs/x265-1.7:0= )
78 # Remove libdvdnav duplication and call it on the original instead.
79 # It may work this way; if not, we should try to mimic the duplication.
80 "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch"
82 # Remove faac dependency; TODO: figure out if we need to do this at all.
83 "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch"
85 # Fix missing x265 link flag
86 "${FILESDIR}/${PN}-9999-fix-missing-x265-link-flag.patch"
90 python-any-r1_pkg_setup
94 # Get rid of leftover bundled library build definitions,
95 sed -i 's:.*\(/contrib\|contrib/\).*::g' \
96 "${S}"/make/include/main.defs \
97 || die "Contrib removal failed."
101 # Get rid of libav specific code when using ffmpeg
102 use libav || eapply -R "${FILESDIR}/${PN}-1.1.0-nolibav.patch"
105 # Don't run autogen.sh.
106 sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed"
114 --prefix="${EPREFIX}/usr" \
115 --disable-gtk-update-checks \
116 $(use_enable libav-aac) \
117 $(use_enable fdk fdk-aac) \
119 $(usex !gstreamer --disable-gst) \
120 $(use_enable x265) || die "Configure failed."
126 # TODO: Documentation building is currently broken, try to fix it.
134 emake -C build DESTDIR="${D}" install
136 dodoc README.markdown AUTHORS.markdown NEWS.markdown THANKS.markdown
140 einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`."
144 einfo "For the GTK+ version of HandBrake, you can run \`ghb\`."
147 gnome2_icon_cache_update
148 xdg_desktop_database_update
156 gnome2_icon_cache_update
157 xdg_desktop_database_update