youtube-dl-99999999.ebuild 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=(python{2_7,3_4,3_5})
  5. inherit bash-completion-r1 distutils-r1 eutils git-r3
  6. DESCRIPTION="Download videos from YouTube.com (and more sites...)"
  7. HOMEPAGE="https://rg3.github.com/youtube-dl/"
  8. EGIT_REPO_URI="https://github.com/rg3/youtube-dl.git"
  9. LICENSE="public-domain"
  10. SLOT="0"
  11. KEYWORDS=""
  12. IUSE="offensive test"
  13. RDEPEND="
  14. dev-python/setuptools[${PYTHON_USEDEP}]
  15. "
  16. DEPEND="
  17. ${RDEPEND}
  18. dev-python/sphinx[${PYTHON_USEDEP}]
  19. test? ( dev-python/nose[coverage(+)] )
  20. "
  21. python_prepare_all() {
  22. if ! use offensive; then
  23. sed -i -e "/__version__/s|'$|-gentoo_no_offensive_sites'|g" \
  24. youtube_dl/version.py || die
  25. # these have single line import statements
  26. local xxx=(
  27. alphaporno anysex behindkink camwithher chaturbate eporner
  28. eroprofile extremetube fourtube foxgay goshgay hellporno
  29. hentaistigma hornbunny keezmovies lovehomeporn mofosex motherless
  30. myvidster porn91 porncom pornflip pornhd pornotube pornovoisines
  31. pornoxo ruleporn sexu slutload spankbang spankwire sunporno thisav
  32. tube8 vporn watchindianporn xbef xnxx xtube xvideos xxxymovies
  33. youjizz youporn
  34. )
  35. # these have multi-line import statements
  36. local mxxx=(
  37. drtuber pornhub redtube tnaflix xhamster
  38. )
  39. # do single line imports
  40. sed -i \
  41. -e $( printf '/%s/d;' ${xxx[@]} ) \
  42. youtube_dl/extractor/extractors.py \
  43. || die
  44. # do multiple line imports
  45. sed -i \
  46. -e $( printf '/%s/,/)/d;' ${mxxx[@]} ) \
  47. youtube_dl/extractor/extractors.py \
  48. || die
  49. sed -i \
  50. -e $( printf '/%s/d;' ${mxxx[@]} ) \
  51. youtube_dl/extractor/generic.py \
  52. || die
  53. rm \
  54. $( printf 'youtube_dl/extractor/%s.py ' ${xxx[@]} ) \
  55. $( printf 'youtube_dl/extractor/%s.py ' ${mxxx[@]} ) \
  56. test/test_age_restriction.py \
  57. || die
  58. fi
  59. epatch_user
  60. distutils-r1_python_prepare_all
  61. }
  62. src_compile() {
  63. distutils-r1_src_compile
  64. }
  65. python_test() {
  66. emake test
  67. }
  68. python_install_all() {
  69. dodoc README.md
  70. distutils-r1_python_install_all
  71. rm -r "${ED}"/usr/etc || die
  72. }