From 9124ba212dc80090e0109b3a81176fff676565be Mon Sep 17 00:00:00 2001 From: edward-p Date: Wed, 11 Jul 2018 03:29:45 +0800 Subject: [PATCH 1/4] Add packages: pianobar, libao --- packages/libao/ao_private.h.patch | 11 +++++ packages/libao/build.sh | 24 +++++++++++ packages/libao/configure.ac.patch | 67 +++++++++++++++++++++++++++++++ packages/pianobar/Makefile.patch | 19 +++++++++ packages/pianobar/build.sh | 9 +++++ 5 files changed, 130 insertions(+) create mode 100644 packages/libao/ao_private.h.patch create mode 100644 packages/libao/build.sh create mode 100644 packages/libao/configure.ac.patch create mode 100644 packages/pianobar/Makefile.patch create mode 100644 packages/pianobar/build.sh diff --git a/packages/libao/ao_private.h.patch b/packages/libao/ao_private.h.patch new file mode 100644 index 00000000000000..f7511a59cbe64d --- /dev/null +++ b/packages/libao/ao_private.h.patch @@ -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 "/data/data/com.termux/files/user/etc/libao.conf" + #endif + #ifndef AO_USER_CONFIG + #define AO_USER_CONFIG "/.libao" diff --git a/packages/libao/build.sh b/packages/libao/build.sh new file mode 100644 index 00000000000000..07c3dbf67b76c4 --- /dev/null +++ b/packages/libao/build.sh @@ -0,0 +1,24 @@ +TERMUX_PKG_HOMEPAGE=https://www.xiph.org/ao/ +TERMUX_PKG_DESCRIPTION="A cross platform audio library" +TERMUX_PKG_VERSION=1.2.2 +TERMUX_PKG_REVISION=1 +TERMUX_PKG_SHA256=df8a6d0e238feeccb26a783e778716fb41a801536fe7b6fce068e313c0e2bf4d +TERMUX_PKG_SRCURL=https://github.com/xiph/libao/archive/${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_DEPENDS="libpulseaudio" +TERMUX_PKG_BUILD_DEPENDS="libpulseaudio-dev" +TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-pulse" +TERMUX_PKG_CONFFILES="etc/libao.conf" + +termux_step_pre_configure () { + ./autogen.sh + local LIBAO_LDFLAGS+=" -lpulse" +} + +termux_step_post_make_install () { + #genrate libao config file + mkdir -p $TERMUX_PREFIX/etc/ + cat << EOF > $TERMUX_PREFIX/etc/libao.conf +default_driver=pulse +quiet +EOF +} diff --git a/packages/libao/configure.ac.patch b/packages/libao/configure.ac.patch new file mode 100644 index 00000000000000..13c673d2b3acd2 --- /dev/null +++ b/packages/libao/configure.ac.patch @@ -0,0 +1,67 @@ +--- ../cache/libao-1.2.2/configure.ac 2016-11-14 16:03:30.000000000 +0800 ++++ ./configure.ac 2018-07-11 00:42:17.741867477 +0800 +@@ -38,7 +38,7 @@ + AM_PROG_LIBTOOL + + dnl ==================================== +-dnl Check dlopen ++dnl Check dlopen + dnl ==================================== + + dnl Currently use this to disable plugin support dlfcn.h +@@ -113,8 +113,8 @@ + *-mingw*|*-cygwin*) + LIBAO_LA_LDFLAGS="-no-undefined" + ;; +- *) +- LIBAO_LA_LDFLAGS="" ++ *) ++ LIBAO_LA_LDFLAGS="-lpulse" + ;; + esac + AC_SUBST(LIBAO_LA_LDFLAGS) +@@ -153,7 +153,7 @@ + *hpux*) + DLOPEN_FLAG='(RTLD_LAZY)' + SHARED_LIB_EXT='.sl' +- ;; ++ ;; + *openbsd* | *netbsd* | *solaris2.7 | *darwin*) + DLOPEN_FLAG='(RTLD_LAZY)' + SHARED_LIB_EXT='.so' +@@ -196,7 +196,7 @@ + AC_SUBST(SIZE32) + + dnl ====================================== +-dnl Disable default use of SLP in roar ++dnl Disable default use of SLP in roar + dnl until such time as SLP doesn't block + dnl indefinitely + dnl ====================================== +@@ -214,7 +214,7 @@ + AC_SUBST([SLP_DEF]) + + dnl ====================================== +-dnl Detect possible output devices ++dnl Detect possible output devices + dnl ====================================== + + dnl Check for WMM +@@ -311,7 +311,7 @@ + AC_DEFINE(BROKEN_OSS) + AC_MSG_WARN(Broken OSS API workaround enabled. See README for details.) + fi +- ++ + dnl Check for Sun audio + + have_sun="no"; +@@ -426,7 +426,7 @@ + AC_PATH_XTRA + AC_CHECK_LIB(Xau, XauFileName, have_nas=yes, have_nas=no, $X_LIBS) + AC_CHECK_LIB(audio, AuOpenServer, dummy="no-op", have_nas=no, -lXau $X_LIBS) +- ++ + ac_save_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + AC_CHECK_HEADER(audio/audiolib.h, dummy="no-op", have_nas=no) diff --git a/packages/pianobar/Makefile.patch b/packages/pianobar/Makefile.patch new file mode 100644 index 00000000000000..eb003be9dde5f9 --- /dev/null +++ b/packages/pianobar/Makefile.patch @@ -0,0 +1,19 @@ +--- ../cache/pianobar-2018.06.22/Makefile 2018-06-22 14:57:26.000000000 +0800 ++++ ./Makefile 2018-07-11 03:09:11.466864807 +0800 +@@ -1,6 +1,6 @@ + # makefile of pianobar + +-PREFIX:=/usr/local ++PREFIX:=/data/data/com.termux/files/usr + 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} diff --git a/packages/pianobar/build.sh b/packages/pianobar/build.sh new file mode 100644 index 00000000000000..b5095c5ab7ac0b --- /dev/null +++ b/packages/pianobar/build.sh @@ -0,0 +1,9 @@ +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_VERSION=2018.06.22 +TERMUX_PKG_REVISION=1 +TERMUX_PKG_SHA256=a616ef70c04ceea8294caaba091d6a16bf35293bdc587151a235fb0e6a00ad90 +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-dev, ffmpeg-dev, libgcrypt-dev, libcurl-dev, json-c-dev, pkg-config" +TERMUX_PKG_BUILD_IN_SRC=yes From e1372c9c4d44e45f02ddf0a6995132f1f82f9ab7 Mon Sep 17 00:00:00 2001 From: edward-p Date: Wed, 11 Jul 2018 07:53:30 +0800 Subject: [PATCH 2/4] fix some typo --- packages/libao/ao_private.h.patch | 2 +- packages/libao/build.sh | 5 ++--- packages/pianobar/Makefile.patch | 2 +- packages/pianobar/build.sh | 2 +- 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/libao/ao_private.h.patch b/packages/libao/ao_private.h.patch index f7511a59cbe64d..a61d3e0ce2653e 100644 --- a/packages/libao/ao_private.h.patch +++ b/packages/libao/ao_private.h.patch @@ -5,7 +5,7 @@ #ifndef AO_SYSTEM_CONFIG -#define AO_SYSTEM_CONFIG "/etc/libao.conf" -+#define AO_SYSTEM_CONFIG "/data/data/com.termux/files/user/etc/libao.conf" ++#define AO_SYSTEM_CONFIG "@TERMUX_PREFIX@/etc/libao.conf" #endif #ifndef AO_USER_CONFIG #define AO_USER_CONFIG "/.libao" diff --git a/packages/libao/build.sh b/packages/libao/build.sh index 07c3dbf67b76c4..b516f45639ff55 100644 --- a/packages/libao/build.sh +++ b/packages/libao/build.sh @@ -1,7 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://www.xiph.org/ao/ TERMUX_PKG_DESCRIPTION="A cross platform audio library" TERMUX_PKG_VERSION=1.2.2 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=0 TERMUX_PKG_SHA256=df8a6d0e238feeccb26a783e778716fb41a801536fe7b6fce068e313c0e2bf4d TERMUX_PKG_SRCURL=https://github.com/xiph/libao/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libpulseaudio" @@ -11,11 +11,10 @@ TERMUX_PKG_CONFFILES="etc/libao.conf" termux_step_pre_configure () { ./autogen.sh - local LIBAO_LDFLAGS+=" -lpulse" } termux_step_post_make_install () { - #genrate libao config file + #generate libao config file mkdir -p $TERMUX_PREFIX/etc/ cat << EOF > $TERMUX_PREFIX/etc/libao.conf default_driver=pulse diff --git a/packages/pianobar/Makefile.patch b/packages/pianobar/Makefile.patch index eb003be9dde5f9..9f4a43bfa57ed7 100644 --- a/packages/pianobar/Makefile.patch +++ b/packages/pianobar/Makefile.patch @@ -4,7 +4,7 @@ # makefile of pianobar -PREFIX:=/usr/local -+PREFIX:=/data/data/com.termux/files/usr ++PREFIX:=@TERMUX_PREFIX@ BINDIR:=${PREFIX}/bin LIBDIR:=${PREFIX}/lib INCDIR:=${PREFIX}/include diff --git a/packages/pianobar/build.sh b/packages/pianobar/build.sh index b5095c5ab7ac0b..b9879ea1c373f0 100644 --- a/packages/pianobar/build.sh +++ b/packages/pianobar/build.sh @@ -1,7 +1,7 @@ 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_VERSION=2018.06.22 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=0 TERMUX_PKG_SHA256=a616ef70c04ceea8294caaba091d6a16bf35293bdc587151a235fb0e6a00ad90 TERMUX_PKG_SRCURL=https://github.com/PromyLOPh/pianobar/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="libao, ffmpeg, libgcrypt, libcurl, json-c" From 485d62a7fc282f245e5a4bc63afc40c6ae2de0dc Mon Sep 17 00:00:00 2001 From: edward-p Date: Wed, 11 Jul 2018 14:21:10 +0800 Subject: [PATCH 3/4] fix no sound issue when pulseaudio started by libao --- packages/pianobar/Makefile.patch | 8 +++++--- packages/pianobar/build.sh | 8 ++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/pianobar/Makefile.patch b/packages/pianobar/Makefile.patch index 9f4a43bfa57ed7..cb88eb48ab6c53 100644 --- a/packages/pianobar/Makefile.patch +++ b/packages/pianobar/Makefile.patch @@ -1,13 +1,15 @@ --- ../cache/pianobar-2018.06.22/Makefile 2018-06-22 14:57:26.000000000 +0800 -+++ ./Makefile 2018-07-11 03:09:11.466864807 +0800 -@@ -1,6 +1,6 @@ ++++ ./Makefile 2018-07-11 14:03:45.245628019 +0800 +@@ -1,7 +1,7 @@ # makefile of pianobar -PREFIX:=/usr/local +-BINDIR:=${PREFIX}/bin +PREFIX:=@TERMUX_PREFIX@ - BINDIR:=${PREFIX}/bin ++BINDIR:=${PREFIX}/libexec LIBDIR:=${PREFIX}/lib INCDIR:=${PREFIX}/include + MANDIR:=${PREFIX}/share/man @@ -64,7 +64,7 @@ ${LIBAV_CFLAGS} ${LIBCURL_CFLAGS} \ ${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} \ diff --git a/packages/pianobar/build.sh b/packages/pianobar/build.sh index b9879ea1c373f0..87d075dc48d0a5 100644 --- a/packages/pianobar/build.sh +++ b/packages/pianobar/build.sh @@ -7,3 +7,11 @@ TERMUX_PKG_SRCURL=https://github.com/PromyLOPh/pianobar/archive/${TERMUX_PKG_VER TERMUX_PKG_DEPENDS="libao, ffmpeg, libgcrypt, libcurl, json-c" TERMUX_PKG_BUILD_DEPENDS="libao-dev, ffmpeg-dev, libgcrypt-dev, libcurl-dev, json-c-dev, pkg-config" TERMUX_PKG_BUILD_IN_SRC=yes + +termux_step_post_make_install () { + #fix no sound issue when pulseaudio started by libao + cat $TERMUX_PREFIX/bin/pulseaudio \ + | sed 's/pulseaudio\ \$@/pianobar\ \$@/' \ + > $TERMUX_PREFIX/bin/pianobar + chmod +x $TERMUX_PREFIX/bin/pianobar +} From 9408badd3bd15191aa5b2f533867f062fafa4548 Mon Sep 17 00:00:00 2001 From: edward-p Date: Wed, 11 Jul 2018 17:44:34 +0800 Subject: [PATCH 4/4] add missing depends:pulseaudio for libao --- packages/libao/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/libao/build.sh b/packages/libao/build.sh index b516f45639ff55..71f456336e2fc0 100644 --- a/packages/libao/build.sh +++ b/packages/libao/build.sh @@ -4,7 +4,7 @@ TERMUX_PKG_VERSION=1.2.2 TERMUX_PKG_REVISION=0 TERMUX_PKG_SHA256=df8a6d0e238feeccb26a783e778716fb41a801536fe7b6fce068e313c0e2bf4d TERMUX_PKG_SRCURL=https://github.com/xiph/libao/archive/${TERMUX_PKG_VERSION}.tar.gz -TERMUX_PKG_DEPENDS="libpulseaudio" +TERMUX_PKG_DEPENDS="pulseaudio, libpulseaudio" TERMUX_PKG_BUILD_DEPENDS="libpulseaudio-dev" TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--enable-pulse" TERMUX_PKG_CONFFILES="etc/libao.conf"