Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 2015 20:42:15 +0000 (UTC)
From:      Nicola Vitale <nivit@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r378017 - in head/multimedia/mps-youtube: . files
Message-ID:  <201501272042.t0RKgFod049315@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nivit
Date: Tue Jan 27 20:42:14 2015
New Revision: 378017
URL: https://svnweb.freebsd.org/changeset/ports/378017
QAT: https://qat.redports.org/buildarchive/r378017/

Log:
  - Update to 0.2.1
  - Add files/patch-mps__youtube_main.py to fix the bug of empty search results.
    See https://github.com/np1/mps-youtube/issues/179
  - Add a patch (taken from upstream) to fix terminal size detection.
    See https://github.com/np1/mps-youtube/commit/f1021baa246df96b91bf62aabe185493f0b07df2
  - Add security/ca_root_nss to run dependencies
  - Use option helpers
  - Add an option (RADIO_CONVERTER) to select a converter to MP3 and other formats
  - Replace multimedia/mplayer with multimedia/mpv as default video player
    (SINGLE_PLAYER option): it's the video player set in the initial config file.
  - Add a post-patch target to replace %%LOCALBASE%% key
  - Add the new features of the program to pkg-descr
  - Fix instructions in pkg-message
  
  Relnotes:	https://github.com/np1/mps-youtube/blob/develop/CHANGELOG

Added:
  head/multimedia/mps-youtube/files/
  head/multimedia/mps-youtube/files/patch-mps__youtube_main.py   (contents, props changed)
  head/multimedia/mps-youtube/files/patch-mps__youtube_terminalsize.py   (contents, props changed)
Modified:
  head/multimedia/mps-youtube/Makefile
  head/multimedia/mps-youtube/distinfo
  head/multimedia/mps-youtube/pkg-descr   (contents, props changed)
  head/multimedia/mps-youtube/pkg-message   (contents, props changed)

Modified: head/multimedia/mps-youtube/Makefile
==============================================================================
--- head/multimedia/mps-youtube/Makefile	Tue Jan 27 20:41:01 2015	(r378016)
+++ head/multimedia/mps-youtube/Makefile	Tue Jan 27 20:42:14 2015	(r378017)
@@ -2,9 +2,8 @@
 # $FreeBSD$
 
 PORTNAME=	mps-youtube
-PORTVERSION=	0.01.46
-#PORTREVISION=	0
-PORTREVISION=	1
+PORTVERSION=	0.2.1
+PORTREVISION=	0
 CATEGORIES=	multimedia
 MASTER_SITES=	CHEESESHOP
 
@@ -13,25 +12,36 @@ COMMENT=	Terminal based YouTube jukebox 
 
 LICENSE=	GPLv3
 
-RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pafy>=0.3.41:${PORTSDIR}/www/py-pafy
+RUN_DEPENDS=	ca_root_nss>=3.17.3:${PORTSDIR}/security/ca_root_nss \
+		${PYTHON_PKGNAMEPREFIX}pafy>=0.3.66:${PORTSDIR}/www/py-pafy
 
-OPTIONS_DEFAULT=	MPLAYER
-OPTIONS_RADIO=	PLAYER
-OPTIONS_RADIO_PLAYER=	MPLAYER MPV
+CONVERTER_DESC=	Converter to MP3 and other formats
 
-MPV_DESC=	Mpv media player support
+FFMPEG_RUN_DEPENDS=	ffmpeg>=2.3.6:${PORTSDIR}/multimedia/ffmpeg
+
+LIBAV_DESC=	Realtime audio/video conversion library
+LIBAV_RUN_DEPENDS=	libav>=11.2:${PORTSDIR}/multimedia/libav
+
+MPLAYER_RUN_DEPENDS=	mplayer:${PORTSDIR}/multimedia/mplayer
+
+MPV_DESC=	Free and open-source general-purpose video player
+MPV_RUN_DEPENDS=	mpv:${PORTSDIR}/multimedia/mpv
+
+OPTIONS_DEFAULT=	MPV
+OPTIONS_RADIO=	CONVERTER
+OPTIONS_RADIO_CONVERTER=	FFMPEG LIBAV
+OPTIONS_SINGLE=	PLAYER
+OPTIONS_SINGLE_PLAYER=	MPLAYER MPV
+
+PLAYER_DESC=	Video player
 
-# This port installs the following files in shared dirs
-# PLIST_FILES=	bin/mpsyt
 USES=		python
-USE_PYTHON=	distutils autoplist
+USE_PYTHON=	autoplist distutils
 
 .include <bsd.port.options.mk>
 
