media-video/handbrake: add 1.10.0

Signed-off-by: Alfred Wingate <parona@protonmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/43411
Closes: https://github.com/gentoo/gentoo/pull/43411
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Alfred Wingate
2025-08-11 19:32:59 +03:00
committed by Sam James
parent 01843d06f2
commit eb5cbb256e
3 changed files with 208 additions and 1 deletions

View File

@@ -1,3 +1,4 @@
DIST handbrake-1.10.0.tar.bz2 9452293 BLAKE2B 97ba36d1d8a56c7bb7f30ab83c4307ce1a1cbbed877ea3e16213baa0c080ea0d244f4f4d53ef5c49be066d506c0975c71da9f3068455083b8a02776d6701a902 SHA512 d03f6c60bde5d968c92044fee68afe533ce394eb9952ec330b06f6250197c99bbef46265393aa346816f3b8e816e453472a8ebd116b7c388a12e8b9142029cfc
DIST handbrake-1.9.2.tar.bz2 9431665 BLAKE2B 33591a9b576ba64ca0d8aabe4a14f7ef25b657a1b1553f8ffc18dc7a6a708b0b79443f018f6633c2ec437d25a7b0e4d803c2b46c672d57cb970eab75df48f239 SHA512 3c01b516aa7926c432773f37a311284e215ec6947b74b5c47306c7b3ac5e986e791c4d0adb4f6e614b4bb6bebecb57ac9a59644bdb535d485321e3be65dcc820
DIST handbrake-ffmpeg-7.1.1.tar.bz2 13278839 BLAKE2B dbedc190d1b752f07e0dc30452fe37a02300da75c3269956f09a63ada6f510838b3e6fb12f9882dbac88a82750ef42a16ed34b2214dfbdc56455b17a2cdc63f8 SHA512 db2682bd3f7dbfe4a33a5a7f0803010258d14f92e98ff2a5fdd17197422bc5cbfd992a63b93c9c5fb2b2420371a82e34a16e155f135a2aaf03764ed71adbc16b
DIST handbrake-ffmpeg-7.1.tar.bz2 13260188 BLAKE2B 32466fbefdeb30796a329869bf6fe547a0d3285ae8d9505758e5bff5103f5edf1bebd2dd8595822d0cd25e3754929ed47878ab42c420e248fb2d6ea51747145a SHA512 3f28af9a0c0779b4a7f4e5fbfd94616eb83265856ef060a8bb8afbb9f1b899885a218f15b7ac2c48f724d961dd2742ef6544b237118cb94563ecf49fbd740e3b

View File

