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