git: 539778f9d7c9 - main - japanese/radish-play: Japanese Internet radio player

From: Koichiro Iwao <meta_at_FreeBSD.org>
Date: Tue, 24 Jun 2025 08:37:52 UTC
The branch main has been updated by meta:

URL: https://cgit.FreeBSD.org/ports/commit/?id=539778f9d7c97fbb2718ed25d4d5540668d38ad6

commit 539778f9d7c97fbb2718ed25d4d5540668d38ad6
Author:     mew14930xvi <mew14930xvi@inbox.lv>
AuthorDate: 2025-06-23 05:38:02 +0000
Commit:     Koichiro Iwao <meta@FreeBSD.org>
CommitDate: 2025-06-24 08:35:11 +0000

    japanese/radish-play: Japanese Internet radio player
    
    PR:             279840
---
 japanese/radish-play/Makefile                      | 39 ++++++++++++++++++
 japanese/radish-play/distinfo                      |  3 ++
 .../radish-play/files/ffplay-patch-radish-play.sh  | 29 ++++++++++++++
 .../radish-play/files/mpv-patch-radish-play.sh     | 46 ++++++++++++++++++++++
 japanese/radish-play/pkg-descr                     |  2 +
 5 files changed, 119 insertions(+)

diff --git a/japanese/radish-play/Makefile b/japanese/radish-play/Makefile
new file mode 100644
index 000000000000..a81a97d90941
--- /dev/null
+++ b/japanese/radish-play/Makefile
@@ -0,0 +1,39 @@
+PORTNAME=	radish-play
+DISTVERSION=	g20250621
+CATEGORIES=	japanese
+
+MAINTAINER=	mew14930xvi@inbox.lv
+COMMENT=	Japanese Internet radio player
+WWW=		https://github.com/jg1uaa/radish-play
+
+LICENSE=	MIT
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	curl:ftp/curl \
+		jq:textproc/jq \
+		xmllint:textproc/libxml2
+
+USE_GITHUB=	yes
+GH_ACCOUNT=	jg1uaa
+GH_TAGNAME=	2e4f02c
+NO_ARCH=	yes
+NO_BUILD=	yes
+
+PLIST_FILES=	bin/${PORTNAME}
+
+OPTIONS_DEFAULT=	MPV
+OPTIONS_SINGLE=		PLAYER
+OPTIONS_SINGLE_PLAYER=	FFPLAY MPV
+FFPLAY_DESC=		use ffplay (via ffmpeg, implies the SDL option)
+MPV_DESC=		use mpv as media player
+
+FFPLAY_RUN_DEPENDS=	ffplay:multimedia/ffmpeg
+FFPLAY_EXTRA_PATCHES=	${PATCHDIR}/ffplay-patch-radish-play.sh
+MPV_RUN_DEPENDS=	mpv:multimedia/mpv
+MPV_EXTRA_PATCHES=	${PATCHDIR}/mpv-patch-radish-play.sh
+
+do-install:
+	${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME}.sh \
+		${STAGEDIR}${PREFIX}/bin/${PORTNAME}
+
+.include <bsd.port.mk>
diff --git a/japanese/radish-play/distinfo b/japanese/radish-play/distinfo
new file mode 100644
index 000000000000..c15542569be3
--- /dev/null
+++ b/japanese/radish-play/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1750656614
+SHA256 (jg1uaa-radish-play-g20250621-2e4f02c_GH0.tar.gz) = 62be0ffe5ddeec56f28bffae9cceca073dbae82fe26070834e2d8fbf140052bd
+SIZE (jg1uaa-radish-play-g20250621-2e4f02c_GH0.tar.gz) = 5746
diff --git a/japanese/radish-play/files/ffplay-patch-radish-play.sh b/japanese/radish-play/files/ffplay-patch-radish-play.sh
new file mode 100644
index 000000000000..147f9d6c6c68
--- /dev/null
+++ b/japanese/radish-play/files/ffplay-patch-radish-play.sh
@@ -0,0 +1,29 @@
+--- radish-play.sh.orig	2024-06-17 18:49:28 UTC
++++ radish-play.sh
+@@ -22,11 +22,12 @@ Options:
+                     lisradi: ListenRadio
+                     shiburadi: Shibuya no Radio
+   -s STATION ID   Station ID
+-  -d MINUTE       Record minute(s)
+-  -o FILEPATH     Output file path
+   -i ADDRESS      login mail address (radiko only)
+   -p PASSWORD     login password (radiko only)
+   -l              Show all station ID list
++
++EXAMPLES:
++  radish-play -t nhk -s tokyo-r1
+ _EOT_
+ }
+
+@@ -427,11 +428,6 @@ else
+       -fflags +discardcorrupt \
+       -i "${playlist_uri}" \
+       -nodisp
+-fi
+-ret=$?
+-if [ ${ret} -ne 0 ]; then
+-  echo "Record failed" >&2
+-  exit 1
+ fi
+
+ # Finish
diff --git a/japanese/radish-play/files/mpv-patch-radish-play.sh b/japanese/radish-play/files/mpv-patch-radish-play.sh
new file mode 100644
index 000000000000..f00addccce8a
--- /dev/null
+++ b/japanese/radish-play/files/mpv-patch-radish-play.sh
@@ -0,0 +1,46 @@
+--- radish-play.sh.orig	2024-06-17 18:49:28 UTC
++++ radish-play.sh
+@@ -22,11 +22,12 @@ Options:
+                     lisradi: ListenRadio
+                     shiburadi: Shibuya no Radio
+   -s STATION ID   Station ID
+-  -d MINUTE       Record minute(s)
+-  -o FILEPATH     Output file path
+   -i ADDRESS      login mail address (radiko only)
+   -p PASSWORD     login password (radiko only)
+   -l              Show all station ID list
++
++EXAMPLES:
++  radish-play -t nhk -s tokyo-r1
+ _EOT_
+ }
+
+@@ -415,23 +416,12 @@ if [ "${type}" = "radiko" ]; then
+
+ # Play
+ if [ "${type}" = "radiko" ]; then
+-  ffplay \
+-      -loglevel error \
+-      -fflags +discardcorrupt \
+-      -headers "X-Radiko-Authtoken: ${radiko_authtoken}" \
+-      -i "${playlist_uri}" \
+-      -nodisp
++  mpv \
++      --http-header-fields="X-Radiko-Authtoken: ${radiko_authtoken}" \
++      "${playlist_uri}"
+ else
+-  ffplay \
+-      -loglevel error \
+-      -fflags +discardcorrupt \
+-      -i "${playlist_uri}" \
+-      -nodisp
+-fi
+-ret=$?
+-if [ ${ret} -ne 0 ]; then
+-  echo "Record failed" >&2
+-  exit 1
++  mpv \
++      "${playlist_uri}"
+ fi
+
+ # Finish
diff --git a/japanese/radish-play/pkg-descr b/japanese/radish-play/pkg-descr
new file mode 100644
index 000000000000..2cfe8cde872d
--- /dev/null
+++ b/japanese/radish-play/pkg-descr
@@ -0,0 +1,2 @@
+This is shell script to play Internet radio programs available on
+NHK Radio Rajiru, Radiko, ListenRadio, and Shibuya Radio.