youtube-viewer-3.2.5.ebuild 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils gnome2-utils perl-module
  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/archive/${PV}.tar.gz -> ${P}.tar.gz"
  8. LICENSE="|| ( Artistic GPL-1+ )"
  9. SLOT="0"
  10. KEYWORDS="~amd64 ~x86"
  11. IUSE="gtk"
  12. RDEPEND="
  13. dev-perl/Data-Dump
  14. dev-perl/JSON
  15. dev-perl/libwww-perl[ssl]
  16. dev-perl/Term-ReadLine-Gnu
  17. media-video/ffmpeg[openssl]
  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. || ( media-video/mpv media-video/mplayer media-video/smplayer media-video/vlc )
  34. "
  35. DEPEND="dev-perl/Module-Build"
  36. SRC_TEST="do"
  37. src_prepare() {
  38. perl-module_src_prepare
  39. }
  40. # build system installs files on "perl Build.PL" too
  41. # do all the work in src_install
  42. src_configure() { :; }
  43. src_compile() { :; }
  44. src_install() {
  45. local myconf
  46. if use gtk ; then
  47. myconf="--gtk-youtube-viewer"
  48. fi
  49. perl-module_src_configure
  50. perl-module_src_install
  51. if use gtk ; then
  52. domenu share/gtk-youtube-viewer.desktop
  53. doicon share/icons/gtk-youtube-viewer.png
  54. fi
  55. }
  56. pkg_preinst() {
  57. use gtk && gnome2_icon_savelist
  58. perl_set_version
  59. }
  60. pkg_postinst() {
  61. use gtk && gnome2_icon_cache_update
  62. elog "Optional dependencies:"
  63. optfeature "cache support" dev-perl/LWP-UserAgent-Cached
  64. optfeature "better STDIN support" dev-perl/Term-ReadLine-Gnu
  65. optfeature "faster JSON to HASH conversion" dev-perl/JSON-XS
  66. optfeature "the case if there are SSL problems" dev-perl/Mozilla-CA
  67. optfeature "printing results in a fixed-width format (--fixed-width, -W)" dev-perl/Text-CharWidth
  68. optfeature "threads support" virtual/perl-threads
  69. elog
  70. elog "Check the configuration file in ~/.config/youtube-viewer/"
  71. elog "and configure your video player backend."
  72. }
  73. pkg_postrm() {
  74. use gtk && gnome2_icon_cache_update
  75. }