dev-util/rust-analyzer: bump version to 20220704
[gentoo-zh.git] / net-misc / youtube-dl / youtube-dl-2021.06.06.ebuild
blob2fa935567594fc94dd90d6209b906c1add7705b5
1 # Copyright 1999-2021 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI=7
6 PYTHON_COMPAT=( python3_{8..10} )
7 inherit bash-completion-r1 distutils-r1 readme.gentoo-r1
9 DESCRIPTION="Download videos from YouTube.com (and more sites...)"
10 HOMEPAGE="https://youtube-dl.org/ https://github.com/ytdl-org/youtube-dl/"
11 SRC_URI="https://youtube-dl.org/downloads/${PV}/${P}.tar.gz"
12 S=${WORKDIR}/${PN}
14 LICENSE="public-domain"
15 KEYWORDS="amd64 arm ~arm64 ~hppa ppc ppc64 ~riscv x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-solaris"
16 SLOT="0"
18 RDEPEND="
19         dev-python/pycryptodome[${PYTHON_USEDEP}]
22 distutils_enable_tests nose
24 src_prepare() {
25         sed -i -e '/flake8/d' Makefile || die
26         distutils-r1_src_prepare
29 python_test() {
30         emake offlinetest
33 python_install_all() {
34         doman youtube-dl.1
36         newbashcomp youtube-dl.bash-completion youtube-dl
38         insinto /usr/share/zsh/site-functions
39         newins youtube-dl.zsh _youtube-dl
41         insinto /usr/share/fish/vendor_completions.d
42         doins youtube-dl.fish
44         distutils-r1_python_install_all
46         rm -r "${ED}"/usr/etc || die
47         rm -r "${ED}"/usr/share/doc/youtube_dl || die
50 pkg_postinst() {
51         if ! has_version media-video/ffmpeg; then
52                 elog "${PN} works fine on its own on most sites. However, if you want"
53                 elog "to convert video/audio, you'll need media-video/ffmpeg."
54                 elog "On some sites - most notably YouTube - videos can be retrieved in"
55                 elog "a higher quality format without sound. ${PN} will detect whether"
56                 elog "ffmpeg is present and automatically pick the best option."
57         fi
58         if ! has_version media-video/rtmpdump; then
59                 elog
60                 elog "Videos or video formats streamed via RTMP protocol can only be"
61                 elog "downloaded when media-video/rtmpdump is installed."
62         fi
63         if ! has_version media-video/mplayer && ! has_version media-video/mpv; then
64                 elog
65                 elog "Downloading MMS and RTSP videos requires either media-video/mplayer"
66                 elog "or media-video/mpv to be installed."
67         fi
68         if ! has_version media-video/atomicparsley; then
69                 elog
70                 elog "Install media-video/atomicparsley if you want ${PN} to embed thumbnails"
71                 elog "from the metadata into the resulting MP4/M4A files."
72         fi