commit:     2f7d4cff62ac1c19fb590e19765afc979094e8b0
Author:     Nicolas PARLANT <nicolas.parlant <AT> parhuet <DOT> fr>
AuthorDate: Tue Jan 20 06:45:23 2026 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Jan 23 07:35:14 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2f7d4cff

media-sound/snapcast: add 0.34.0

update github repo badaix->snapcast

add optional alsa, pipewire, soxr, ssl
boost is headers-only, add boost[context] for jack

unbundle dev-cpp/nlohmann_json
use vendored aixlog and popl, both are already used, single-file header,
up-to-date and from the author of snapcast

handle python plugins (python-single-r1 and optfeature)

use new initd with unprivileged user
use new confd w/o stream.source (-s) already defined in config-file
use systemd service provided by upstream

Closes: https://bugs.gentoo.org/959109
Closes: https://bugs.gentoo.org/969033
Signed-off-by: Nicolas PARLANT <nicolas.parlant <AT> parhuet.fr>
Part-of: https://github.com/gentoo/gentoo/pull/45458
Closes: https://github.com/gentoo/gentoo/pull/45458
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 media-sound/snapcast/Manifest                      |   1 +
 .../snapcast/files/snapcast-0.34.0-drop-lint.patch |  13 ++
 .../snapcast/files/snapcast-0.34.0-opt_soxr.patch  |  19 +++
 .../files/snapcast-0.34.0-snapclient_group.patch   |  11 ++
 media-sound/snapcast/files/snapclient.confd-r1     |   7 +
 media-sound/snapcast/files/snapclient.initd-r1     |  14 ++
 media-sound/snapcast/files/snapserver.confd-r1     |   5 +
 media-sound/snapcast/files/snapserver.initd-r1     |  14 ++
 media-sound/snapcast/metadata.xml                  |   6 +-
 media-sound/snapcast/snapcast-0.34.0.ebuild        | 151 +++++++++++++++++++++
 10 files changed, 239 insertions(+), 2 deletions(-)

diff --git a/media-sound/snapcast/Manifest b/media-sound/snapcast/Manifest
index fe5f1872dd63..86960e37e41d 100644
--- a/media-sound/snapcast/Manifest
+++ b/media-sound/snapcast/Manifest
@@ -1 +1,2 @@
 DIST snapcast-0.31.0.tar.gz 1128037 BLAKE2B 
82444e9fc75e82b5f57e3e115a8bfbde2a5839bc68e25db47df0f25675cf73a836f2e8b09afb077410bd3c36917abb17ce302c18b67b440567c55b673301e7f5
 SHA512 
9c3eef7a18aaf6479a96810aeb58d11cc87654021d8d07b29f9b623c70bd7fd9aa08f5dee430c11de72abafa1a1b5abe500b93eef4b17b7c56df55c2f2a29867
+DIST snapcast-0.34.0.tar.gz 1173157 BLAKE2B 
e141c7fe264801ba598e09edad41cc543811e36ee51c02597dc180bd79370b6693aeaed919ce4c56749064f6034c26409c6aa7273a01b33fdc265315d501f76d
 SHA512 
509c76432f71c1f08975740f7e633289254d157d2676f0c20d4a2578515e5ed5bb0036706df35fd2d4cba091881fc6c84d870c80e6cf7c6923392daf9c1cfbb1

diff --git a/media-sound/snapcast/files/snapcast-0.34.0-drop-lint.patch 
b/media-sound/snapcast/files/snapcast-0.34.0-drop-lint.patch
new file mode 100644
index 000000000000..dd4939d45df7
--- /dev/null
+++ b/media-sound/snapcast/files/snapcast-0.34.0-drop-lint.patch
@@ -0,0 +1,13 @@
+We don't want any automagic lint probing.
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -98,9 +98,6 @@ else()
+ endif()
+ 
+ include(GNUInstallDirs)
+-include(${CMAKE_SOURCE_DIR}/cmake/clang-tidy.cmake)
+-include(${CMAKE_SOURCE_DIR}/cmake/cppcheck.cmake)
+-include(${CMAKE_SOURCE_DIR}/cmake/reformat.cmake)
+ 
+ if(NOT WIN32)
+   option(BUILD_SERVER "Build Snapserver" ON) # no Windows server for now

