hybris/pulseaudio-modules-droid: new package (!448)

Set of pulseaudio modules that use Android audio HAL
(via libhybris) to talk to sound cards.

[ci:skip-build]: already built successfully in CI
This commit is contained in:
Alexey Min 2019-06-18 00:08:03 +03:00 committed by Oliver Smith
parent 83ef586986
commit e38f1de121
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 154 additions and 0 deletions

View file

@ -0,0 +1,35 @@
diff --git a/configure.ac b/configure.ac
index 31134c3..412bce9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6,7 +6,7 @@ AM_INIT_AUTOMAKE([foreign -Wall silent-rules])
AC_CONFIG_MACRO_DIR(m4)
AM_SILENT_RULES([yes])
-AS_IF([! test -n "$VERSION"], [
+AS_IF([! test -n "$PACKAGE_VERSION"], [
AC_MSG_ERROR([git-version-gen failed])
])
@@ -20,9 +20,9 @@ AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_GCC_TRADITIONAL
-m4_define(pa_major, `echo $VERSION | cut -d. -f1 | cut -d- -f1`)
-m4_define(pa_minor, `echo $VERSION | cut -d. -f2 | cut -d- -f1`)
-m4_define(pa_module_version, `echo $VERSION | cut -d. -f3 | cut -d- -f1`)
+m4_define(pa_major, `echo $PACKAGE_VERSION | cut -d. -f1 | cut -d- -f1`)
+m4_define(pa_minor, `echo $PACKAGE_VERSION | cut -d. -f2 | cut -d- -f1`)
+m4_define(pa_module_version, `echo $PACKAGE_VERSION | cut -d. -f3 | cut -d- -f1`)
AC_SUBST(PA_MAJOR, pa_major)
AC_SUBST(PA_MAJORMINOR, pa_major.pa_minor)
@@ -326,7 +326,7 @@ AC_OUTPUT
echo "
- ---{ $PACKAGE_NAME $VERSION }---
+ ---{ $PACKAGE_NAME $PACKAGE_VERSION }---
compiler: ${CC}
CFLAGS: ${CFLAGS}

View file

@ -0,0 +1,99 @@
# Contributor: Alexey Min <alexey.min@gmail.com>
# Maintainer: Alexey Min <alexey.min@gmail.com>
pkgname="pulseaudio-modules-droid"
# pkgver should match MAJOR.MINOR pulseaudio version
pkgver=12.2
# _pkgver used in URL to download tarball
_pkgver=12.2.78
pkgrel=0
pkgdesc="PulseAudio Droid modules by Mer project"
url="https://github.com/mer-hybris/pulseaudio-modules-droid"
arch="x86 armv7 aarch64"
license="LGPL-2.1-or-later"
depends="pulseaudio"
makedepends="autoconf automake libtool m4 intltool dbus-dev expat-dev pulseaudio-dev pulsecore-private-headers android-headers-7.1 android-headers-7.1-caf libhybris-dev libhybris-7.1"
options="!check" # No test suite available
source="
$pkgname-$_pkgver.tar.gz::https://github.com/mer-hybris/$pkgname/archive/$_pkgver.tar.gz
0001-configure-ac-compat.patch
"
install="$pkgname.post-install"
subpackages=""
_headers_variants="7.1 7.1-caf"
for _ver in $_headers_variants; do
subpackages="$subpackages $pkgname-$_ver:_variant"
done
builddir="$srcdir/$pkgname-$_pkgver"
_tmppkgdir="$srcdir/tmpinstall"
_list_of_libs="
libdroid-sink.so
libdroid-source.so
libdroid-util.so
module-droid-card.so
module-droid-keepalive.so
module-droid-sink.so
module-droid-source.so
"
prepare() {
default_prepare
echo $pkgver > .tarball-version
autoreconf --force --install
}
build() {
# Hack to build against CAF android headers:
# use our own local pkg-config path folder
mkdir pkgconfig
ln -s /usr/lib/pkgconfig/android-headers-7.1.pc pkgconfig/android-headers.pc
export PKG_CONFIG_PATH="$builddir/pkgconfig"
./configure \
--build=$CBUILD \
--host=$CHOST \
--prefix=/usr \
--sysconfdir=/etc \
--mandir=/usr/share/man \
--localstatedir=/var \
--enable-shared \
--disable-static
# build several times against different android headers variation
for _ver in $_headers_variants; do
msg "building $pkgname-$_ver"
# Before each build make sure that include path points to correct location:
# instead of re-symlinking android-headers.pc file and re-running
# configure every time, just rewrite include paths in every Makefile
for _makefile in "Makefile src/Makefile src/common/Makefile src/droid/Makefile"; do
sed -i -E "s~/usr/include/android-[^ ]+~/usr/include/android-$_ver~g" $_makefile
done
make clean
make
# each variation is installed into a unique temporary directory
make DESTDIR="${_tmppkgdir}/$pkgname-$_ver" install
done
}
package() {
# here we should run install for some common files
# for both subpackages, but we don't have anything like that
# pkgdir is still needed, otherwise "rootpkg failed"
mkdir -p "$pkgdir"
}
_variant() {
depends="$pkgname"
mkdir -p "$subpkgdir"
# Copy libs from temp install folder to a proper subpackage dir
for _lib in $_list_of_libs; do
install -Dm644 ${_tmppkgdir}/${subpkgname}/usr/lib/pulse-${pkgver}/modules/${_lib} \
${subpkgdir}/usr/lib/pulse-${pkgver}/modules/${_lib}
done
}
sha512sums="4870936c84aaf3d80f52f8624c0434fac33c1aaa0bd7fe1ecf1fefde16ccd78be3de58b120341ef5e265342ff0f7600730c61adf7de713cb2956073b83a57fe0 pulseaudio-modules-droid-12.2.78.tar.gz
2aa283c64d8623c035522b89b62c80130d14c145a73e6193e2e98c26525cc12670e50f8db4649029e731b61d08c1e5ab2bd4e1a3dae8ca077bbdabe3a69eaa17 0001-configure-ac-compat.patch"

View file

@ -0,0 +1,20 @@
#!/bin/sh
# pulseaudio default config file name
DEFAULT_PA=/etc/pulse/default.pa
# configuration lines
L1="load-module module-droid-card"
append_line() {
FN=$1
LINE=$2
if ! grep -q "${LINE}" "${FN}"; then
echo "Adding $LINE..."
echo "${LINE}" >> "${FN}"
else
echo "Not adding ${LINE}"
fi
}
if [ -f ${DEFAULT_PA} ]; then
append_line "${DEFAULT_PA}" "${L1}"
fi