diff options
Diffstat (limited to 'media-video/handbrake')
4 files changed, 197 insertions, 3 deletions
diff --git a/media-video/handbrake/Manifest b/media-video/handbrake/Manifest index 391eb81b7f0b..d04bc9b98829 100644 --- a/media-video/handbrake/Manifest +++ b/media-video/handbrake/Manifest @@ -1,8 +1,10 @@ AUX handbrake-1.3.0-dont-search-for-python.patch 691 BLAKE2B 623654494bf61cedb531df3f9b3e64aa17a2a3d03cf9d71577ba1961961d3d058dfa383ef3bb5215eba8a2c84231531b35f1a331850070ae0bcc5b5fa1586c67 SHA512 044b0cb7d9302f74e1ef92e37162135b8ac76d96bf7d647c269ef19b5cf2a8771ce0cc76cbc8817b2480cc3e40af6bafd717888a3982b3e679d831519aad4e64 +AUX handbrake-1.3.3-libhb-fix-audio-encoders-when-linking-to-FFmpeg-4.4.patch 1016 BLAKE2B ffe0a1dc7d693352010eeeafbc61c9d4df43f148ae2a67449c252d71dfc888589161aa88938ee333d9f082aed6873a2d8f2461c0da14d1af388e311a3f8f6058 SHA512 d6237cf24e97a80a6f407209199af281f31f3b2745051db270f9ff2e887a5da98323c6c48be5d7aa3e59a5da17f2691e503b00137c670a6569baed67d8bd39a0 AUX handbrake-1.3.3-x265-link.patch 277 BLAKE2B 6e5f7d5f59601ebf3c36116f595040d6e884637c8dc9a900774db9db07d1c0686a1b5c2db9276ca1c14612615e3974a7f9b05cb48c23f8f30ed0851238b92c32 SHA512 a74a2d20972a01b89dbfd7b81c070608d57e646de2ce63d9ae2d2e1486d31ca63e96d5ec803052b52e68bee157d5a1882914e0009ae480d1f8192031d79852eb AUX handbrake-9999-remove-dvdnav-dup.patch 809 BLAKE2B 16cde838dcf59753e5438df0d2c2b81f45667058bd0687a7368c528f61bd2a2fedc4462894daad58c3acb5c51bdd53df3b30e28adba93a0fb2838416e4226217 SHA512 e2005155adf29e8253f4313d209b2ccc642fb1d7f63256d3bdf675ddd0e6b0e15bc6bffd98e19aa7dab3907e161e29c5268dc5656590ce9254b12a91ac3ff6b0 AUX handbrake-9999-remove-faac-dependency.patch 3697 BLAKE2B b0f7d0a1c4d464d3287ab233b756f5036d6ffa7e9e59a2f98a8ffb2ae59e46d25e56edb3e5bf9c04a16330f3dc50f4c2426f252b35834b7c9c9e6b4904244368 SHA512 9d070e50a9b7d4b8ac25b7d56bd341aca6dc979ba506c84f4b95109909f70020723915cd120bed24e84a8fc242ee3c3a5775f43a78b7995e53cd499444c9f6dc DIST handbrake-1.3.3.tar.bz2 16804119 BLAKE2B c081029e77911dc722764b0bef04e156694f8da0caaa6aedaae13d5c1045dccfc8292a466a8df323b471ca2a9de821b94740e9826fc9e7a2877b1d59653a728a SHA512 a4cca4e45d39eb3d43441abe832e2b8398694917981fa994075e475b68297cae28039e3c75d06442194262a881b9e416e5ebd73d10f86214b95f54c35fd3088c EBUILD handbrake-1.3.3-r2.ebuild 4175 BLAKE2B 3e70f8e7c14d51b807fecff2d165c49136114379744ab8050c29dfbbdd7ea3cca04bb144e0ede35821d065ae9f5a87777944c6a18e3777560ed3b63a48414a1d SHA512 f740e0f0d564a93810e1c870e8941ab162c5cb41b5b9848bc06563db067d341e677221536c6c3617db6a31dff0c5ad1fed76b148cef2565c4714dccac938212d -EBUILD handbrake-9999.ebuild 4177 BLAKE2B 25cb3cfc7d3ceb109bec0000e28c686774135de354e247c05c065c04da16902f7e7f9865aa857358b6c34dabbc0973081d4c89528c5d4a477182f7ea3692a675 SHA512 7f3d69592b79bfa420f60d692cc6c2e6ed17220fb782a93686ae0d84e3c95f953e3faddf85af2d4f7d204d4ced7d0f9a6c92127a59ddf09ef912a03d720bb82c +EBUILD handbrake-1.3.3-r3.ebuild 4340 BLAKE2B 36a49d49b47572a8b3e19e85f1c03ba6e799fb32d1adc14a771fbe1cc2a88eb7f57d99e48b93df28743e6dcc9c0a7250d9dc74261ccdcc192d212852f66f6b69 SHA512 daaccfe49fdaed9081e4358ec507de703d1b5db020611462595a87f4ab636db3f5a695fb552408431ed2cb009b17101bf486602915e133a9bf2c8853212ec984 +EBUILD handbrake-9999.ebuild 4175 BLAKE2B 3e70f8e7c14d51b807fecff2d165c49136114379744ab8050c29dfbbdd7ea3cca04bb144e0ede35821d065ae9f5a87777944c6a18e3777560ed3b63a48414a1d SHA512 f740e0f0d564a93810e1c870e8941ab162c5cb41b5b9848bc06563db067d341e677221536c6c3617db6a31dff0c5ad1fed76b148cef2565c4714dccac938212d MISC metadata.xml 887 BLAKE2B b1d57d0087bfd584903bfb4866e385ba5ec6802f6122cce50ad16b558df1f07f85f4e1fe61c2247aec2fa982d7093fb2741c9cb9c93f782f1fd99477f08582ae SHA512 f677e455ad104d74a9ae6a35cf76f87bedde7a96f92c34b951bffd0cf0591857dc52ec43d1226de2918363475b94ad2e9a9035d4e274693c73c95aa9b922e2d4 diff --git a/media-video/handbrake/files/handbrake-1.3.3-libhb-fix-audio-encoders-when-linking-to-FFmpeg-4.4.patch b/media-video/handbrake/files/handbrake-1.3.3-libhb-fix-audio-encoders-when-linking-to-FFmpeg-4.4.patch new file mode 100644 index 000000000000..d7cc565377fd --- /dev/null +++ b/media-video/handbrake/files/handbrake-1.3.3-libhb-fix-audio-encoders-when-linking-to-FFmpeg-4.4.patch @@ -0,0 +1,28 @@ +From f28289fb06ab461ea082b4be56d6d1504c0c31c2 Mon Sep 17 00:00:00 2001 +From: Damiano Galassi <damiog@gmail.com> +Date: Sat, 10 Apr 2021 13:18:02 +0200 +Subject: [PATCH] libhb: fix audio encoders when linking to FFmpeg 4.4. + +--- + libhb/encavcodecaudio.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/libhb/encavcodecaudio.c b/libhb/encavcodecaudio.c +index 52fc4565d..e6cf42414 100644 +--- a/libhb/encavcodecaudio.c ++++ b/libhb/encavcodecaudio.c +@@ -410,7 +410,10 @@ static void Encode(hb_work_object_t *w, hb_buffer_list_t *list) + + // Prepare input frame + int out_size; +- AVFrame frame = { .nb_samples = pv->samples_per_frame, }; ++ AVFrame frame = { .nb_samples = pv->samples_per_frame, ++ .format = pv->context->sample_fmt, ++ .channels = pv->context->channels ++ }; + + out_size = av_samples_get_buffer_size(NULL, + pv->context->channels, +-- +2.26.3 + diff --git a/media-video/handbrake/handbrake-1.3.3-r3.ebuild b/media-video/handbrake/handbrake-1.3.3-r3.ebuild new file mode 100644 index 000000000000..a02d836a04b5 --- /dev/null +++ b/media-video/handbrake/handbrake-1.3.3-r3.ebuild @@ -0,0 +1,165 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{7,8,9} ) +inherit autotools gnome2-utils python-any-r1 xdg-utils + +if [[ ${PV} = *9999* ]]; then + EGIT_REPO_URI="https://github.com/HandBrake/HandBrake.git" + inherit git-r3 +else + MY_P="HandBrake-${PV}" + SRC_URI="https://github.com/HandBrake/HandBrake/releases/download/${PV}/${MY_P}-source.tar.bz2 -> ${P}.tar.bz2" + S="${WORKDIR}/${MY_P}" + KEYWORDS="~amd64 ~x86" +fi + +DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder" +HOMEPAGE="http://handbrake.fr/" + +LICENSE="GPL-2" +SLOT="0" +IUSE="+fdk gstreamer gtk libav-aac numa nvenc x265" + +REQUIRED_USE="^^ ( fdk libav-aac )" + +RDEPEND=" + app-arch/xz-utils + media-libs/speex + dev-libs/jansson:= + dev-libs/libxml2 + media-libs/a52dec + media-libs/libass:= + >=media-libs/libbluray-1.0 + >=media-libs/dav1d-0.5.1 + media-libs/libdvdnav + media-libs/libdvdread:= + media-libs/libsamplerate + media-libs/libtheora + media-libs/libvorbis + >=media-libs/libvpx-1.8 + nvenc? ( media-libs/nv-codec-headers ) + media-libs/opus + media-libs/x264:= + media-sound/lame + sys-libs/zlib + >=media-video/ffmpeg-4.2.1:0=[postproc,fdk?] + gstreamer? ( + media-libs/gstreamer:1.0 + media-libs/gst-plugins-base:1.0 + media-libs/gst-plugins-good:1.0 + media-libs/gst-plugins-bad:1.0 + media-libs/gst-plugins-ugly:1.0 + media-plugins/gst-plugins-a52dec:1.0 + media-plugins/gst-plugins-libav:1.0 + media-plugins/gst-plugins-x264:1.0 + media-plugins/gst-plugins-gdkpixbuf:1.0 + ) + gtk? ( + >=x11-libs/gtk+-3.10 + dev-libs/dbus-glib + dev-libs/glib:2 + dev-libs/libgudev:= + x11-libs/cairo + x11-libs/gdk-pixbuf:2 + x11-libs/libnotify + x11-libs/pango + ) + fdk? ( media-libs/fdk-aac ) + x265? ( >=media-libs/x265-3.2:0=[10bit,12bit,numa?] )" + +DEPEND="${RDEPEND} + ${PYTHON_DEPS} + dev-lang/nasm + dev-util/intltool" + +PATCHES=( + # Remove libdvdnav duplication and call it on the original instead. + # It may work this way; if not, we should try to mimic the duplication. + "${FILESDIR}/${PN}-9999-remove-dvdnav-dup.patch" + + # Remove faac dependency; TODO: figure out if we need to do this at all. + "${FILESDIR}/${PN}-9999-remove-faac-dependency.patch" + + # Use whichever python is set by portage + "${FILESDIR}/${PN}-1.3.0-dont-search-for-python.patch" + + # Fix x265 linkage... again again #730034 + "${FILESDIR}/${PN}-1.3.3-x265-link.patch" + + # Fix missing audio stream when using MPEG-4 avformat with ffmpeg-4.4 #791220 + "${FILESDIR}/${PN}-1.3.3-libhb-fix-audio-encoders-when-linking-to-FFmpeg-4.4.patch" +) + +src_prepare() { + # Get rid of leftover bundled library build definitions, + sed -i 's:.*\(/contrib\|contrib/\).*::g' \ + "${S}"/make/include/main.defs \ + || die "Contrib removal failed." + + default + + cd "${S}/gtk" + # Don't run autogen.sh. + sed -i '/autogen.sh/d' module.rules || die "Removing autogen.sh call failed" + eautoreconf +} + +src_configure() { + # Libav was replaced in 1.2 with ffmpeg by default + # but I've elected to not make people change their use flags for AAC + # as its the same code anyway + ./configure \ + --force \ + --verbose \ + --prefix="${EPREFIX}/usr" \ + --disable-gtk-update-checks \ + --disable-flatpak \ + --disable-gtk4 \ + $(use_enable libav-aac ffmpeg-aac) \ + $(use_enable fdk fdk-aac) \ + $(usex !gtk --disable-gtk) \ + $(usex !gstreamer --disable-gst) \ + $(use_enable numa) \ + $(use_enable nvenc) \ + $(use_enable x265) || die "Configure failed." +} + +src_compile() { + emake -C build + + # TODO: Documentation building is currently broken, try to fix it. + # + # if use doc ; then + # emake -C build doc + # fi +} + +src_install() { + emake -C build DESTDIR="${D}" install + + dodoc README.markdown AUTHORS.markdown NEWS.markdown THANKS.markdown +} + +pkg_postinst() { + einfo "Gentoo builds of HandBrake are NOT SUPPORTED by upstream as they" + einfo "do not use the bundled (and often patched) upstream libraries." + einfo "" + einfo "Please do not raise bugs with upstream because of these ebuilds," + einfo "report bugs to Gentoo's bugzilla or Multimedia forum instead." + + einfo "For the CLI version of HandBrake, you can use \`HandBrakeCLI\`." + if use gtk ; then + einfo "For the GTK+ version of HandBrake, you can run \`ghb\`." + fi + + xdg_icon_cache_update + xdg_desktop_database_update +} + +pkg_postrm() { + xdg_icon_cache_update + xdg_desktop_database_update +} diff --git a/media-video/handbrake/handbrake-9999.ebuild b/media-video/handbrake/handbrake-9999.ebuild index f90d1b9f1528..a0fb60145610 100644 --- a/media-video/handbrake/handbrake-9999.ebuild +++ b/media-video/handbrake/handbrake-9999.ebuild @@ -68,8 +68,7 @@ RDEPEND=" x11-libs/pango ) fdk? ( media-libs/fdk-aac ) - x265? ( >=media-libs/x265-3.2:0=[10bit,12bit,numa?] ) - " + x265? ( >=media-libs/x265-3.2:0=[10bit,12bit,numa?] )" DEPEND="${RDEPEND} ${PYTHON_DEPS} |