diff --git a/media-sound/snapcast/files/snapcast-0.34.0-opt_soxr.patch 
b/media-sound/snapcast/files/snapcast-0.34.0-opt_soxr.patch
new file mode 100644
index 000000000000..31e919bac048
--- /dev/null
+++ b/media-sound/snapcast/files/snapcast-0.34.0-opt_soxr.patch
@@ -0,0 +1,19 @@
+avoid automagic for soxr
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -256,12 +256,10 @@ if(NOT WIN32 AND NOT ANDROID)
+     endif()
+   endif()
+ 
+-  pkg_search_module(SOXR soxr)
+-  if(SOXR_FOUND)
++  if(BUILD_WITH_SOXR)
++    pkg_search_module(SOXR REQUIRED soxr)
+     add_compile_definitions(HAS_SOXR)
+-  else()
+-    message(STATUS "soxr not found")
+-  endif(SOXR_FOUND)
++  endif()
+ 
+   if(BUILD_WITH_FLAC)
+     pkg_search_module(FLAC REQUIRED flac)

diff --git a/media-sound/snapcast/files/snapcast-0.34.0-snapclient_group.patch 
b/media-sound/snapcast/files/snapcast-0.34.0-snapclient_group.patch
new file mode 100644
index 000000000000..7648602e7890
--- /dev/null
+++ b/media-sound/snapcast/files/snapcast-0.34.0-snapclient_group.patch
@@ -0,0 +1,11 @@
+--- a/extras/package/rpm/snapclient.service
++++ b/extras/package/rpm/snapclient.service
+@@ -8,7 +8,7 @@ After=network-online.target time-sync.target sound.target 
avahi-daemon.service
+ EnvironmentFile=-/etc/default/snapclient
+ ExecStart=/usr/bin/snapclient --logsink=system $SNAPCLIENT_OPTS
+ User=snapclient
+-Group=snapclient
++Group=audio
+ Restart=on-failure
+ 
+ [Install]

diff --git a/media-sound/snapcast/files/snapclient.confd-r1 
b/media-sound/snapcast/files/snapclient.confd-r1
new file mode 100644
index 000000000000..fe254b70d88e
--- /dev/null
+++ b/media-sound/snapcast/files/snapclient.confd-r1
@@ -0,0 +1,7 @@
+# conf.d file for snapclient
+SNAPCLIENT_USER="snapclient:audio"
+
+# snapclient [options...] [url]
+# For all command line options, please see `man snapclient.1`
+# if ’url’ is not configured, snapclient defaults to ’tcp://_snapcast._tcp’
+SNAPCLIENT_OPTS="--logsink=system"

diff --git a/media-sound/snapcast/files/snapclient.initd-r1 
b/media-sound/snapcast/files/snapclient.initd-r1
new file mode 100644
index 000000000000..755b1ee6ce7c
--- /dev/null
+++ b/media-sound/snapcast/files/snapclient.initd-r1
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name=snapclient
+command="/usr/bin/snapclient"
+command_args="${SNAPCLIENT_OPTS}"
+command_user="${SNAPCLIENT_USER:-snapclient:audio}"
+command_background=true
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+       use avahi-daemon
+}

diff --git a/media-sound/snapcast/files/snapserver.confd-r1 
b/media-sound/snapcast/files/snapserver.confd-r1
new file mode 100644
index 000000000000..04b6633f98a4
--- /dev/null
+++ b/media-sound/snapcast/files/snapserver.confd-r1
@@ -0,0 +1,5 @@
+# conf.d file for snapserver
+SNAPSERVER_USER="snapserver:snapserver"
+
+# For all command line options, please see `snapserver -hh`
+SNAPSERVER_OPTS="--logging.sink=system --server.datadir=/var/lib/snapserver"

