Gentoo Archives: gentoo-commits

From: Ionen Wolkens <ionen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-misc/yt-dlp/
Date: Fri, 21 Jan 2022 14:26:59
Message-Id: 1642775018.5a6ba41e610759b368f0298035eec2f762994240.ionen@gentoo
1 commit: 5a6ba41e610759b368f0298035eec2f762994240
2 Author: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jan 21 14:11:32 2022 +0000
4 Commit: Ionen Wolkens <ionen <AT> gentoo <DOT> org>
5 CommitDate: Fri Jan 21 14:23:38 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5a6ba41e
7
8 net-misc/yt-dlp: add 2022.1.21
9
10 Not using PEP517 yet given this will go stable too soon.
11
12 Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>
13
14 net-misc/yt-dlp/Manifest | 1 +
15 net-misc/yt-dlp/yt-dlp-2022.1.21.ebuild | 74 +++++++++++++++++++++++++++++++++
16 2 files changed, 75 insertions(+)
17
18 diff --git a/net-misc/yt-dlp/Manifest b/net-misc/yt-dlp/Manifest
19 index d64743144923..8f71b07b5293 100644
20 --- a/net-misc/yt-dlp/Manifest
21 +++ b/net-misc/yt-dlp/Manifest
22 @@ -1 +1,2 @@
23 DIST yt-dlp-2021.12.27.tar.gz 2102852 BLAKE2B 69a3a9c916771ab2e1b8f86bbc43e03d0543801f587708b638348088d4454aff8ac93420fd8bd2ebb4f493c74acdf23f08a9495dbcdad77d840a95cfece4aa6b SHA512 2c687493736fabe131481d6bf8df13afc1959ac1458675bfe3c4273df7bb64218f84e07ea324b664b0a52c3e39b3e10999e81bc907bfc98a71a28c92dca90737
24 +DIST yt-dlp-2022.1.21.tar.gz 2160713 BLAKE2B 30ed1c7a317318ca6a6ee183ba8e4396420eb090ddacc64ddde2bb4077c7c45b01c00caca90d1b8be501f90c71407e27d6ef847fdbfea8bed488771f9b59bbe1 SHA512 5844d49dbf50842d4d51dbb00c16efea816322888d16a8dbce16f976f0dd1625ec8243fcdc07e721180a2f02cf14ebaa0d83a1437e331b4aa68c404db3f1e9f4
25
26 diff --git a/net-misc/yt-dlp/yt-dlp-2022.1.21.ebuild b/net-misc/yt-dlp/yt-dlp-2022.1.21.ebuild
27 new file mode 100644
28 index 000000000000..57cb468d48c6
29 --- /dev/null
30 +++ b/net-misc/yt-dlp/yt-dlp-2022.1.21.ebuild
31 @@ -0,0 +1,74 @@
32 +# Copyright 1999-2022 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=8
36 +
37 +PYTHON_COMPAT=( python3_{8..10} )
38 +inherit bash-completion-r1 distutils-r1 optfeature
39 +
40 +DESCRIPTION="youtube-dl fork with additional features and fixes"
41 +HOMEPAGE="https://github.com/yt-dlp/yt-dlp"
42 +SRC_URI="mirror://pypi/${P::1}/${PN}/${P}.tar.gz"
43 +
44 +LICENSE="Unlicense"
45 +SLOT="0"
46 +KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~x86"
47 +
48 +RDEPEND="
49 + dev-python/pycryptodome[${PYTHON_USEDEP}]
50 + !net-misc/youtube-dl"
51 +
52 +distutils_enable_tests pytest
53 +
54 +python_prepare_all() {
55 + distutils-r1_python_prepare_all
56 +
57 + # adjust requires for pycryptodome and optional dependencies (bug #828466)
58 + sed -ri setup.py \
59 + -e "s/'(pycryptodome)x'/'\1'/" \
60 + -e "s/'(mutagen|websockets)',?//g" || die
61 +}
62 +
63 +python_test() {
64 + epytest -m 'not download' -p no:markdown
65 +}
66 +
67 +python_install() {
68 + distutils-r1_python_install
69 +
70 + local sitedir=$(python_get_sitedir)
71 + dosym yt_dlp "${sitedir#${EPREFIX}}"/youtube_dl
72 +}
73 +
74 +python_install_all() {
75 + dodoc README.md Changelog.md supportedsites.md
76 + doman yt-dlp.1
77 +
78 + dobashcomp completions/bash/yt-dlp
79 +
80 + insinto /usr/share/fish/vendor_completions.d
81 + doins completions/fish/yt-dlp.fish
82 +
83 + insinto /usr/share/zsh/site-functions
84 + doins completions/zsh/_yt-dlp
85 +
86 + rm -r "${ED}"/usr/share/doc/yt_dlp || die
87 +
88 + newbin - youtube-dl <<-EOF
89 + #!/usr/bin/env sh
90 + exec yt-dlp --compat-options youtube-dl "\${@}"
91 + EOF
92 +}
93 +
94 +pkg_postinst() {
95 + optfeature "various features (merging tracks, streamed content)" media-video/ffmpeg
96 + has_version media-video/atomicparsley || # allow fallback but don't advertise
97 + optfeature "embedding metadata thumbnails in MP4/M4A files" media-libs/mutagen
98 +
99 + if [[ ! ${REPLACING_VERSIONS} ]] ||
100 + ver_test ${REPLACING_VERSIONS} -lt 2021.10.22-r2; then
101 + elog 'A wrapper using "yt-dlp --compat-options youtube-dl" was installed'
102 + elog 'as "youtube-dl". This is strictly for compatibility and it is'
103 + elog 'recommended to use "yt-dlp" directly, it may be removed in the future.'
104 + fi
105 +}