Subject: [alpine-aports] [PATCH] testing/apulse: new aport

From: Stuart Cardall <[email-masked]>
Date: Fri, 2 Jan 2015 15:52:09 +0000

PulseAudio emulation for ALSA https://github.com/i-rinat/apulse
---
 testing/apulse/APKBUILD          | 64 ++++++++++++++++++++++++++++++++++++++++
 testing/apulse/fix-pthread.patch | 11 +++++++
 2 files changed, 75 insertions(+)
 create mode 100644 testing/apulse/APKBUILD
 create mode 100644 testing/apulse/fix-pthread.patch

diff --git a/testing/apulse/APKBUILD b/testing/apulse/APKBUILD
new file mode 100644
index 0000000..b20990c
--- /dev/null
+++ b/testing/apulse/APKBUILD
@@ -0,0 +1,64 @@
+# Contributor: Stuart Cardall <[email-masked]>
+# Maintainer: Stuart Cardall <[email-masked]>
+pkgname=apulse
+pkgver=0.1.5
+pkgrel=0
+pkgdesc="PulseAudio emulation for ALSA"
+url="https://github.com/i-rinat/apulse"
+arch="all"
+license="MIT"
+depends=""
+depends_dev="glib-dev alsa-lib-dev"
+makedepends="$depends_dev cmake"
+install=""
+subpackages="$pkgname-lib32"
+source="saveas-https://github.com/i-rinat/apulse/archive/v$pkgver.tar.gz/$pkgname-$pkgver.tar.gz
+	fix-pthread.patch
+	"
+
+_builddir="$srcdir/$pkgname-$pkgver"
+prepare() {
+	local i
+	cd "$_builddir"
+	for i in $source; do
+		case $i in
+		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+		esac
+	done
+}
+
+build() {
+	cd "$_builddir"
+	mkdir build && cd build
+	if echo $CHOST|grep "x86_64"; then
+		cmake CFLAGS=-m32 -DAPULSEPATH=/usr/lib32/apulse -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. || return 1
+		make || return 1
+		mkdir -p ../lib32/apulse && mv libpulse* apulse ../lib32/apulse/
+	fi
+	read -p "paused"
+	cd ../ && rm -rf build && mkdir build && cd build
+	cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release .. || return 1
+	make || return 1
+}
+
+package() {
+	cd "$_builddir"/build
+	make DESTDIR="$pkgdir" install || return 1
+}
+
+lib32() {
+	if [ `uname -m` = "x86_64" ]; then
+		pkgdesc="PulseAudio emulation for ALSA (32 bit libs for 64 bit)"
+	        depends=""
+        	mkdir -p "$subpkgdir"/usr/bin || return 1
+		mv "$_builddir"/lib32 "$subpkgdir"/usr/ || return 1
+		mv "$subpkgdir"/usr/lib32/apulse/apulse "$subpkgdir"/usr/bin/apulse32
+	fi
+}
+
+md5sums="48cd971011f2c9d864cf3dad24803c32  apulse-0.1.5.tar.gz
+ffe6c531ca88c02e78dfd2fd24b2bd1c  fix-pthread.patch"
+sha256sums="f235ed89a6d1058f2ae14b99f4f7d3e48555e9228a9cf8205e57b7ac8fccf17a  apulse-0.1.5.tar.gz
+cfcc8ed23773c31e34d6c57069b22a95053eb279cc1a012ed1cb7327ab63a2c8  fix-pthread.patch"
+sha512sums="985667557ee1f2ea445a935cb48bf7b4c3a731c31734496d7658a5e3b31cf32e6fd3416d2f281c2bc7f8be13ac9bee25e2f91e1846c2d990d7f89f00934936b9  apulse-0.1.5.tar.gz
+d47080e2040a7c5ef03e0775ef3ff422349efe56ca41d299223bcbfebb521069a4289eca78b8d18ebdb8d93050c5f4d777c575f7c1901d5abfcad404b412536a  fix-pthread.patch"
diff --git a/testing/apulse/fix-pthread.patch b/testing/apulse/fix-pthread.patch
new file mode 100644
index 0000000..744379e
--- /dev/null
+++ b/testing/apulse/fix-pthread.patch
@@ -0,0 +1,11 @@
+--- apulse-0.1.5/src/apulse-threaded-mainloop.c
++++ apulse-0.1.5/src/apulse-threaded-mainloop.c.new
+@@ -105,7 +105,7 @@
+     m->m = pa_mainloop_new();
+ 
+     pthread_mutexattr_init(&mutex_attr);
+-    pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE_NP);
++    pthread_mutexattr_settype(&mutex_attr, PTHREAD_MUTEX_RECURSIVE);
+     pthread_mutex_init(&m->lock, &mutex_attr);
+     pthread_mutexattr_destroy(&mutex_attr);
+ 
-- 
2.2.1

---
Unsubscribe:  [email-masked]
Help:         [email-masked]
---

---

From: Natanael Copa <[email-masked]>
Date: Tue, 6 Jan 2015 16:56:33 +0100

On Fri,  2 Jan 2015 15:52:09 +0000

> +++ b/testing/apulse/APKBUILD

does the -m32 actually work on alpine linux? We don't really support multiarch...

> +	read -p "paused"

that read thingy will not be nice for build servers which are
completely non-interactive.

> +++ b/testing/apulse/fix-pthread.patch

This patch can go upstream.

---