diff --git a/media-sound/snapcast/files/snapserver.initd-r1 
b/media-sound/snapcast/files/snapserver.initd-r1
new file mode 100644
index 000000000000..e2963d59f926
--- /dev/null
+++ b/media-sound/snapcast/files/snapserver.initd-r1
@@ -0,0 +1,14 @@
+#!/sbin/openrc-run
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+name=snapserver
+command="/usr/bin/snapserver"
+command_args="${SNAPSERVER_OPTS}"
+command_user="${SNAPSERVER_USER:-snapserver:snapserver}"
+command_background=true
+pidfile="/run/${RC_SVCNAME}.pid"
+
+depend() {
+       use avahi-daemon
+}

diff --git a/media-sound/snapcast/metadata.xml 
b/media-sound/snapcast/metadata.xml
index b98f35b6a3f4..760d16205686 100644
--- a/media-sound/snapcast/metadata.xml
+++ b/media-sound/snapcast/metadata.xml
@@ -4,7 +4,9 @@
        <!-- maintainer-needed -->
        <use>
                <flag name="client">Build and install Snapcast client 
component</flag>
+               <flag name="pipewire">Build with PipeWire support</flag>
                <flag name="server">Build and install Snapcast server 
component</flag>
+               <flag name="soxr">Build with audio resampler support with 
<pkg>media-libs/soxr</pkg></flag>
                <flag name="tremor">Build with TREMOR version of vorbis</flag>
        </use>
        <upstream>
@@ -12,8 +14,8 @@
                        <name>Johannes Pohl</name>
                        <email>[email protected]</email>
                </maintainer>
-               <bugs-to>https://github.com/badaix/snapcast/issues</bugs-to>
-               <remote-id type="github">badaix/snapcast</remote-id>
+               <bugs-to>https://github.com/snapcast/snapcast/issues</bugs-to>
+               <remote-id type="github">snapcast/snapcast</remote-id>
        </upstream>
        <longdescription lang="en">
                Snapcast plays audio streams time sychronized on multiple 
devices over 

