portage-overlay

personal portage ebuild repository
git clone anongit@rnpnr.xyz:portage-overlay.git
Log | Files | Refs | Feed | README

Commit: 0f59d8543a04a48e724059598f65db1d78ebf7fa
Parent: 0e8a1a308c7c2b3367b2650db8816a2f7e742c41
Author: Randy Palamar
Date:   Sat, 26 Mar 2022 21:08:25 -0600

net-misc/yt-dlp: bring closer to in tree ebuild and fix brotli issue

Diffstat:
Mnet-misc/yt-dlp/yt-dlp-9999.ebuild | 51++++++++++++++++++++-------------------------------
1 file changed, 20 insertions(+), 31 deletions(-)

diff --git a/net-misc/yt-dlp/yt-dlp-9999.ebuild b/net-misc/yt-dlp/yt-dlp-9999.ebuild @@ -1,16 +1,17 @@ -# Copyright 1999-2021 Gentoo Authors +# Copyright 1999-2022 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 +DISTUTILS_USE_PEP517=setuptools PYTHON_COMPAT=( python3_{8..10} ) -inherit distutils-r1 git-r3 readme.gentoo-r1 +inherit distutils-r1 git-r3 optfeature DESCRIPTION="More usable youtube-dl fork" HOMEPAGE="https://github.com/yt-dlp" EGIT_REPO_URI="https://github.com/yt-dlp/yt-dlp.git" -LICENSE="public-domain" +LICENSE="Unlicense" SLOT="0" IUSE="symlink" @@ -19,18 +20,19 @@ RDEPEND=" symlink? ( !net-misc/youtube-dl ) " -distutils_enable_tests nose +distutils_enable_tests pytest -src_prepare() { - distutils-r1_src_prepare -} +python_prepare_all() { + distutils-r1_python_prepare_all -src_compile() { - distutils-r1_src_compile + # adjust requires for pycryptodome and optional dependencies (bug #828466) + sed -ri requirements.txt \ + -e "s/^(pycryptodome)x/\1/" \ + -e "/^(brotli.*|mutagen|websockets)/d" || die } python_test() { - emake offlinetest + epytest -m 'not download' -p no:markdown } python_install_all() { @@ -42,27 +44,14 @@ python_install_all() { } pkg_postinst() { - if ! has_version media-video/ffmpeg; then - elog "${PN} works fine on its own on most sites. However, if you want" - elog "to convert video/audio, you'll need media-video/ffmpeg." - elog "On some sites - most notably YouTube - videos can be retrieved in" - elog "a higher quality format without sound. ${PN} will detect whether" - elog "ffmpeg is present and automatically pick the best option." - fi - if ! has_version media-video/rtmpdump; then - elog - elog "Videos or video formats streamed via RTMP protocol can only be" - elog "downloaded when media-video/rtmpdump is installed." - fi - if ! has_version media-video/mplayer && ! has_version media-video/mpv; then - elog - elog "Downloading MMS and RTSP videos requires either media-video/mplayer" - elog "or media-video/mpv to be installed." - fi - if ! has_version media-video/atomicparsley; then - elog - elog "Install media-video/atomicparsley if you want ${PN} to embed thumbnails" - elog "from the metadata into the resulting MP4/M4A files." + optfeature "various features (merging tracks, streamed content)" media-video/ffmpeg + has_version media-video/atomicparsley || # allow fallback but don't advertise + optfeature "embedding metadata thumbnails in MP4/M4A files" media-libs/mutagen + + if [[ ! ${REPLACING_VERSIONS} ]]; then + elog 'A wrapper using "yt-dlp --compat-options youtube-dl" was installed' + elog 'as "youtube-dl". This is strictly for compatibility and it is' + elog 'recommended to use "yt-dlp" directly, it may be removed in the future.' fi if has_version media-video/mpv && ! use symlink; then elog