# Maintainer: Trizen _pkgname=youtube-viewer pkgname=gtk-youtube-viewer-git pkgver=3.11.1.r0.gbd053b0 pkgrel=1 pkgdesc="A lightweight YouTube client for Linux (CLI/GTK)" arch=('any') url="https://github.com/trizen/${_pkgname}" license=('Artistic2.0') makedepends=('git' 'perl-module-build') provides=('youtube-viewer' 'youtube-viewer-git') conflicts=('youtube-viewer' 'youtube-viewer-git') depends=('perl' 'perl-data-dump' 'perl-json' 'perl-lwp-protocol-https' 'perl-libwww' 'perl-gtk3' 'perl-file-sharedir' 'perl-unicode-linebreak') optdepends=( 'ffmpeg: conversions and MKV merging' 'gnome-icon-theme: icons in menus' 'perl-json-xs: faster JSON parsing' 'perl-lwp-useragent-cached: local cache support' 'perl-term-readline-gnu: better STDIN support' 'mpv: play videos with MPV (recommended)' 'smplayer: play videos with SMPlayer' 'vlc: play videos with VLC' 'wget: download videos with wget' 'youtube-dl: play videos with encrypted signatures' ) source=("git+https://github.com/trizen/${_pkgname}.git") sha512sums=('SKIP') pkgver() { cd "$_pkgname" git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g' } build() { cd "$_pkgname" /usr/bin/perl Build.PL --gtk3 } check(){ cd "$_pkgname" ./Build test } package() { cd "$_pkgname" ./Build install --destdir "$pkgdir" --installdirs vendor --install_path script=/usr/bin rm -r "$pkgdir/usr/lib" mkdir "$pkgdir"/usr/share/{applications,pixmaps} mv "$pkgdir"/usr/share/perl5/vendor_perl/auto/share/dist/WWW-YoutubeViewer/gtk-youtube-viewer.desktop \ "$pkgdir"/usr/share/applications/gtk-youtube-viewer.desktop cp "$pkgdir"/usr/share/perl5/vendor_perl/auto/share/dist/WWW-YoutubeViewer/icons/gtk-youtube-viewer.png \ "$pkgdir"/usr/share/pixmaps/gtk-youtube-viewer.png }