motivation for change is keyring -> secretstorage -> cryptography -> openssl1.1 but unnecessary depends are annoying regardless. --- /usr/portage/net-misc/yt-dlp/yt-dlp-2021.10.22-r2.ebuild 2021-11-06 15:33:13.927131887 -0400 +++ yt-dlp-2021.10.22-r3.ebuild 2021-11-05 11:12:33.997673866 -0400 @@ -4,7 +4,7 @@ EAPI=8 PYTHON_COMPAT=( python3_{8..10} ) -inherit bash-completion-r1 distutils-r1 +inherit bash-completion-r1 distutils-r1 optfeature DESCRIPTION="youtube-dl fork with additional features and fixes" HOMEPAGE="https://github.com/yt-dlp/yt-dlp" @@ -15,11 +15,6 @@ KEYWORDS="~amd64 ~arm64 ~hppa ~riscv ~x86" RDEPEND=" - dev-python/keyring[${PYTHON_USEDEP}] - dev-python/pycryptodome[${PYTHON_USEDEP}] - dev-python/websockets[${PYTHON_USEDEP}] - media-libs/mutagen[${PYTHON_USEDEP}] - media-video/ffmpeg !net-misc/youtube-dl" distutils_enable_tests pytest @@ -55,4 +50,12 @@ 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 + optfeature 'merging seperate video and audio files as well as for various post-processing tasks' media-video/ffmpeg + optfeature 'embedding thumbnail in certain formats' media-libs/mutagen + optfeature 'decrypting AES-128 HLS streams and various other data' dev-python/pycryptodomex + optfeature 'downloading over websocket' dev-python/websockets + optfeature 'decrypting cookies of chromium-based browsers on Linux' dev-python/keyring + optfeature 'embedding thumbnail in mp4/m4a if mutagen is not present' media-video/atomicparsley + optfeature 'downloading rtmp streams. ffmpeg will be used as a fallback' media-video/rtmpdump + optfeature 'downloading rstp streams. ffmpeg will be used as a fallback' media-video/mplayer media-video/mpv } descriptions from https://github.com/yt-dlp/yt-dlp.
youtube-dl ebuild has more thorough descriptions. imo forcing ffmpeg is arguably defensible but e.g. keyring is not, considering that 99.9% of users will never use that functionality.
The deps were added to actually have feature completed yt-dlp. I do not think this is such a big problem to have them around. Mutagen and ffmpeg are core features for me, they're used when you fetch formats like bestvideo+bestaudio, which wouldn't work by default unless you have ffmpeg, that could be otherwise depcleaned. I lean towars keeping it as is.
Note that there is also a hidden optional dependency on dev-lang/python[sqlite] (see https://github.com/yt-dlp/yt-dlp/issues/544). IMO, we should at least be able to opt out those optional deps by means of USE flags.
The USE flags are not allowed for RDEPENDS. It all resolves around what is better, run into situation where some of features are not working after package is installed, like some formats cannot be downloaded, or metadata embedded, or just unconditionally install them to ensure *all* the features do work. Whatever dependency is optional or not is very academic discussion, and arguably you could chop out a lot of RDEPENDS from many other projects, while compromising some features, as long as you won't run certain switches, everything works. What I challenge here is how much would that *really* benefit users, is it really common that people find ffmpeg as a bloat and not needed, and we should prioritize them, or we should other people fail in their workflow because although they installed yt-dlp and executed it like in docs, it does not work, because some deps are arguably optional. I do think that majority of users would benefit from having them unconditionally installed, which also includes USE=sqlite on python, and the few people who for whatever reason sees it as unfit to have ffmpeg or python's cryptodome around, those could still use package.provided to make sure those are not installed. Keep in mind that there's no rule in Gentoo that every package must be possible to be installed stripped to bare minimum setup, as well as it is advised against having tons of USE flags for tiny things that really does not change much. If there was a dependency on for example dev-python/cryptography which depends on rust, I would be keen to actually drop it as optional, but ffmpeg is not even remotely near as big as rust is.
No particularly strong feeling (was fine keeping as-is), but if someone actually want this I don't mind going with optfeature personally. Makes sense for when thinking about yt-dlp being used on a small headless server or similar that may have very little installed beside what's on a stage3 and without much resources. Pulling ffmpeg and other deps if don't need it is not going to be great even if it's not the biggest thing there is, and package.provided is something I'd rather not consider a "right" solution to offer (it's more of a unsupported bad hack)... my own headless server end up using ffmpeg anyway to make thumbnails though. Most desktop users will have ffmpeg ready either way, so it shouldn't be harmful if not auto-pulled. Having to install mutagen manually to get the feature may be a bit more unfortunate. To reduce optfeature noise, I'd personally skip rtsp/rtmp given ffmpeg is usable as a fallback (mplayer and mpv depend on ffmpeg anyway) -- and not convinced that old stuff like rtmpdump or mplayer is worth mentioning. Still need to look into this closer for impact, what to do with sqlite, and if some are still needed behind "test? ( )" -- further feedback is also welcome meanwhile.
(In reply to Ionen Wolkens from comment #5) > > Most desktop users will have ffmpeg ready either way, so it shouldn't be > harmful if not auto-pulled. Having to install mutagen manually to get the > feature may be a bit more unfortunate. > This is how I feel as well. The current ebuild implemention is taking away the choice from users, and optfeature is definitely better than package.provided for user experience. If we look what other distributions do, https://github.com/archlinux/svntogit-community/blob/packages/yt-dlp/trunk/PKGBUILD https://src.fedoraproject.org/rpms/youtube-dl/blob/rawhide/f/youtube-dl.spec https://build.opensuse.org/package/view_file/openSUSE:Factory/youtube-dl/youtube-dl.spec?expand=1 https://packages.debian.org/bullseye/youtube-dl https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/yt-dlp/default.nix#L11 https://github.com/void-linux/void-packages/blob/master/srcpkgs/yt-dlp/template https://cgit.freebsd.org/ports/tree/www/yt-dlp/Makefile Strict uncontrollable dependencies: Doesn't depend: 7 (Arch, Debian, Fedora, CentOS etc RH based distros, FreeBSD, NixOS, Void) Does depend: 1 (openSUSE) > To reduce optfeature noise, I'd personally skip rtsp/rtmp given ffmpeg is > usable as a fallback (mplayer and mpv depend on ffmpeg anyway) -- and not > convinced that old stuff like rtmpdump or mplayer is worth mentioning. ++ > further feedback is also welcome meanwhile. I'm personally not invested here as I do run yt-dlp on desktop with milliong things pulling ffmpeg, but chiming in to give an extra opinion. Also do consider whether some of the optfeatures can be combined, like the embedded thumbnail thing.
(In reply to Ionen Wolkens from comment #5) > No particularly strong feeling (was fine keeping as-is), but if someone > actually want this I don't mind going with optfeature personally. > > Makes sense for when thinking about yt-dlp being used on a small headless > server or similar that may have very little installed beside what's on a > stage3 and without much resources. Pulling ffmpeg and other deps if don't > need it is not going to be great even if it's not the biggest thing there > is, and package.provided is something I'd rather not consider a "right" > solution to offer (it's more of a unsupported bad hack)... my own headless > server end up using ffmpeg anyway to make thumbnails though. > > Most desktop users will have ffmpeg ready either way, so it shouldn't be > harmful if not auto-pulled. Having to install mutagen manually to get the > feature may be a bit more unfortunate. > > To reduce optfeature noise, I'd personally skip rtsp/rtmp given ffmpeg is > usable as a fallback (mplayer and mpv depend on ffmpeg anyway) -- and not > convinced that old stuff like rtmpdump or mplayer is worth mentioning. > > Still need to look into this closer for impact, what to do with sqlite, and > if some are still needed behind "test? ( )" -- further feedback is also > welcome meanwhile. In this case we could meet in the middle. Make ffmpeg and whatever is on the bigger side into optifeature but keep those small insignificant in terms of build time and size dependencies, like mutagen there unconditionally. Would that solve everyone's concerns?
As mentioned before, also want to keep optfeature to a minimum not to be noisy about features very few people will actually need, so going with: keep: - pycryptodome: cheap and was already a hard dep for youtube-dl (losing the capabilities may be unexpected) optfeature: - ffmpeg - || ( mutagen atomicparsley ): like pycryptodome, /was/ going to do as comment #7 suggested, but seeing how it was a optfeature on youtube-dl plus links from comment #6, for the sake of parity decided to use optfeature -- not fond of how `optfeature ... dep alt-dep` repeats twice while mutagen is favored, so will also handle a bit differently remove entirely: - keyring: too obscure (if really need, should learn about it from yt-dlp messages/documentation instead) - websockets: cheap, but currently I only see one extractor that use it -- perhaps a bit too obscure to pull/suggest for almost nothing (may revisit this) ignore: - mpv/mplayer/rtmpdump - phantomjs: not in ::gentoo, dead upstream - sponskrub: not in ::gentoo, deprecated - sqlite(+): feel messy to check as a optfeature, and don't want to hard depend given the few people that disable this likely won't care to check browser cookies (be different if it still crashed without it) test deps need no changes, currently ran tests only need pycryptodome
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=90e432ac16ad7a9556b884d3c95724ff89ce3642 commit 90e432ac16ad7a9556b884d3c95724ff89ce3642 Author: Ionen Wolkens <ionen@gentoo.org> AuthorDate: 2021-11-09 11:50:51 +0000 Commit: Ionen Wolkens <ionen@gentoo.org> CommitDate: 2021-11-09 12:55:28 +0000 net-misc/yt-dlp: remove some non-essential deps / use optfeature Closes: https://bugs.gentoo.org/822156 Signed-off-by: Ionen Wolkens <ionen@gentoo.org> ...yt-dlp-2021.10.22-r2.ebuild => yt-dlp-2021.10.22-r3.ebuild} | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)