-.if ${PORT_OPTIONS:MMPLAYER}
-RUN_DEPENDS+=	mplayer:${PORTSDIR}/multimedia/mplayer
-.elif ${PORT_OPTIONS:MMPV}
-RUN_DEPENDS+=	mpv:${PORTSDIR}/multimedia/mpv
-.endif
+post-patch:
+	@${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},1' \
+		${WRKSRC}/mps_youtube/main.py
 
 .include <bsd.port.mk>

Modified: head/multimedia/mps-youtube/distinfo
==============================================================================
--- head/multimedia/mps-youtube/distinfo	Tue Jan 27 20:41:01 2015	(r378016)
+++ head/multimedia/mps-youtube/distinfo	Tue Jan 27 20:42:14 2015	(r378017)
@@ -1,2 +1,2 @@
-SHA256 (mps-youtube-0.01.46.tar.gz) = adec83d2c210c99799d2ce9046c9ed70f9910c5d7bb745556ac49aaffe719679
-SIZE (mps-youtube-0.01.46.tar.gz) = 40420
+SHA256 (mps-youtube-0.2.1.tar.gz) = d6de39f690eca3dc6c6fd13a9576376ac784eb50dbb1b8c2e9e2722960850ccf
+SIZE (mps-youtube-0.2.1.tar.gz) = 45609

Added: head/multimedia/mps-youtube/files/patch-mps__youtube_main.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/mps-youtube/files/patch-mps__youtube_main.py	Tue Jan 27 20:42:14 2015	(r378017)
@@ -0,0 +1,13 @@
+--- mps_youtube/main.py.orig	2015-01-25 16:46:50 UTC
++++ mps_youtube/main.py
+@@ -856,6 +856,10 @@ def init():
+     init_cache()
+     init_transcode()
+ 
++    # see https://github.com/np1/mps-youtube/issues/179
++    if 34015728 <= sys.hexversion and not 'SSL_CERT_FILE' in os.environ:
++        os.environ['SSL_CERT_FILE'] = '%%LOCALBASE%%/share/certs/ca-root-nss.crt'
++
+     # set player to mpv or mplayer if found, otherwise unset
+     E = os.path.exists
+     suffix = ".exe" if mswin else ""

Added: head/multimedia/mps-youtube/files/patch-mps__youtube_terminalsize.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/mps-youtube/files/patch-mps__youtube_terminalsize.py	Tue Jan 27 20:42:14 2015	(r378017)
@@ -0,0 +1,27 @@
+--- mps_youtube/terminalsize.py.orig	2015-01-27 17:31:17 UTC
++++ mps_youtube/terminalsize.py
+@@ -17,13 +17,13 @@ def get_terminal_size():
+      http://stackoverflow.com/questions/566746/how-to-get-console-window-width-in-python
+     """
+     current_os = platform.system()
+-    tuple_xy = None, None
++    tuple_xy = None
+     if current_os == 'Windows':
+         tuple_xy = _get_terminal_size_windows()
+         if tuple_xy is None:
+             tuple_xy = _get_terminal_size_tput()
+             # needed for window's python in cygwin's xterm!
+-    if current_os in ['Linux', 'Darwin'] or current_os.startswith('CYGWIN'):
++    else:
+         tuple_xy = _get_terminal_size_linux()
+     if tuple_xy is None:
+         tuple_xy = (80, 25)      # default value
+@@ -83,7 +83,7 @@ def _get_terminal_size_linux():
+         try:
+             cr = (os.environ['LINES'], os.environ['COLUMNS'])
+         except:
+-            return None, None
++            return
+     return int(cr[1]), int(cr[0])
+ 
+ if __name__ == "__main__":

Modified: head/multimedia/mps-youtube/pkg-descr
==============================================================================
--- head/multimedia/mps-youtube/pkg-descr	Tue Jan 27 20:41:01 2015	(r378016)
+++ head/multimedia/mps-youtube/pkg-descr	Tue Jan 27 20:42:14 2015	(r378017)
@@ -3,9 +3,12 @@ Terminal based YouTube jukebox with play
 Main features:
 
  - Search and play audio/video from YouTube
+ - Search tracks of albums by album title
  - Search and import YouTube playlists
  - Create and save local playlists
  - Download audio/video
+ - Convert to mp3 & other formats (requires ffmpeg or avconv)
+ - View video comments
  - Works with Python 2.7+ and 3.x
  - Works with Windows, Linux and Mac OS X
  - Requires mplayer or mpv

Modified: head/multimedia/mps-youtube/pkg-message
==============================================================================
--- head/multimedia/mps-youtube/pkg-message	Tue Jan 27 20:41:01 2015	(r378016)
+++ head/multimedia/mps-youtube/pkg-message	Tue Jan 27 20:42:14 2015	(r378017)
@@ -2,6 +2,6 @@
 
   Note that to see videos you have to enable the relative option in the program
 
-    set video_option True
+    set show_video True
 
 ********************************************************************************



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201501272042.t0RKgFod049315>