1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 PYTHON_COMPAT=(python{2_7,3_4,3_5})
7 inherit bash-completion-r1 distutils-r1 eutils
9 DESCRIPTION="Download videos from YouTube.com (and more sites...)"
10 HOMEPAGE="https://rg3.github.com/youtube-dl/"
11 SRC_URI="http://youtube-dl.org/downloads/${PV}/${P}.tar.gz"
13 LICENSE="public-domain"
15 KEYWORDS="amd64 ~arm hppa ppc ppc64 x86 ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
16 IUSE="+offensive test"
19 dev-python/setuptools[${PYTHON_USEDEP}]
23 test? ( dev-python/nose[coverage(+)] )
28 python_prepare_all() {
29 if ! use offensive; then
30 sed -i -e "/__version__/s|'$|-gentoo_no_offensive_sites'|g" \
31 youtube_dl/version.py || die
32 # these have single line import statements
34 alphaporno anysex behindkink camwithher chaturbate eporner
35 eroprofile extremetube fourtube foxgay goshgay hellporno
36 hentaistigma hornbunny keezmovies lovehomeporn mofosex motherless
37 myvidster porn91 pornflip porncom pornhd pornotube pornovoisines
38 pornoxo ruleporn sexu slutload spankbang spankwire sunporno thisav
39 tube8 vporn watchindianporn xbef xnxx xtube xvideos xxxymovies
42 # these have multi-line import statements
44 drtuber pornhub redtube xhamster tnaflix
46 # do single line imports
48 -e $( printf '/%s/d;' ${xxx[@]} ) \
49 youtube_dl/extractor/extractors.py \
52 # do multiple line imports
54 -e $( printf '/%s/,/)/d;' ${mxxx[@]} ) \
55 youtube_dl/extractor/extractors.py \
59 -e $( printf '/%s/d;' ${mxxx[@]} ) \
60 youtube_dl/extractor/generic.py \
64 $( printf 'youtube_dl/extractor/%s.py ' ${xxx[@]} ) \
65 $( printf 'youtube_dl/extractor/%s.py ' ${mxxx[@]} ) \
66 test/test_age_restriction.py \
72 distutils-r1_python_prepare_all
76 distutils-r1_src_compile
83 python_install_all() {
87 newbashcomp ${PN}.bash-completion ${PN}
89 insinto /usr/share/zsh/site-functions
90 newins youtube-dl.zsh _youtube-dl
92 insinto /usr/share/fish/completions
95 distutils-r1_python_install_all
97 rm -r "${ED}"/usr/etc || die