multimedia/youtube-viewer: Updated for version 3.7.4.

Signed-off-by: B. Watson <yalhcru@gmail.com>
This commit is contained in:
B. Watson 2020-03-05 17:18:12 -05:00 committed by Willy Sudiarto Raharjo
parent 1f9f359f37
commit 187f537fec
No known key found for this signature in database
GPG key ID: 887B8374D7333381
4 changed files with 57 additions and 14 deletions

View file

@ -5,9 +5,20 @@ downloading Youtube videos, using wget for downloading and MPlayer for
viewing. It has been written in Perl and plays videos from Youtube at
the best quality available without using a flash player.
*********
Note: Google has revoked the API key formerly used by youtube-viewer. To
use this, you'll have to create a Google account and register for an API
key. See /usr/doc/youtube-viewer-$VERSION/README.md for instructions.
See https://github.com/trizen/youtube-viewer/issues/308 for more
information.
If you don't like this restriction, try using straw-viewer instead.
*********
Optional dependencies:
perl-gtk2 [1], perl-File-ShareDir - for gtk-youtube-viewer.
perl-gtk2, perl-File-ShareDir - for gtk2-youtube-viewer.
perl-Gtk3, perl-File-ShareDir, perl-List-MoreUtils - for gtk3-youtube-viewer.
perl-Text-CharWidth, perl-Unicode-LineBreak - for better formatting
in the terminal.
perl-Term-ReadLine-Gnu - for command editing/history in the terminal.
@ -18,9 +29,7 @@ Counting optional ones, youtube-viewer has over 40 dependencies. To make
life easier, there's now a "youtube-viewer.sqf" queue file included with
this build, which includes everything listed above.
[1] Or possibly perl-Gtk3. Not tested. Let me know if it works.
[2] A small caveat about youtube-dl: youtube-viewer works without it,
[1] A small caveat about youtube-dl: youtube-viewer works without it,
though occasionally it'll choose a lower quality than is available
for some videos. However, if youtube-dl is present but outdated,
youtube-viewer will fail to play videos at all! If you suspect this,

View file

@ -0,0 +1,18 @@
diff -Naur youtube-viewer-3.7.4/bin/gtk3-youtube-viewer youtube-viewer-3.7.4.patched/bin/gtk3-youtube-viewer
--- youtube-viewer-3.7.4/bin/gtk3-youtube-viewer 2020-02-11 22:35:13.000000000 -0500
+++ youtube-viewer-3.7.4.patched/bin/gtk3-youtube-viewer 2020-03-05 17:02:07.819892140 -0500
@@ -638,11 +638,11 @@
undef $history{lc($line)};
}
- require List::Util;
+ require List::MoreUtils;
# Keep only the most recent non-duplicated entries
- @history = reverse(List::Util::uniq(reverse(@history)));
- @search_history = List::Util::uniq(@search_history);
+ @history = reverse(List::MoreUtils::uniq(reverse(@history)));
+ @search_history = List::MoreUtils::uniq(@search_history);
# Set entry completion
$completion = Gtk3::EntryCompletion->new;

View file

@ -6,6 +6,7 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20200305 bkw: updated for 3.7.4, add README stuff about API keys.
# 20200110 bkw: updated for 3.7.0, add .sqf.
# 20191220 bkw: updated for 3.6.0.
# 20191201 bkw: updated for 3.5.9.
@ -65,7 +66,7 @@
# - Added support for gtk-youtube-viewer
PRGNAM=youtube-viewer
VERSION=${VERSION:-3.7.0}
VERSION=${VERSION:-3.7.4}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
ARCH=noarch
@ -86,22 +87,37 @@ chown -R root:root .
find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
\! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
# perl-gtk2 is a runtime dep, we can build with GTK=yes even if it's not
# installed... but don't do that by default.
# perl-gtk2 and perl-Gtk3 are runtime deps, we can build with GTK=yes
# even if they're not installed... but don't do that by default.
GTK="${GTK:-auto}"
case "$GTK" in
no) BUILD_GTK="no" ;;
yes) BUILD_GTK="yes" ;;
*) perl -MGtk2 -MFile::ShareDir -e 0 2>/dev/null \
&& BUILD_GTK="yes" \
|| BUILD_GTK="no" ;;
*) if perl -MGtk2 -MFile::ShareDir -e 0 2>/dev/null; then
BUILD_GTK="yes"
elif perl -MGtk3 -MFile::ShareDir -MList::MoreUtils -e 0 2>/dev/null; then
BUILD_GTK="yes"
else
BUILD_GTK="no"
fi
;;
esac
[ "$BUILD_GTK" = "yes" ] && GTKOPT="--gtk"
echo "=== HAVE_GTK=$HAVE_GTK BUILD_GTK=$BUILD_GTK"
# 20200305 bkw: upstream claims gtk+3-3.20 is required, but everything
# actually works fine with 14.2's 3.18. So:
sed -i 's,"3.20","3.18",' share/gtk3-$PRGNAM.glade
# 20200305 bkw: 14.2's perl package has List::Util 1.4.1, which lacks
# the uniq() function. However, SBo's perl-List-MoreUtils provides it.
# This means we can ignore the build warning:
# ! List::Util (1.41) is installed, but we need version >= 1.43
patch -p1 < $CWD/list-moreutils.diff
perl Build.PL $GTKOPT prefix=/usr installdirs=vendor --destdir="$PKG"
./Build
./Build test
@ -123,7 +139,7 @@ if [ "$BUILD_GTK" = "yes" ]; then
# support TERMINAL option for user's preferred terminal.
if [ "$TERMINAL" != "" ]; then
sed -i "s/'gnome-terminal'/'$TERMINAL', &/" $PKG/usr/bin/gtk-$PRGNAM
sed -i "s/'gnome-terminal'/'$TERMINAL', &/" $PKG/usr/bin/gtk?-$PRGNAM
fi
fi

View file

@ -1,8 +1,8 @@
PRGNAM="youtube-viewer"
VERSION="3.7.0"
VERSION="3.7.4"
HOMEPAGE="https://github.com/trizen/youtube-viewer/"
DOWNLOAD="https://github.com/trizen/youtube-viewer/archive/3.7.0/youtube-viewer-3.7.0.tar.gz"
MD5SUM="fe0bb7561893e646d2f44c08f28addcf"
DOWNLOAD="https://github.com/trizen/youtube-viewer/archive/3.7.4/youtube-viewer-3.7.4.tar.gz"
MD5SUM="17e183cdccfe30c04aed7263d26654a0"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="perl-data-dump perl-LWP-Protocol-https perl-lwp-useragent-cached perl-JSON perl-JSON-XS perl-Module-Build"