diff --git a/media-sound/snapcast/snapcast-0.34.0.ebuild 
b/media-sound/snapcast/snapcast-0.34.0.ebuild
new file mode 100644
index 000000000000..77afff286a34
--- /dev/null
+++ b/media-sound/snapcast/snapcast-0.34.0.ebuild
@@ -0,0 +1,151 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{11..14} )
+inherit cmake edo optfeature python-single-r1 systemd
+
+DESCRIPTION="Synchronous multi-room audio player"
+HOMEPAGE="https://github.com/snapcast/snapcast";
+SRC_URI="https://github.com/snapcast/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~riscv ~x86"
+IUSE="alsa +client +expat +flac jack +opus pipewire python +server soxr ssl 
test tremor +vorbis +zeroconf"
+REQUIRED_USE="
+       || ( server client )
+       server? (
+               python? ( ${PYTHON_REQUIRED_USE} )
+       )
+"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       alsa? ( media-libs/alsa-lib )
+       client? (
+               acct-user/snapclient
+               tremor? (
+                       media-libs/libogg
+                       media-libs/tremor
+               )
+       )
+       flac? ( media-libs/flac:= )
+       jack? ( virtual/jack )
+       opus? ( media-libs/opus )
+       pipewire? ( media-video/pipewire:= )
+       server? (
+               acct-group/snapserver
+               >=acct-user/snapserver-0-r3
+               expat? ( dev-libs/expat )
+               python? ( ${PYTHON_DEPS} )
+       )
+       soxr? ( media-libs/soxr )
+       ssl? ( dev-libs/openssl:= )
+       vorbis? (
+               media-libs/libogg
+               media-libs/libvorbis
+       )
+       zeroconf? ( net-dns/avahi[dbus] )
+"
+DEPEND="
+       ${RDEPEND}
+       dev-cpp/nlohmann_json
+       dev-libs/boost:=
+       jack? ( dev-libs/boost:=[context] )
+       test? (
+               >=dev-cpp/catch-3:0
+               dev-libs/openssl
+       )
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.34.0-snapclient_group.patch
+       "${FILESDIR}"/${PN}-0.34.0-opt_soxr.patch
+       "${FILESDIR}"/${PN}-0.34.0-drop-lint.patch
+)
+
+pkg_setup() {
+       use server && use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+       # 3rd-party
+       rm common/json.hpp || die
+       sed -e 's@"common/json.hpp"@<nlohmann/json.hpp>@' \
+               -i common/message/json_message.hpp \
+               -i common/stream_uri.hpp \
+               -i server/control_server.cpp \
+               -i server/streamreader/metadata.hpp \
+               -i server/streamreader/pcm_stream.hpp \
+               -i server/streamreader/properties.hpp \
+               -i server/config.hpp \
+               -i server/jsonrpcpp.hpp \
+               -i server/jwt.hpp || die
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -DBUILD_CLIENT=$(usex client)
+               -DBUILD_SERVER=$(usex server)
+               -DBUILD_STATIC_LIBS=no
+               -DBUILD_TESTS=$(usex test)
+               -DCMAKE_INSTALL_SYSCONFDIR="${EPREFIX}/etc"
+               -DBUILD_WITH_ALSA=$(usex alsa)
+               -DBUILD_WITH_AVAHI=$(usex zeroconf)
+               -DBUILD_WITH_EXPAT=$(usex expat)
+               -DBUILD_WITH_FLAC=$(usex flac)
+               -DBUILD_WITH_JACK=$(usex jack)
+               -DBUILD_WITH_OPUS=$(usex opus)
+               -DBUILD_WITH_PIPEWIRE=$(usex pipewire)
+               -DBUILD_WITH_SOXR=$(usex soxr)
+               -DBUILD_WITH_SSL=$(usex ssl)
+               -DBUILD_WITH_TREMOR=$(usex tremor)
+               -DBUILD_WITH_VORBIS=$(usex vorbis)
+       )
+
+       cmake_src_configure
+}
+
+src_test() {
+       edo "${S}"/bin/snapcast_test
+}
+
+src_install() {
+       cmake_src_install
+
+       local bin
+       for bin in server client ; do
+               if use ${bin} ; then
+                       doman ${bin}/snap${bin}.1
+
+                       newconfd "${FILESDIR}"/snap${bin}.confd-r1 snap${bin}
+                       newinitd "${FILESDIR}"/snap${bin}.initd-r1 snap${bin}
+                       systemd_dounit extras/package/rpm/snap${bin}.service
+               fi
+       done
+
+       if use server; then
+               if use python; then
+                       python_fix_shebang "${ED}"/usr/share/snapserver/plug-ins
+               else
+                       rm "${ED}"/usr/share/snapserver/plug-ins/*.py || die
+               fi
+       fi
+}
+
+pkg_postinst() {
+       if use client && ! use zeroconf; then
+               ewarn "zeroconf is disabled but the url by default is 
'tcp://_snapcast._tcp'."
+               ewarn "Please define an url in SNAPCLIENT_OPTS into 
${EROOT}/etc/conf.d/snapclient"
+       fi
+       if use server && use python; then
+               optfeature "librespot stream plugin" 
dev-python/websocket-client dev-python/requests
+               optfeature "mopidy stream plugin" dev-python/websocket-client
+               optfeature "mpd stream plugin" dev-python/dbus-python 
dev-python/musicbrainzngs
+               optfeature "mpd stream plugin" dev-python/pygobject 
dev-python/python-mpd2
+       fi
+}

Reply via email to