@@ -0,0 +1,206 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{11..14} )
inherit edo flag-o-matic multiprocessing python-any-r1 toolchain-funcs xdg
DESCRIPTION="Open-source, GPL-licensed, multiplatform, multithreaded video transcoder"
HOMEPAGE="https://handbrake.fr/ https://github.com/HandBrake/HandBrake"
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 ~arm64 ~x86"
fi
# contrib/<project>/module.defs
declare -A BUNDLED=(
# Heavily patched in an incompatible way.
# Issues related to using system ffmpeg historically.
# See bug #829595 and #922828
[ffmpeg]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/ffmpeg-7.1.1.tar.bz2;"
# Patched in an incompatible way
[x265]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265-snapshot-20250729-13276.tar.gz;x265"
[x265_8bit]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265-snapshot-20250729-13276.tar.gz;x265"
[x265_10bit]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265-snapshot-20250729-13276.tar.gz;x265"
[x265_12bit]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265-snapshot-20250729-13276.tar.gz;x265"
)
bundle_src_uri() {
for name in "${!BUNDLED[@]}"; do
IFS=$';' read -r uri use <<< ${BUNDLED[${name}]}
local tarball=${uri##*/}
if [[ -n ${use} ]]; then
SRC_URI+=" ${use}? ( ${uri} -> handbrake-${tarball} )"
else
SRC_URI+=" ${uri} -> handbrake-${tarball}"
fi
done
}
bundle_src_uri
LICENSE="GPL-2"
SLOT="0"
IUSE="amf +fdk gui libdovi numa nvenc qsv x265"
REQUIRED_USE="numa? ( x265 )"
# >=media-libs/libvpl-1.13.0: bug #957811 (check libhb/qsvcommon.h for new platform codenames)
COMMON_DEPEND="
app-arch/bzip2
>=app-arch/xz-utils-5.2.6
dev-libs/jansson:=
>=media-libs/dav1d-1.0.0:=
>=media-libs/libjpeg-turbo-2.1.4:=
>=media-libs/libass-0.16.0:=
>=media-libs/libbluray-1.3.4:=
media-libs/libdvdnav
>=media-libs/libdvdread-6.1.3:=
media-libs/libtheora:=
media-libs/libvorbis
>=media-libs/libvpx-1.12.0:=
media-libs/opus
>=media-libs/speex-1.2.1
>=media-libs/svt-av1-3.0.0:=
>=media-libs/x264-0.0.20220222:=
>=media-libs/zimg-3.0.4
media-sound/lame
sys-libs/zlib
fdk? ( media-libs/fdk-aac:= )
libdovi? ( media-libs/libdovi:= )
gui? (
>=gui-libs/gtk-4.6:4[gstreamer]
dev-libs/glib:2
>=dev-libs/libxml2-2.10.3:=
x11-libs/gdk-pixbuf:2
x11-libs/pango
)
numa? ( sys-process/numactl )
nvenc? ( media-libs/nv-codec-headers )
qsv? (
media-libs/libva:=
>=media-libs/libvpl-1.13.0:=
)
"
RDEPEND="
${COMMON_DEPEND}
amf? ( media-video/amdgpu-pro-amf )
"
DEPEND="
${COMMON_DEPEND}
amf? ( media-libs/amf-headers )
"
# cmake needed for custom script: bug #852701
BDEPEND="
${PYTHON_DEPS}
dev-build/cmake
dev-lang/nasm
gui? (
dev-build/meson
sys-devel/gettext
)
"
PATCHES=(
"${FILESDIR}"/handbrake-1.9.0-link-libdovi-properly.patch
"${FILESDIR}"/handbrake-1.9.0-include-vpl-properly.patch
"${FILESDIR}"/handbrake-1.9.2-set-ffmpeg-toolchain-explicitly.patch
"${FILESDIR}"/handbrake-1.9.2-allow-overriding-tools-via-env.patch
)
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
else
unpack ${P}.tar.bz2
fi
}
src_prepare() {
default
mkdir download || die
for name in "${!BUNDLED[@]}"; do
IFS=$';' read -r uri use <<< ${BUNDLED[${name}]}
local tarball="${uri##*/}"
if [[ -n ${use} ]]; then
use ${use} || continue
fi
cp "${DISTDIR}/handbrake-${tarball}" download/${tarball} || die
done
# Get rid of leftover bundled library build definitions
sed -i -E \
-e "/MODULES \+= contrib\// { /($(IFS=$'|'; echo "${!BUNDLED[*]}"))$/! d }" \
"${S}"/make/include/main.defs || die
# noop fetching
sed -i -e '/DF..*.exe/ { s/= .*/= true/ }' make/include/tool.defs || die
# Use whichever python is set by portage
sed -i -e "s/for p in .*/for p in ${EPYTHON}/" configure || die
}
src_configure() {
tc-export CC CXX AR RANLIB NM
# noop strip
local -x STRIP="true"
# ODR violations, lto-type-mismatches
# bug #878899
filter-lto
local myconfargs=(
--force
--verbose
--disable-df-fetch
--disable-df-verify
--launch-jobs=$(get_makeopts_jobs)
--prefix="${EPREFIX}/usr"
--disable-flatpak
--no-harden #bug #890279
$(use_enable amf vce)
$(use_enable fdk fdk-aac)
$(use_enable gui gtk)
$(use_enable libdovi)
$(use_enable numa)
$(use_enable nvenc)
$(use_enable x265)
$(use_enable qsv)
)
edo ./configure ${myconfargs[@]}
}
src_compile() {
emake -C build
}
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 gui ; then
einfo "For the GUI version of HandBrake, you can run \`ghb\`."
fi
xdg_pkg_postinst
}

View File

@@ -77,7 +77,7 @@ COMMON_DEPEND="
fdk? ( media-libs/fdk-aac:= )
libdovi? ( media-libs/libdovi:= )
gui? (
>=gui-libs/gtk-4.4:4[gstreamer]
>=gui-libs/gtk-4.6:4[gstreamer]
dev-libs/glib:2
>=dev-libs/libxml2-2.10.3:=
x11-libs/gdk-pixbuf:2