From c69deee0c5702070b1e7c4d9e9c64c543f4e067a Mon Sep 17 00:00:00 2001 From: Aditya Alok Date: Fri, 15 Apr 2022 01:54:46 +0530 Subject: [PATCH] feat(snapcast-server): enable auto-update, upgrade to 0.26.0 Signed-off-by: Aditya Alok --- packages/snapcast-server/CMakeLists.txt.patch | 17 ++++++------- packages/snapcast-server/build.sh | 6 ++--- .../client-snapclient.cpp.patch | 6 ++--- .../server-CMakeLists.txt.patch | 24 +++++++++++++++++++ .../server-etc-snapserver.conf.patch | 8 +++---- .../snapcast-server/test-test_main.cpp.patch | 12 +++++----- 6 files changed, 49 insertions(+), 24 deletions(-) create mode 100644 packages/snapcast-server/server-CMakeLists.txt.patch diff --git a/packages/snapcast-server/CMakeLists.txt.patch b/packages/snapcast-server/CMakeLists.txt.patch index 58612e491..d8274a453 100644 --- a/packages/snapcast-server/CMakeLists.txt.patch +++ b/packages/snapcast-server/CMakeLists.txt.patch @@ -1,14 +1,14 @@ ---- a/CMakeLists.txt -+++ b/CMakeLists.txt +--- a/CMakeLists.txt 2022-04-15 02:22:36.772384329 +0530 ++++ b/CMakeLists.txt 2022-04-15 03:22:33.096962106 +0530 @@ -91,11 +91,6 @@ if (BUILD_CLIENT) message(FATAL_ERROR "Snapclient not yet supported for FreeBSD, use \"-DBUILD_CLIENT=OFF\"") endif() -elseif (${CMAKE_SYSTEM_NAME} MATCHES "Android") - set (ANDROID TRUE) -- if (BUILD_SERVER) -- message(FATAL_ERROR "Snapserver not yet supported for Android, use \"-DBUILD_SERVER=OFF\"") -- endif() +-# if (BUILD_SERVER) +-# message(FATAL_ERROR "Snapserver not yet supported for Android, use \"-DBUILD_SERVER=OFF\"") +-# endif() endif() # Configure paths @@ -30,7 +30,7 @@ if(MACOSX) set(BONJOUR_FOUND true) -@@ -178,11 +173,6 @@ +@@ -178,11 +173,7 @@ list(APPEND INCLUDE_DIRS "/usr/local/include") else() @@ -39,15 +39,16 @@ - add_definitions(-DHAS_ALSA) - endif (ALSA_FOUND) - ++ if(BUILD_WITH_PULSE) pkg_search_module(PULSE libpulse) if (PULSE_FOUND) -@@ -279,7 +269,7 @@ +@@ -279,7 +270,7 @@ endif() endif() -if(NOT ANDROID) +if(TRUE) - find_package(Boost 1.70 REQUIRED) + find_package(Boost 1.74 REQUIRED) else() find_package(oboe REQUIRED CONFIG) diff --git a/packages/snapcast-server/build.sh b/packages/snapcast-server/build.sh index db056eedb..70bc78baa 100644 --- a/packages/snapcast-server/build.sh +++ b/packages/snapcast-server/build.sh @@ -2,16 +2,16 @@ TERMUX_PKG_HOMEPAGE=https://github.com/badaix/snapcast TERMUX_PKG_DESCRIPTION="A multiroom client-server audio player (server)" TERMUX_PKG_LICENSE="GPL-3.0" TERMUX_PKG_MAINTAINER="@termux" -TERMUX_PKG_VERSION=0.25.0 -TERMUX_PKG_REVISION=3 +TERMUX_PKG_VERSION=0.26.0 TERMUX_PKG_SRCURL=https://github.com/badaix/snapcast/archive/v${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_SHA256=c4e449cb693e091261727421f4965492be049632537e034fa9c59c92d091a846 +TERMUX_PKG_SHA256=166353267a5c461a3a0e7cbd05d78c4bfdaebeda078801df3b76820b54f27683 TERMUX_PKG_DEPENDS="libc++, libexpat, libflac, libopus, libsoxr, libvorbis" TERMUX_PKG_BUILD_DEPENDS="boost, boost-headers" TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" -DBUILD_TESTS=OFF -DBoost_INCLUDE_DIR=$TERMUX_PREFIX/include " +TERMUX_PKG_AUTO_UPDATE=true termux_step_pre_configure() { LDFLAGS+=" -llog" diff --git a/packages/snapcast-server/client-snapclient.cpp.patch b/packages/snapcast-server/client-snapclient.cpp.patch index 622c48704..5e0a84a95 100644 --- a/packages/snapcast-server/client-snapclient.cpp.patch +++ b/packages/snapcast-server/client-snapclient.cpp.patch @@ -1,6 +1,6 @@ ---- a/client/snapclient.cpp -+++ b/client/snapclient.cpp -@@ -312,7 +312,7 @@ +--- a/client/snapclient.cpp 2022-04-15 02:22:36.712384329 +0530 ++++ b/client/snapclient.cpp 2022-04-15 02:23:43.542384304 +0530 +@@ -308,7 +308,7 @@ std::unique_ptr daemon; if (daemonOption->is_set()) { diff --git a/packages/snapcast-server/server-CMakeLists.txt.patch b/packages/snapcast-server/server-CMakeLists.txt.patch new file mode 100644 index 000000000..ebbcc369b --- /dev/null +++ b/packages/snapcast-server/server-CMakeLists.txt.patch @@ -0,0 +1,24 @@ +--- a/server/CMakeLists.txt 2022-04-15 02:22:36.942384329 +0530 ++++ b/server/CMakeLists.txt 2022-04-15 04:16:58.176960860 +0530 +@@ -41,7 +41,7 @@ + ${CMAKE_SOURCE_DIR}/server + ${CMAKE_SOURCE_DIR}/common) + +-if (ANDROID) ++if (FALSE) + find_package(vorbis REQUIRED CONFIG) + list(APPEND SERVER_LIBRARIES boost::boost) + list(APPEND SERVER_LIBRARIES flac::flac) +@@ -90,12 +90,6 @@ + list(APPEND SERVER_INCLUDE ${OPUS_INCLUDE_DIRS}) + endif (OPUS_FOUND) + +- if (ALSA_FOUND) +- list(APPEND SERVER_SOURCES streamreader/alsa_stream.cpp) +- list(APPEND SERVER_LIBRARIES ${ALSA_LIBRARIES}) +- list(APPEND SERVER_INCLUDE ${ALSA_INCLUDE_DIRS}) +- endif (ALSA_FOUND) +- + if (EXPAT_FOUND) + list(APPEND SERVER_LIBRARIES ${EXPAT_LIBRARIES}) + list(APPEND SERVER_INCLUDE ${EXPAT_INCLUDE_DIRS}) diff --git a/packages/snapcast-server/server-etc-snapserver.conf.patch b/packages/snapcast-server/server-etc-snapserver.conf.patch index 2ddefb94d..ed7d634ab 100644 --- a/packages/snapcast-server/server-etc-snapserver.conf.patch +++ b/packages/snapcast-server/server-etc-snapserver.conf.patch @@ -24,10 +24,10 @@ # disabled if commented or empty -doc_root = /usr/share/snapserver/snapweb +doc_root = @TERMUX_PREFIX@/share/snapserver/snapweb - # - ############################################################################### -@@ -127,7 +127,7 @@ + # Hostname or IP under which clients can reach this host + # used to serve cached cover art +@@ -133,7 +133,7 @@ # tcp client: tcp://:?name=&mode=client # alsa: alsa://?name=&device=[&send_silence=false][&idle_threshold=100][&silence_threshold_percent=0.0] # meta: meta://///.../?name= @@ -35,4 +35,4 @@ +source = pipe://@TERMUX_PREFIX@/tmp/snapfifo?name=default #source = tcp://127.0.0.1?name=mopidy_tcp - # Default sample format + # Default sample format: :: diff --git a/packages/snapcast-server/test-test_main.cpp.patch b/packages/snapcast-server/test-test_main.cpp.patch index cd05bb349..984ce7cd9 100644 --- a/packages/snapcast-server/test-test_main.cpp.patch +++ b/packages/snapcast-server/test-test_main.cpp.patch @@ -1,14 +1,14 @@ ---- a/test/test_main.cpp -+++ b/test/test_main.cpp -@@ -36,9 +36,9 @@ +--- a/test/test_main.cpp 2022-04-15 02:22:36.962384329 +0530 ++++ b/test/test_main.cpp 2022-04-15 02:41:15.916963051 +0530 +@@ -41,9 +41,9 @@ { AixLog::Log::init(AixLog::Severity::debug); using namespace streamreader; - StreamUri uri("pipe:///tmp/snapfifo?name=default&codec=flac"); + StreamUri uri("pipe://@TERMUX_PREFIX@/tmp/snapfifo?name=default&codec=flac"); - REQUIRE(uri.scheme == "pipe"); -- REQUIRE(uri.path == "/tmp/snapfifo"); -+ REQUIRE(uri.path == "@TERMUX_PREFIX@/tmp/snapfifo"); + REQUIRE(uri.scheme == "pipe"); +- REQUIRE(uri.path == "/tmp/snapfifo"); ++ REQUIRE(uri.path == "@TERMUX_PREFIX@/tmp/snapfifo"); REQUIRE(uri.host.empty()); // uri = StreamUri("scheme:[//host[:port]][/]path[?query=none][#fragment]");