Add packages: pianobar, libao (#2744)

%ci:reset-backlog
This commit is contained in:
Edward P 2019-09-23 06:30:54 +08:00 committed by Leonid Pliushch
parent b5e9d1ee89
commit 1e62990362
6 changed files with 105 additions and 0 deletions

View File

@ -0,0 +1,11 @@
--- ../cache/libao-1.2.2/include/ao/ao_private.h 2016-11-14 16:03:30.000000000 +0000
+++ ./include/ao/ao_private.h 2018-07-10 21:09:26.757188903 +0000
@@ -51,7 +51,7 @@
/* --- Constants --- */
#ifndef AO_SYSTEM_CONFIG
-#define AO_SYSTEM_CONFIG "/etc/libao.conf"
+#define AO_SYSTEM_CONFIG "@TERMUX_PREFIX@/etc/libao.conf"
#endif
#ifndef AO_USER_CONFIG
#define AO_USER_CONFIG "/.libao"

View File

@ -0,0 +1,27 @@
--- ../cache/libao-1.2.2/src/plugins/pulse/ao_pulse.c 2016-11-14 16:03:30.000000000 +0800
+++ ./src/plugins/pulse/ao_pulse.c 2018-08-02 00:59:31.723282524 +0800
@@ -40,7 +40,7 @@
#include <ao/ao.h>
#include <ao/plugin.h>
-#define AO_PULSE_BUFFER_TIME 20000
+#define AO_PULSE_BUFFER_TIME 50000
/* Unfortunately libao doesn't allow "const" for these structures... */
static char * ao_pulse_options[] = {
@@ -255,12 +255,10 @@
}
/* buffering attributes */
- battr.prebuf = battr.minreq = battr.fragsize = -1;
+ battr.prebuf = battr.minreq = battr.fragsize = battr.maxlength = -1;
- battr.tlength = (int)(internal->buffer_time * format->rate) / 1000000 *
- ((format->bits+7)/8) * device->output_channels;
- battr.minreq = battr.tlength/4;
- battr.maxlength = battr.tlength+battr.minreq;
+ battr.tlength = internal->buffer_time * format->rate / 1000000 *
+ (format->bits / 8) * device->output_channels;
internal->simple = pa_simple_new(internal->server, t, PA_STREAM_PLAYBACK,
internal->sink, t2, &ss,

23
packages/libao/build.sh Normal file
View File

@ -0,0 +1,23 @@
TERMUX_PKG_HOMEPAGE=https://www.xiph.org/ao/
TERMUX_PKG_DESCRIPTION="A cross platform audio library"
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_VERSION=1.2.2
TERMUX_PKG_SHA256=df8a6d0e238feeccb26a783e778716fb41a801536fe7b6fce068e313c0e2bf4d
TERMUX_PKG_SRCURL=https://github.com/xiph/libao/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="pulseaudio, libpulseaudio"
TERMUX_PKG_BUILD_DEPENDS="libpulseaudio"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-pulse"
TERMUX_PKG_CONFFILES="etc/libao.conf"
termux_step_pre_configure () {
./autogen.sh
}
termux_step_post_make_install () {
#generate libao config file
mkdir -p $TERMUX_PREFIX/etc/
cat << EOF > $TERMUX_PREFIX/etc/libao.conf
default_driver=pulse
quiet
EOF
}

View File

@ -0,0 +1,11 @@
--- ../cache/libao-1.2.2/configure.ac 2016-11-14 16:03:30.000000000 +0800
+++ ./configure.ac 2018-08-03 00:58:07.600931951 +0800
@@ -114,7 +114,7 @@
LIBAO_LA_LDFLAGS="-no-undefined"
;;
*)
- LIBAO_LA_LDFLAGS=""
+ LIBAO_LA_LDFLAGS="-lpulse"
;;
esac
AC_SUBST(LIBAO_LA_LDFLAGS)

View File

@ -0,0 +1,19 @@
--- ../cache/pianobar-2018.06.22/Makefile 2018-06-22 14:57:26.000000000 +0800
+++ ./Makefile 2018-08-15 19:56:31.529627505 +0800
@@ -1,6 +1,6 @@
# makefile of pianobar
-PREFIX:=/usr/local
+PREFIX:=@TERMUX_PREFIX@
BINDIR:=${PREFIX}/bin
LIBDIR:=${PREFIX}/lib
INCDIR:=${PREFIX}/include
@@ -64,7 +64,7 @@
${LIBAV_CFLAGS} ${LIBCURL_CFLAGS} \
${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} \
${LIBAO_CFLAGS}
-ALL_LDFLAGS:=${LDFLAGS} -lpthread -lm \
+ALL_LDFLAGS:=${LDFLAGS} -lm \
${LIBAV_LDFLAGS} ${LIBCURL_LDFLAGS} \
${LIBGCRYPT_LDFLAGS} ${LIBJSONC_LDFLAGS} \
${LIBAO_LDFLAGS}

View File

@ -0,0 +1,14 @@
TERMUX_PKG_HOMEPAGE=https://6xq.net/pianobar/
TERMUX_PKG_DESCRIPTION="pianobar is a free/open-source, console-based client for the personalized online radio Pandora."
TERMUX_PKG_LICENSE="MIT"
TERMUX_PKG_VERSION=2019.02.14
TERMUX_PKG_SHA256=415858f8bf938a84af06b15fd49daa49fd2089f3c66f55356c0987ac4fce20d7
TERMUX_PKG_SRCURL=https://github.com/PromyLOPh/pianobar/archive/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_DEPENDS="libao, ffmpeg, libgcrypt, libcurl, json-c"
TERMUX_PKG_BUILD_DEPENDS="libao, ffmpeg, libgcrypt, libcurl, json-c"
TERMUX_PKG_BUILD_IN_SRC=true
termux_step_post_make_install(){
#install useful script
install -Dm755 "$TERMUX_PKG_SRCDIR"/contrib/headless_pianobar "$TERMUX_PREFIX"/bin/pianoctl
}