From 967f702fb7fd6be7ab82e08b9d5f8980aee1588a Mon Sep 17 00:00:00 2001 From: Tee KOBAYASHI Date: Sun, 30 Jan 2022 06:26:47 +0900 Subject: [PATCH] snapcast-server: Add subpackage snapcast-client --- packages/snapcast-server/build.sh | 8 +++-- .../client-CMakeLists.txt.patch | 29 +++++++++++++++++++ .../client-snapclient.cpp.patch | 11 +++++++ .../snapcast-client.subpackage.sh | 8 +++++ 4 files changed, 54 insertions(+), 2 deletions(-) create mode 100644 packages/snapcast-server/client-CMakeLists.txt.patch create mode 100644 packages/snapcast-server/client-snapclient.cpp.patch create mode 100644 packages/snapcast-server/snapcast-client.subpackage.sh diff --git a/packages/snapcast-server/build.sh b/packages/snapcast-server/build.sh index e7dc66bea..287190b5d 100644 --- a/packages/snapcast-server/build.sh +++ b/packages/snapcast-server/build.sh @@ -1,13 +1,17 @@ TERMUX_PKG_HOMEPAGE=https://github.com/badaix/snapcast -TERMUX_PKG_DESCRIPTION="A multiroom client-server audio player" +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=1 TERMUX_PKG_SRCURL=https://github.com/badaix/snapcast/archive/v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=c4e449cb693e091261727421f4965492be049632537e034fa9c59c92d091a846 TERMUX_PKG_DEPENDS="libc++, libexpat, libflac, libopus, libsoxr, libvorbis" TERMUX_PKG_BUILD_DEPENDS="boost" -TERMUX_PKG_EXTRA_CONFIGURE_ARGS="-DBUILD_CLIENT=OFF -DBUILD_TESTS=OFF" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS=" +-DBUILD_TESTS=OFF +-DBoost_INCLUDE_DIR=$TERMUX_PREFIX/include +" termux_step_pre_configure() { LDFLAGS+=" -llog" diff --git a/packages/snapcast-server/client-CMakeLists.txt.patch b/packages/snapcast-server/client-CMakeLists.txt.patch new file mode 100644 index 000000000..6d3300700 --- /dev/null +++ b/packages/snapcast-server/client-CMakeLists.txt.patch @@ -0,0 +1,29 @@ +--- a/client/CMakeLists.txt ++++ b/client/CMakeLists.txt +@@ -33,7 +33,7 @@ + elseif (WIN32) + list(APPEND CLIENT_SOURCES player/wasapi_player.cpp) + list(APPEND CLIENT_LIBRARIES wsock32 ws2_32 avrt ksuser iphlpapi) +-elseif(NOT ANDROID) ++elseif(TRUE) + # Avahi + if (AVAHI_FOUND) + list(APPEND CLIENT_SOURCES browseZeroConf/browse_avahi.cpp) +@@ -55,7 +55,7 @@ + endif (PULSE_FOUND) + endif (MACOSX) + +-if (ANDROID) ++if (FALSE) + list(APPEND CLIENT_LIBRARIES oboe::oboe) + list(APPEND CLIENT_LIBRARIES boost::boost) + list(APPEND CLIENT_LIBRARIES flac::flac) +@@ -100,7 +100,7 @@ + endif() + + include_directories(${CLIENT_INCLUDE}) +-if (ANDROID) ++if (FALSE) + add_executable(libsnapclient.so ${CLIENT_SOURCES}) + target_link_libraries(libsnapclient.so ${CLIENT_LIBRARIES} log OpenSLES) + else() diff --git a/packages/snapcast-server/client-snapclient.cpp.patch b/packages/snapcast-server/client-snapclient.cpp.patch new file mode 100644 index 000000000..622c48704 --- /dev/null +++ b/packages/snapcast-server/client-snapclient.cpp.patch @@ -0,0 +1,11 @@ +--- a/client/snapclient.cpp ++++ b/client/snapclient.cpp +@@ -312,7 +312,7 @@ + std::unique_ptr daemon; + if (daemonOption->is_set()) + { +- string pidFile = "/var/run/snapclient/pid"; ++ string pidFile = "@TERMUX_PREFIX@/var/run/snapclient/pid"; + if (settings.instance != 1) + pidFile += "." + cpt::to_string(settings.instance); + string user; diff --git a/packages/snapcast-server/snapcast-client.subpackage.sh b/packages/snapcast-server/snapcast-client.subpackage.sh new file mode 100644 index 000000000..3850820c9 --- /dev/null +++ b/packages/snapcast-server/snapcast-client.subpackage.sh @@ -0,0 +1,8 @@ +TERMUX_SUBPKG_INCLUDE=" +bin/snapclient +share/man/man1/snapclient.1.gz +share/pixmaps/snapcast.svg +" +TERMUX_SUBPKG_DESCRIPTION="A multiroom client-server audio player (client)" +TERMUX_SUBPKG_DEPENDS="avahi, pulseaudio" +TERMUX_SUBPKG_DEPEND_ON_PARENT=deps