youtube-dlc-2020.11.11-r3.ebuild 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. # Copyright 2020 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. PYTHON_COMPAT=( python3_{6..9} )
  5. DISTUTILS_USE_SETUPTOOLS=rdepend
  6. inherit bash-completion-r1 distutils-r1
  7. MY_PVR="${PVR/r/}"
  8. DESCRIPTION="media downloader and libray for various sites"
  9. HOMEPAGE="
  10. https://pypi.org/project/youtube-dlc
  11. https://github.com/blackjack4494/yt-dlc
  12. "
  13. SRC_URI="
  14. https://github.com/blackjack4494/yt-dlc/archive/${MY_PVR}.tar.gz
  15. -> ${PN}-${MY_PVR}.tar.gz
  16. "
  17. LICENSE="Unlicense"
  18. SLOT="0"
  19. KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc64 ~x86 ~ppc-macos ~x64-macos ~x86-macos ~x86-solaris"
  20. IUSE="doc bash-completion zsh-completion fish-completion test"
  21. RESTRICT="!test? ( test )"
  22. RDEPEND="
  23. dev-python/pycryptodome[${PYTHON_USEDEP}]
  24. dev-python/setuptools[${PYTHON_USEDEP}]
  25. "
  26. DEPEND="
  27. ${RDEPEND}
  28. doc? ( dev-python/sphinx )
  29. test? (
  30. dev-python/nose[${PYTHON_USEDEP}]
  31. dev-python/flake8[${PYTHON_USEDEP}]
  32. )
  33. "
  34. S="${WORKDIR}/${PN/youtube/yt}-${MY_PVR}"
  35. distutils_enable_tests nose
  36. src_compile() {
  37. distutils-r1_src_compile
  38. use doc && (
  39. cd -- ./docs && emake man BUILDDIR="${S}" \
  40. || die 'failed to build man page'
  41. )
  42. }
  43. python_test() {
  44. emake offlinetest
  45. }
  46. python_install_all() {
  47. rm -r -- "${ED}/usr/etc" && rm -r -- "${ED}/usr/share/doc" \
  48. || die 'failed to remove unneeded files'
  49. dodoc README.md
  50. use doc && doman "man/${PN}.1"
  51. use bash-completion && {
  52. emake "${PN}.bash-completion"
  53. newbashcomp "${PN}.bash-completion" "${PN}"
  54. }
  55. use fish-completion && {
  56. insinto /usr/share/fish/vendor_completions.d
  57. emake "${PN}.fish"
  58. doins "${PN}.fish"
  59. }
  60. use zsh-completion && {
  61. insinto /usr/share/zsh/site-functions
  62. emake "${PN}.zsh"
  63. newins "${PN}.zsh" "_${PN}"
  64. }
  65. }