termux-packages/packages/libpulseaudio/build.sh
Vishal Biswas 160d3aeb06 update ndk to 17 and switch some packages to clang build (#2415)
* update ndk to 17

* bump NDK version in setup-android script

* libnl: fix for ndk r17

* libpixman: use clang's __builtin_shufflevector instead of __builtin_shuffle (#1)

Required to make package build with ndk17.

* fix as for arm

* ndk17 still uses ld.bfd on aarch64

* use -fno-integrated-as for clang only

* glib: remove patch unnecessary after ndk17

* torsocks: remove unneeded patch after ndk17

* subversion: fix build as clang++ now errors out for mismatched flags

* libpulseaudio: fix build with ndk17

https://github.com/termux/termux-packages/pull/2415#issuecomment-388296684

* gst-plugins-good: disable video4linux2

ioctl is defined as __overloadable in ndk17 headers which
  conflicts with v4l2object's member ioctl

* libzmq: disable Werror to build with ndk17

* ltrace: hardcode symbol not available in ndk17

* busybox: build with clang for all arches except arm

* dropbear: build with clang instead of gcc

* gnupg: build with clang instead of gcc

* openssl: use clang for all arches except arm

* picolisp: build with clang instead of gcc

* valgrind: use clang on all arches except aarch64

* Revert "gst-plugins-good: disable video4linux2"

This reverts commit 43850b81ccf60033c25cb13dfd326c1b0528773a.
Already applied on base branch.

* libllvm: use default arm triple
2018-05-27 14:55:20 +02:00

60 lines
2.3 KiB
Bash

TERMUX_PKG_HOMEPAGE=https://www.freedesktop.org/wiki/Software/PulseAudio
TERMUX_PKG_DESCRIPTION="A featureful, general-purpose sound server - shared libraries"
TERMUX_PKG_VERSION=11.1
TERMUX_PKG_REVISION=4
TERMUX_PKG_SHA256=f2521c525a77166189e3cb9169f75c2ee2b82fa3fcf9476024fbc2c3a6c9cd9e
TERMUX_PKG_SRCURL=https://www.freedesktop.org/software/pulseaudio/releases/pulseaudio-${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_DEPENDS="libltdl, libsndfile, libandroid-glob, libsoxr"
TERMUX_PKG_BUILD_DEPENDS="libtool"
TERMUX_PKG_INCLUDE_IN_DEVPACKAGE="share/vala"
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-neon-opt
--disable-alsa
--disable-esound
--disable-glib2
--disable-openssl
--without-caps
--with-database=simple
--disable-memfd
--bindir=$TERMUX_PREFIX/libexec
ax_cv_PTHREAD_PRIO_INHERIT=no"
TERMUX_PKG_CONFFILES="etc/pulse/client.conf etc/pulse/daemon.conf etc/pulse/default.pa etc/pulse/system.pa"
termux_step_pre_configure () {
mkdir $TERMUX_PKG_SRCDIR/src/modules/sles
cp $TERMUX_PKG_BUILDER_DIR/module-sles-sink.c $TERMUX_PKG_SRCDIR/src/modules/sles
intltoolize --automake --copy --force
LDFLAGS+=" -llog -landroid-glob"
}
termux_step_post_make_install () {
# Some binaries link against these:
cd $TERMUX_PREFIX/lib
for lib in pulseaudio/lib*.so* pulse-${TERMUX_PKG_VERSION}/modules/lib*.so*; do
ln -s -f $lib `basename $lib`
done
if [ $TERMUX_ARCH_BITS = "32" ]; then
SYSTEM_LIB=lib
else
SYSTEM_LIB=lib64
fi
# Pulseaudio fails to start when it cannot detect any sound hardware
# so disable hardware detection.
sed -i $TERMUX_PREFIX/etc/pulse/default.pa \
-e '/^load-module module-detect$/s/^/#/'
echo "load-module module-sles-sink" >> $TERMUX_PREFIX/etc/pulse/default.pa
cd $TERMUX_PREFIX/libexec
for bin in esdcompat pacat pacmd pactl pasuspender pulseaudio; do
rm -f ../bin/$bin
local PA_LIBS="" lib
for lib in android-glob pulse pulsecommon-11.1 pulsecore-11.1; do
if [ -n "$PA_LIBS" ]; then PA_LIBS+=":"; fi
PA_LIBS+="$TERMUX_PREFIX/lib/lib${lib}.so"
done
echo "#!$TERMUX_PREFIX/bin/sh" >> $TERMUX_PREFIX/bin/$bin
echo "export LD_PRELOAD=$PA_LIBS" >> $TERMUX_PREFIX/bin/$bin
echo "LD_LIBRARY_PATH=/system/$SYSTEM_LIB:/system/vendor/$SYSTEM_LIB:$TERMUX_PREFIX/lib exec $TERMUX_PREFIX/libexec/$bin \$@" >> $TERMUX_PREFIX/bin/$bin
chmod +x $TERMUX_PREFIX/bin/$bin
done
}