1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=( python3_{1,2,3,4,5,6,7} 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 numa nvenc x265"
28 REQUIRED_USE="^^ ( fdk libav-aac )"
37 >=media-libs/libbluray-1.0
38 >=media-libs/dav1d-0.5.1
40 media-libs/libdvdread:=
41 media-libs/libsamplerate
44 >=media-libs/libvpx-1.8
45 nvenc? ( media-libs/nv-codec-headers )
50 libav? ( >=media-video/libav-12.2:0=[fdk?] )
51 !libav? ( >=media-video/ffmpeg-4.2.1:0=[fdk?] )
53 media-libs/gstreamer:1.0
54 media-libs/gst-plugins-base:1.0
55 media-libs/gst-plugins-good:1.0
56 media-libs/gst-plugins-bad:1.0
57 media-libs/gst-plugins-ugly:1.0
58 media-plugins/gst-plugins-a52dec:1.0
59 media-plugins/gst-plugins-libav:1.0
60 media-plugins/gst-plugins-x264:1.0
61 media-plugins/gst-plugins-gdkpixbuf:1.0
73 fdk? ( media-libs/fdk-aac )
74 x265? ( >=media-libs/x265-3.2:0=[10bit,12bit,numa?] )
84 # Remove libdvdnav duplication and call it on the original instead.
85 # It may work this way; if not, we should try to mimic the duplication.
86 "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch"
88 # Remove faac dependency; TODO: figure out if we need to do this at all.
89 "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch"
92 "${FILESDIR}/${P}-missing-linker-flags.patch"
94 # Use whichever python is set by portage
95 "${FILESDIR}/${P}-dont-search-for-python.patch"
99 # Get rid of leftover bundled library build definitions,
100 sed -i 's:.*\(/contrib\|contrib/\).*::g' \
101 "${S}"/make/include/main.defs \
102 || die "Contrib removal failed."
107 # Don't run autogen.sh.
108 sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed"
113 # Libav was replaced in 1.2 with ffmpeg by default
114 # but I've elected to not make people change their use flags for AAC
115 # as its the same code anyway
119 --prefix="${EPREFIX}/usr" \
120 --disable-gtk-update-checks \
123 $(use_enable libav-aac ffmpeg-aac) \
124 $(use_enable fdk fdk-aac) \
125 $(usex !gtk --disable-gtk) \
126 $(usex !gstreamer --disable-gst) \
128 $(use_enable nvenc) \
129 $(use_enable x265) || die "Configure failed."
135 # TODO: Documentation building is currently broken, try to fix it.
143 emake -C build DESTDIR="${D}" install
145 dodoc README.markdown AUTHORS.markdown NEWS.markdown THANKS.markdown
149 einfo "Gentoo builds of HandBrake are NOT SUPPORTED by upstream as they"
150 einfo "do not use the bundled (and often patched) upstream libraries."
152 einfo "Please do not raise bugs with upstream because of these ebuilds,"
153 einfo "report bugs to Gentoo's bugzilla or Multimedia forum instead."
155 einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`."
157 einfo "For the GTK+ version of HandBrake, you can run \`ghb\`."
160 gnome2_icon_cache_update
161 xdg_desktop_database_update
169 gnome2_icon_cache_update
170 xdg_desktop_database_update