youtube-viewer-3.2.4.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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. SLOT="0"
  9. KEYWORDS="~amd64 ~x86"
  10. IUSE="gtk"
  11. RDEPEND="
  12. dev-perl/Data-Dump
  13. dev-perl/JSON
  14. dev-perl/libwww-perl[ssl]
  15. dev-perl/Term-ReadLine-Gnu
  16. virtual/perl-Encode
  17. virtual/perl-File-Path
  18. virtual/perl-File-Spec
  19. virtual/perl-Getopt-Long
  20. virtual/perl-Scalar-List-Utils
  21. virtual/perl-Term-ANSIColor
  22. virtual/perl-Term-ReadLine
  23. virtual/perl-Text-ParseWords
  24. virtual/perl-Text-Tabs+Wrap
  25. gtk? (
  26. dev-perl/File-ShareDir
  27. >=dev-perl/Gtk2-1.244.0
  28. virtual/freedesktop-icon-theme
  29. x11-libs/gdk-pixbuf:2[X,jpeg]
  30. )"
  31. DEPEND="dev-perl/Module-Build"
  32. SRC_TEST="do"
  33. src_prepare() {
  34. perl-module_src_prepare
  35. }
  36. # build system installs files on "perl Build.PL" too
  37. # do all the work in src_install
  38. src_configure() { :; }
  39. src_compile() { :; }
  40. src_install() {
  41. local myconf
  42. if use gtk ; then
  43. myconf="--gtk-youtube-viewer"
  44. fi
  45. perl-module_src_configure
  46. perl-module_src_install
  47. if use gtk ; then
  48. domenu share/gtk-youtube-viewer.desktop
  49. doicon share/icons/gtk-youtube-viewer.png
  50. fi
  51. }
  52. pkg_preinst() {
  53. use gtk && gnome2_icon_savelist
  54. perl_set_version
  55. }
  56. pkg_postinst() {
  57. use gtk && gnome2_icon_cache_update
  58. elog "Optional dependencies:"
  59. optfeature "cache support" dev-perl/LWP-UserAgent-Cached
  60. optfeature "better STDIN support" dev-perl/Term-ReadLine-Gnu
  61. optfeature "faster JSON to HASH conversion" dev-perl/JSON-XS
  62. optfeature "the case if there are SSL problems" dev-perl/Mozilla-CA
  63. optfeature "printing results in a fixed-width format (--fixed-width, -W)" dev-perl/Text-CharWidth
  64. optfeature "threads support" virtual/perl-threads
  65. elog
  66. elog "You also need a compatible video player, possible choices are:"
  67. elog " media-video/mpv"
  68. elog " media-video/mplayer"
  69. elog " media-video/smplayer"
  70. elog " media-video/vlc"
  71. elog "Also check the configuration file in ~/.config/youtube-viewer/"
  72. elog "and configure your video player backend."
  73. }
  74. pkg_postrm() {
  75. use gtk && gnome2_icon_cache_update
  76. }