commit:     1abecfaed988a2f682794ed9443ecd10b72b101a
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 16 00:34:25 2022 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Wed Feb 16 02:53:42 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1abecfae

net-misc/youtube-dl: adjust and semi-sync ebuild with yt-dlp

* add ewarn that users should consider yt-dlp instead
* use optfeature.eclass, but unlike yt-dlp keep the mention of
  mpv/rtmpdump for now (yt-dlp advertises being able to use
  ffmpeg for streamed content instead)
* public-domain -> Unlicense (uses same as yt-dlp)
* skip duplicate README.txt and install supportedsites.md
* pep517 mode, planned to be used in next yt-dlp release as well
* Add IUSE=+yt-dlp to allow concurrent install with yt-dlp:

yt-dlp provides a compatibility mode for the "youtube-dl" command
to have the same options which should typically work as a drop-in
replacement, but can't do this for the python module. For packages
that haven't migrated to yt-dlp and still depend on youtube-dl,
IUSE=yt-dlp ensures that both the command and python module will
be available while allowing users to pick which command they want
to use (bug #829501).

youtube-dl is likely still due for removal at some point, but
at the moment upstream is still active and maintaining the project
for these packages and there is little reason to rush removal.

ebuilds should preferably depend on yt-dlp if all they need is
the command to ease future removal.

Closes: https://bugs.gentoo.org/829501
Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 net-misc/youtube-dl/metadata.xml                   |  3 +
 .../youtube-dl/youtube-dl-2021.12.17-r1.ebuild     | 66 ++++++++++++++++++++++
 2 files changed, 69 insertions(+)

diff --git a/net-misc/youtube-dl/metadata.xml b/net-misc/youtube-dl/metadata.xml
index 13b9a9abefd2..1597ae3f0442 100644
--- a/net-misc/youtube-dl/metadata.xml
+++ b/net-misc/youtube-dl/metadata.xml
@@ -10,6 +10,9 @@
                <name>Marek Szuba</name>
        </maintainer>
        <stabilize-allarches/>
+       <use>
+               <flag name="yt-dlp">Use <pkg>net-misc/yt-dlp</pkg> to provide 
the command and only install the python module</flag>
+       </use>
        <upstream>
                <remote-id type="github">ytdl-org/youtube-dl</remote-id>
                <remote-id type="pypi">youtube_dl</remote-id>

diff --git a/net-misc/youtube-dl/youtube-dl-2021.12.17-r1.ebuild 
b/net-misc/youtube-dl/youtube-dl-2021.12.17-r1.ebuild
new file mode 100644
index 000000000000..63a072269d22
--- /dev/null
+++ b/net-misc/youtube-dl/youtube-dl-2021.12.17-r1.ebuild
@@ -0,0 +1,66 @@
+# 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 bash-completion-r1 distutils-r1 optfeature
+
+DESCRIPTION="Download videos from YouTube.com (and more sites...)"
+HOMEPAGE="https://youtube-dl.org/";
+SRC_URI="https://youtube-dl.org/downloads/${PV}/${P}.tar.gz";
+S="${WORKDIR}/${PN}"
+
+LICENSE="Unlicense"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux 
~ppc-macos ~x64-macos ~x86-solaris"
+IUSE="+yt-dlp"
+
+RDEPEND="
+       dev-python/pycryptodome[${PYTHON_USEDEP}]
+       yt-dlp? ( >=net-misc/yt-dlp-2022.2.4-r1 )
+       !yt-dlp? ( !net-misc/yt-dlp )"
+
+distutils_enable_tests nose
+
+python_prepare_all() {
+       distutils-r1_python_prepare_all
+
+       sed -i '/flake8/d' Makefile || die
+}
+
+python_test() {
+       emake offlinetest
+}
+
+python_install_all() {
+       dodoc AUTHORS ChangeLog README.md docs/supportedsites.md
+       doman youtube-dl.1
+
+       newbashcomp youtube-dl.bash-completion youtube-dl
+
+       insinto /usr/share/zsh/site-functions
+       newins youtube-dl.zsh _youtube-dl
+
+       insinto /usr/share/fish/vendor_completions.d
+       doins youtube-dl.fish
+
+       rm -r "${ED}"/usr/{etc,share/doc/youtube_dl} || die
+
+       # keep man pages / completions either way given they are useful
+       # for yt-dlp's compatibility wrapper which tries to mimic options
+       use !yt-dlp || rm -r "${ED}"/usr/{lib/python-exec,bin} || die
+}
+
+pkg_postinst() {
+       optfeature "converting and merging tracks on some sites" 
media-video/ffmpeg
+       optfeature "embedding metadata thumbnails in MP4/M4A files" 
media-video/atomicparsley
+       optfeature "downloading videos streamed via RTMP" media-video/rtmpdump
+       optfeature "downloading videos streamed via MMS/RTSP" 
media-video/mplayer media-video/mpv
+
+       ewarn "Note that it is preferable to use net-misc/yt-dlp over 
youtube-dl for"
+       ewarn "latest features and site support. youtube-dl is only kept 
maintained for"
+       ewarn "compatibility with older software (notably its python module, 
yt-dlp has"
+       ewarn "a 'bin/youtube-dl' compatibility wrapper but not for the 
module)."
+}

Reply via email to