# Copyright 1999-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 PYTHON_COMPAT=( python3_{11..13} ) 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//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.tar.bz2;" # Patched in an incompatible way [x265]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265_4.1.tar.gz;x265" [x265_8bit]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265_4.1.tar.gz;x265" [x265_10bit]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265_4.1.tar.gz;x265" [x265_12bit]="https://github.com/HandBrake/HandBrake-contribs/releases/download/contribs2/x265_4.1.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 )" #