youtube-viewer-3.2.0.ebuild 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils gnome2-utils perl-module vcs-snapshot
  5. DESCRIPTION="A command line utility for viewing youtube-videos in Mplayer"
  6. HOMEPAGE="https://trizenx.blogspot.com/2012/03/gtk-youtube-viewer.html"
  7. SRC_URI="https://github.com/trizen/youtube-viewer/tarball/${PV} -> ${P}.tar.gz"
  8. LICENSE="|| ( Artistic GPL-1+ )"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="gtk"
  12. RDEPEND="
  13. >=dev-lang/perl-5.16.0
  14. dev-perl/Data-Dump
  15. dev-perl/JSON
  16. dev-perl/libwww-perl[ssl]
  17. dev-perl/Term-ReadLine-Gnu
  18. virtual/perl-Encode
  19. virtual/perl-File-Path
  20. virtual/perl-File-Spec
  21. virtual/perl-Getopt-Long
  22. virtual/perl-Scalar-List-Utils
  23. virtual/perl-Term-ANSIColor
  24. virtual/perl-Term-ReadLine
  25. virtual/perl-Text-ParseWords
  26. virtual/perl-Text-Tabs+Wrap
  27. gtk? (
  28. dev-perl/File-ShareDir
  29. >=dev-perl/Gtk2-1.244.0
  30. virtual/freedesktop-icon-theme
  31. x11-libs/gdk-pixbuf:2[X,jpeg]
  32. )"
  33. DEPEND="dev-perl/Module-Build"
  34. SRC_TEST="do"
  35. src_prepare() {
  36. perl-module_src_prepare
  37. }
  38. # build system installs files on "perl Build.PL" too
  39. # do all the work in src_install
  40. src_configure() { :; }
  41. src_compile() { :; }
  42. src_install() {
  43. local myconf
  44. if use gtk ; then
  45. myconf="--gtk-youtube-viewer"
  46. fi
  47. perl-module_src_configure
  48. perl-module_src_install
  49. if use gtk ; then
  50. domenu share/gtk-youtube-viewer.desktop
  51. doicon share/icons/gtk-youtube-viewer.png
  52. fi
  53. }
  54. pkg_preinst() {
  55. use gtk && gnome2_icon_savelist
  56. perl_set_version
  57. }
  58. pkg_postinst() {
  59. use gtk && gnome2_icon_cache_update
  60. elog "Optional dependencies:"
  61. optfeature "cache support" dev-perl/LWP-UserAgent-Cached
  62. optfeature "better STDIN support" dev-perl/Term-ReadLine-Gnu
  63. optfeature "faster JSON to HASH conversion" dev-perl/JSON-XS
  64. optfeature "the case if there are SSL problems" dev-perl/Mozilla-CA
  65. optfeature "printing results in a fixed-width format (--fixed-width, -W)" dev-perl/Text-CharWidth
  66. optfeature "threads support" virtual/perl-threads
  67. elog
  68. elog "You also need a compatible video player, possible choices are:"
  69. elog " media-video/mpv"
  70. elog " media-video/smplayer"
  71. elog " media-video/vlc"
  72. elog "Also check the configuration file in ~/.config/youtube-viewer/"
  73. elog "and configure your video player backend."
  74. }
  75. pkg_postrm() {
  76. use gtk && gnome2_icon_cache_update
  77. }