Skip to content

Commit

Permalink
multimedia/ytfzf: Add a new port
Browse files Browse the repository at this point in the history
  • Loading branch information
0mp committed Apr 17, 2021
1 parent 17de01a commit 8625cb0
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 0 deletions.
1 change: 1 addition & 0 deletions multimedia/Makefile
Expand Up @@ -443,6 +443,7 @@
SUBDIR += xporthdmv
SUBDIR += xvid
SUBDIR += yamdi
SUBDIR += ytfzf
SUBDIR += zart
SUBDIR += zoneminder

Expand Down
46 changes: 46 additions & 0 deletions multimedia/ytfzf/Makefile
@@ -0,0 +1,46 @@
PORTNAME= ytfzf
DISTVERSIONPREFIX= v
DISTVERSION= 1.1.4
CATEGORIES= multimedia

MAINTAINER= 0mp@FreeBSD.org
COMMENT= Find and watch YouTube videos from the terminal

LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/LICENSE

RUN_DEPENDS= curl:ftp/curl \
fzf>=0:textproc/fzf \
jq:textproc/jq \
mpv:multimedia/mpv \
notify-send:devel/libnotify \
shuf:sysutils/shuf \
ueberzug:graphics/py-ueberzug@${PY_FLAVOR} \
youtube-dl:www/youtube_dl

USES= python
USE_GITHUB= yes
GH_ACCOUNT= pystardust
PYTHON_NO_DEPENDS= yes

NO_ARCH= yes
NO_BUILD= yes

PLIST_FILES= bin/${PORTNAME}

PORTDOCS= USAGE.md conf.sh
PORTEXAMPLES= conf.sh

OPTIONS_DEFINE= DOCS EXAMPLES

do-install:
${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin

@${MKDIR} ${STAGEDIR}${DOCSDIR}
${INSTALL_DATA} ${WRKSRC}/docs/USAGE.md ${STAGEDIR}${DOCSDIR}

@${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
${INSTALL_DATA} ${WRKSRC}/docs/conf.sh ${STAGEDIR}${EXAMPLESDIR}
${RLN} ${STAGEDIR}${EXAMPLESDIR}/conf.sh ${STAGEDIR}${DOCSDIR}/conf.sh

.include <bsd.port.mk>
3 changes: 3 additions & 0 deletions multimedia/ytfzf/distinfo
@@ -0,0 +1,3 @@
TIMESTAMP = 1618658726
SHA256 (pystardust-ytfzf-v1.1.4_GH0.tar.gz) = be56890e198fa6cfdf1e28a095cf286e10e2a8a77efe99d1214aaff8a122c087
SIZE (pystardust-ytfzf-v1.1.4_GH0.tar.gz) = 3221949
11 changes: 11 additions & 0 deletions multimedia/ytfzf/files/patch-ytfzf
@@ -0,0 +1,11 @@
--- ytfzf.orig 2021-04-17 13:32:28 UTC
+++ ytfzf
@@ -861,7 +861,7 @@ play_url () {
delete_thumbnails () {
session_count=0
while read -r pid; do
- [ -d /proc/"$pid" ] && session_count=$(( session_count + 1 ))
+ kill -0 "$pid" 2>/dev/null && session_count=$(( session_count + 1 ))
done < "$pid_file"
if [ $session_count -eq 1 ] ; then
[ -d "$thumb_dir" ] && rm -r "$thumb_dir"
4 changes: 4 additions & 0 deletions multimedia/ytfzf/pkg-descr
@@ -0,0 +1,4 @@
Ytfzf is a POSIX script that helps you find Youtube videos (without API)
and opens/downloads them using mpv/youtube-dl.

WWW: https://github.com/pystardust/ytfzf

0 comments on commit 8625cb0

Please sign in to comment.