git: 5790a01d7ece - main - audio/go-librespot: add port: Yet another open-source Spotify Connect client, written in Go

From: Hiroki Tagato <tagattie_at_FreeBSD.org>
Date: Mon, 06 Oct 2025 01:02:28 UTC
The branch main has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5790a01d7ececd79b3eef9b16f0806a456dbd32e

commit 5790a01d7ececd79b3eef9b16f0806a456dbd32e
Author:     Alexandre Biancalana <ale@biancalanas.net>
AuthorDate: 2025-10-05 14:22:00 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2025-10-06 01:02:10 +0000

    audio/go-librespot: add port: Yet another open-source Spotify Connect client, written in Go
    
    Yet another open-source Spotify Connect compatible client, written in Go.
    go-librespot gives you the freedom to have a Spotify Connect device wherever
    you want.
    
    WWW: https://github.com/devgianlu/go-librespot
    
    PR:             289388
    Reported by:    Alexandre Biancalana <ale@biancalanas.net> (new maintainer)
---
 audio/Makefile                           |  1 +
 audio/go-librespot/Makefile              | 29 ++++++++++++++++++++++
 audio/go-librespot/distinfo              |  5 ++++
 audio/go-librespot/files/config.yml      |  1 +
 audio/go-librespot/files/go-librespot.in | 41 ++++++++++++++++++++++++++++++++
 audio/go-librespot/pkg-descr             |  3 +++
 audio/go-librespot/pkg-plist             |  2 ++
 7 files changed, 82 insertions(+)

diff --git a/audio/Makefile b/audio/Makefile
index 0d41946a908a..c6ab5f910ea6 100644
--- a/audio/Makefile
+++ b/audio/Makefile
@@ -216,6 +216,7 @@
     SUBDIR += gnupod
     SUBDIR += gnuspeechsa
     SUBDIR += gnustep-cdplayer
+    SUBDIR += go-librespot
     SUBDIR += goattracker
     SUBDIR += gogglesmm
     SUBDIR += gonic
diff --git a/audio/go-librespot/Makefile b/audio/go-librespot/Makefile
new file mode 100644
index 000000000000..6e251cd497ce
--- /dev/null
+++ b/audio/go-librespot/Makefile
@@ -0,0 +1,29 @@
+PORTNAME=	go-librespot
+DISTVERSIONPREFIX=	v
+DISTVERSION=	0.5.0
+CATEGORIES=	audio
+
+MAINTAINER=	ale@biancalanas.net
+COMMENT=	Yet another open-source Spotify Connect client, written in Go
+WWW=		https://github.com/devgianlu/go-librespot
+
+LICENSE=	GPLv3
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+LIB_DEPENDS=	libogg.so:audio/libogg \
+		libasound.so:audio/alsa-lib \
+		libvorbis.so:audio/libvorbis
+
+USES=		go:modules pkgconfig
+USE_RC_SUBR=	${PORTNAME}
+
+GO_MODULE=	github.com/devgianlu/go-librespot
+
+GO_TARGET=	./cmd/daemon:${PREFIX}/bin/go-librespot
+GO_BUILDFLAGS=	-ldflags "-X github.com/devgianlu/go-librespot.version=${DISTVERSION} -X github.com/devgianlu/go-librespot.commit=fc55ed0"
+
+post-install:
+	${MKDIR} ${STAGEDIR}${ETCDIR}
+	${INSTALL_DATA} ${FILESDIR}/config.yml ${STAGEDIR}${ETCDIR}/config.yml.sample
+
+.include <bsd.port.mk>
diff --git a/audio/go-librespot/distinfo b/audio/go-librespot/distinfo
new file mode 100644
index 000000000000..6880489138e4
--- /dev/null
+++ b/audio/go-librespot/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1759670837
+SHA256 (go/audio_go-librespot/go-librespot-v0.5.0/v0.5.0.mod) = dfb7c599404395927cf1755213c311f48ea63344b30f1f516be4c57bb4ea8654
+SIZE (go/audio_go-librespot/go-librespot-v0.5.0/v0.5.0.mod) = 1828
+SHA256 (go/audio_go-librespot/go-librespot-v0.5.0/v0.5.0.zip) = db94a0c511f586d5e1662417c82c1debf1bc01934440d22e2dc37ab18a78d2eb
+SIZE (go/audio_go-librespot/go-librespot-v0.5.0/v0.5.0.zip) = 424569
diff --git a/audio/go-librespot/files/config.yml b/audio/go-librespot/files/config.yml
new file mode 100644
index 000000000000..60a087651df9
--- /dev/null
+++ b/audio/go-librespot/files/config.yml
@@ -0,0 +1 @@
+log_disable_timestamp: true
diff --git a/audio/go-librespot/files/go-librespot.in b/audio/go-librespot/files/go-librespot.in
new file mode 100644
index 000000000000..526cd959822b
--- /dev/null
+++ b/audio/go-librespot/files/go-librespot.in
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# PROVIDE: go_librespot
+# REQUIRE: DAEMON NETWORKING
+# KEYWORD: shutdown
+
+#
+# Add the following lines to /etc/rc.conf.local, /etc/rc.conf or
+# /etc/rc.conf.d/go-librespot to enable this service:
+#
+# go_librespot_enable (bool):       Set to NO by default.
+#                               Set it to "YES" to enable go-librespot.
+# go_librespot_config_dir (str):        Set to %%PREFIX%%/etc/go-librespot by default.
+#                               Path to configuration file.
+# go_librespot_user (str):          Set to "nobody" by default.
+#                               User to run go-librespot
+
+. /etc/rc.subr
+
+name=go_librespot
+rcvar=go_librespot_enable
+start_precmd="${name}_precmd"
+
+load_rc_config $name
+
+: ${go_librespot_enable:="NO"}
+: ${go_librespot_config_dir:="%%PREFIX%%/etc/go-librespot"}
+: ${go_librespot_user:="nobody"}
+
+pidfile="/var/run/${name}/${name}.pid"
+procname="%%PREFIX%%/bin/go-librespot"
+command="/usr/sbin/daemon"
+command_args="-S -m 3 -s info -l daemon -p ${pidfile} ${procname} --config_dir ${go_librespot_config_dir}"
+
+go_librespot_precmd()
+{
+	/usr/bin/install -d -m 0755 -o ${go_librespot_user} ${go_librespot_config_dir}
+	/usr/bin/install -d -m 0755 -o ${go_librespot_user} /var/run/${name}
+}
+
+run_rc_command "$1"
diff --git a/audio/go-librespot/pkg-descr b/audio/go-librespot/pkg-descr
new file mode 100644
index 000000000000..bd23e6fc4956
--- /dev/null
+++ b/audio/go-librespot/pkg-descr
@@ -0,0 +1,3 @@
+Yet another open-source Spotify Connect compatible client, written in Go.
+go-librespot gives you the freedom to have a Spotify Connect device wherever
+you want.
diff --git a/audio/go-librespot/pkg-plist b/audio/go-librespot/pkg-plist
new file mode 100644
index 000000000000..278fe33f67e9
--- /dev/null
+++ b/audio/go-librespot/pkg-plist
@@ -0,0 +1,2 @@
+bin/go-librespot
+@sample %%ETCDIR%%/config.yml.sample