public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-sound/apulse/, media-sound/apulse/files/
@ 2015-08-24  9:41 Daniel Campbell
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Campbell @ 2015-08-24  9:41 UTC (permalink / raw
  To: gentoo-commits

commit:     a7d86faf81d3ea5b46abf91cd030ab9992928b78
Author:     Daniel Campbell <zlg <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 24 09:40:43 2015 +0000
Commit:     Daniel Campbell <zlg <AT> gentoo <DOT> org>
CommitDate: Mon Aug 24 09:40:43 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a7d86faf

media-sound/apulse: Revbump to 0.1.6-r1

Introduces script to automagically assign libdir based on the
executable being passed through to apulse. Will need expansion
if/when arches besides x86 and amd64 need apulse.

Bug: 547524

Package-Manager: portage-2.2.20.1

 media-sound/apulse/apulse-0.1.6-r1.ebuild | 33 +++++++++++++++++++++++++
 media-sound/apulse/files/apulse           | 40 +++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)

diff --git a/media-sound/apulse/apulse-0.1.6-r1.ebuild b/media-sound/apulse/apulse-0.1.6-r1.ebuild
new file mode 100644
index 0000000..2f68179
--- /dev/null
+++ b/media-sound/apulse/apulse-0.1.6-r1.ebuild
@@ -0,0 +1,33 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+inherit multilib cmake-multilib
+
+DESCRIPTION="PulseAudio emulation for ALSA"
+HOMEPAGE="https://github.com/i-rinat/apulse"
+SRC_URI="https://github.com/i-rinat/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="dev-libs/glib:2[${MULTILIB_USEDEP}]
+	media-libs/alsa-lib[${MULTILIB_USEDEP}]"
+RDEPEND="${DEPEND}
+	!!media-plugins/alsa-plugins[pulseaudio]"
+
+MULTILIB_CHOST_TOOLS=( /usr/bin/apulse )
+
+multilib_src_configure() {
+	local mycmakeargs="-DAPULSEPATH=${EPREFIX}/usr/$(get_libdir)/apulse"
+
+	cmake-utils_src_configure
+}
+
+multilib_src_install() {
+	cmake-utils_src_install
+	dobin "${FILESDIR}"/apulse
+}

diff --git a/media-sound/apulse/files/apulse b/media-sound/apulse/files/apulse
new file mode 100755
index 0000000..f419565
--- /dev/null
+++ b/media-sound/apulse/files/apulse
@@ -0,0 +1,40 @@
+#!/bin/sh
+# Author:  Daniel Campbell <zlg@gentoo.org>
+# License: Creative Commons Public Domain Dedication (CC0 1.0)
+#          <https://creativecommons.org/publicdomain/zero/1.0/>
+
+# apulse needs at least one argument
+if [ $# -lt 1 ]; then
+	echo "Usage: apulse <app-path> [options]"
+	exit
+fi
+
+# Get the full path of our application
+app_path=$(which ${1} 2>/dev/null)
+
+# The app might not be picked up by `which`, so let's use realpath as a backup
+[ -z ${app_path} ] && app_path=$(realpath ${1})
+
+# Then make sure it's executable
+[ ! -x ${app_path} ] && echo "${app_path} is not executable!" && exit 8
+
+# Fetch the app's ABI
+app_abi=$(file -L ${app_path} | sed 's/\([^,]*\), \([^,]*\), \(.*\)/\2/')
+
+# Determine libdir based on app_abi
+# Applications that don't have a header will default to native libdir
+case $app_abi in
+	Intel\ 80386)
+		APULSE_ABI="32"
+		;;
+	x86-64)
+		APULSE_ABI="64"
+		;;
+	*)
+		APULSE_ABI=$(readlink /usr/lib)
+		APULSE_ABI=${APULSE_ABI#lib}
+		;;
+esac
+
+# Set library path for the application so it'll use apulse
+LD_LIBRARY_PATH=/usr/lib${APULSE_ABI}/apulse${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} exec "$@"


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/apulse/, media-sound/apulse/files/
@ 2015-08-27  7:26 Daniel Campbell
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Campbell @ 2015-08-27  7:26 UTC (permalink / raw
  To: gentoo-commits

commit:     7345c7f2d1f42ec82330796f3b8cda8b6d558a49
Author:     Daniel Campbell <zlg <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 27 07:25:49 2015 +0000
Commit:     Daniel Campbell <zlg <AT> gentoo <DOT> org>
CommitDate: Thu Aug 27 07:25:49 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7345c7f2

media-sound/apulse: Fix ebuild and script to support all ABIs

Prior solution was over-engineered and didn't cover all cases.
Thanks mgorny and jcallen for the assistance.

Gentoo-Bug: 547524

Package-Manager: portage-2.2.20.1

 media-sound/apulse/apulse-0.1.6-r1.ebuild |  8 +++++++-
 media-sound/apulse/files/apulse           | 32 +++----------------------------
 2 files changed, 10 insertions(+), 30 deletions(-)

diff --git a/media-sound/apulse/apulse-0.1.6-r1.ebuild b/media-sound/apulse/apulse-0.1.6-r1.ebuild
index 2f68179..8324b90 100644
--- a/media-sound/apulse/apulse-0.1.6-r1.ebuild
+++ b/media-sound/apulse/apulse-0.1.6-r1.ebuild
@@ -25,9 +25,15 @@ multilib_src_configure() {
 	local mycmakeargs="-DAPULSEPATH=${EPREFIX}/usr/$(get_libdir)/apulse"
 
 	cmake-utils_src_configure
+
+	# Ensure all relevant libdirs are added
+	DIRS=
+	_add_dir() { DIRS="${EPREFIX}/usr/$(get_libdir)/apulse${DIRS:+:${DIRS}}"; }
+	multilib_foreach_abi _add_dir
+	sed -e "s#@@DIRS@@#${DIRS}#g" "${FILESDIR}"/apulse > "${T}"/apulse
 }
 
 multilib_src_install() {
 	cmake-utils_src_install
-	dobin "${FILESDIR}"/apulse
+	dobin "${T}"/apulse
 }

diff --git a/media-sound/apulse/files/apulse b/media-sound/apulse/files/apulse
index f419565..32633b2 100755
--- a/media-sound/apulse/files/apulse
+++ b/media-sound/apulse/files/apulse
@@ -9,32 +9,6 @@ if [ $# -lt 1 ]; then
 	exit
 fi
 
-# Get the full path of our application
-app_path=$(which ${1} 2>/dev/null)
-
-# The app might not be picked up by `which`, so let's use realpath as a backup
-[ -z ${app_path} ] && app_path=$(realpath ${1})
-
-# Then make sure it's executable
-[ ! -x ${app_path} ] && echo "${app_path} is not executable!" && exit 8
-
-# Fetch the app's ABI
-app_abi=$(file -L ${app_path} | sed 's/\([^,]*\), \([^,]*\), \(.*\)/\2/')
-
-# Determine libdir based on app_abi
-# Applications that don't have a header will default to native libdir
-case $app_abi in
-	Intel\ 80386)
-		APULSE_ABI="32"
-		;;
-	x86-64)
-		APULSE_ABI="64"
-		;;
-	*)
-		APULSE_ABI=$(readlink /usr/lib)
-		APULSE_ABI=${APULSE_ABI#lib}
-		;;
-esac
-
-# Set library path for the application so it'll use apulse
-LD_LIBRARY_PATH=/usr/lib${APULSE_ABI}/apulse${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} exec "$@"
+# Set library path for the application so it'll use apulse. DIRS is
+# replaced by the ebuild to include the correct paths
+LD_LIBRARY_PATH=@@DIRS@@${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH} exec "$@"


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/apulse/, media-sound/apulse/files/
@ 2018-09-22 20:53 Andrew Savchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Savchenko @ 2018-09-22 20:53 UTC (permalink / raw
  To: gentoo-commits

commit:     b152b819616a1174bdd133aa5d7dbba64dc262c1
Author:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
AuthorDate: Sat Sep 22 20:44:06 2018 +0000
Commit:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
CommitDate: Sat Sep 22 20:53:22 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b152b819

media-sound/apulse: add SDK mode

Add SDK mode where apulse acts as drop-in replacement for
pulseaudio: headers and pkg-config files are provided, libraries
are installed in standard path.

Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>
Package-Manager: Portage-2.3.49, Repoman-2.3.10

 media-sound/apulse/apulse-0.1.12-r1.ebuild | 57 +++++++++++++++++++
 media-sound/apulse/files/sdk.patch         | 90 ++++++++++++++++++++++++++++++
 media-sound/apulse/metadata.xml            |  2 +
 3 files changed, 149 insertions(+)

diff --git a/media-sound/apulse/apulse-0.1.12-r1.ebuild b/media-sound/apulse/apulse-0.1.12-r1.ebuild
new file mode 100644
index 00000000000..c4fd6706ff2
--- /dev/null
+++ b/media-sound/apulse/apulse-0.1.12-r1.ebuild
@@ -0,0 +1,57 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit multilib cmake-multilib
+
+DESCRIPTION="PulseAudio emulation for ALSA"
+HOMEPAGE="https://github.com/i-rinat/apulse"
+SRC_URI="https://github.com/i-rinat/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug sdk test"
+
+DEPEND="dev-libs/glib:2[${MULTILIB_USEDEP}]
+	media-libs/alsa-lib[${MULTILIB_USEDEP}]
+	sdk? ( !media-sound/pulseaudio ) "
+RDEPEND="${DEPEND}
+	!!media-plugins/alsa-plugins[pulseaudio]"
+
+MULTILIB_CHOST_TOOLS=( /usr/bin/apulse )
+
+PATCHES=( "${FILESDIR}/sdk.patch" )
+
+src_prepare() {
+	cmake-utils_src_prepare
+
+	if ! use sdk; then
+		# Ensure all relevant libdirs are added, to support all ABIs
+		DIRS=
+		_add_dir() { DIRS="${EPREFIX}/usr/$(get_libdir)/apulse${DIRS:+:${DIRS}}"; }
+		multilib_foreach_abi _add_dir
+		sed -e "s#@@DIRS@@#${DIRS}#g" "${FILESDIR}"/apulse > "${T}"/apulse || die
+	fi
+}
+
+multilib_src_configure() {
+	local mycmakeargs=(
+		"-DINSTALL_SDK=$(usex sdk)"
+		"-DLOG_TO_STDERR=$(usex debug)"
+		"-DWITH_TRACE=$(usex debug)"
+	)
+	cmake-utils_src_configure
+}
+
+multilib_src_test() {
+	emake check
+}
+
+multilib_src_install_all() {
+	cmake-utils_src_install
+	einstalldocs
+	use sdk || dobin "${T}"/apulse
+}

diff --git a/media-sound/apulse/files/sdk.patch b/media-sound/apulse/files/sdk.patch
new file mode 100644
index 00000000000..145194f289c
--- /dev/null
+++ b/media-sound/apulse/files/sdk.patch
@@ -0,0 +1,90 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 072f3b1..eff028d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -28,6 +28,8 @@ else()
+     include_directories(${PA_INCLUDE_DIRECTORIES})
+ endif()
+ 
++set(INSTALL_SDK 0 CACHE BOOLEAN "Install SDK files to build applications with apulse (Pulse Audio headers and pkg-config files) instead of system ones")
++
+ link_directories(${REQ_LIBRARY_DIRS})
+ 
+ add_library(trace-helper STATIC
+@@ -72,12 +74,30 @@ target_link_libraries(pulse-simple ${SYMBOLMAP} trace-helper ${REQ_LIBRARIES})
+ 
+ add_subdirectory(tests)
+ 
+-set(APULSEPATH "${CMAKE_INSTALL_PREFIX}/lib/apulse" CACHE PATH "library installation directory")
++if (${INSTALL_SDK})
++    set(APULSEPATH "${CMAKE_INSTALL_LIBDIR}" CACHE PATH "library installation directory")
++else()
++    set(APULSEPATH "${CMAKE_INSTALL_LIBDIR}/apulse" CACHE PATH "library installation directory")
++endif()
++
+ set(APULSE_SEARCH_PATHS "${APULSEPATH}" CACHE PATH "directory list for LD_LIBRARY_PATH")
+ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/src/apulse.template"
+                "${CMAKE_CURRENT_BINARY_DIR}/apulse" @ONLY)
++if (${INSTALL_SDK})
++    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/libpulse.pc.in"
++                   "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/libpulse.pc" @ONLY)
++    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/libpulse-simple.pc.in"
++                   "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/libpulse-simple.pc" @ONLY)
++    configure_file("${CMAKE_CURRENT_SOURCE_DIR}/pkgconfig/libpulse-mainloop-glib.pc.in"
++                   "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig/libpulse-mainloop-glib.pc" @ONLY)
++endif()
+ 
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/apulse" DESTINATION bin
+         PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE)
+ install(TARGETS pulse-simple pulse pulse-mainloop-glib DESTINATION "${APULSEPATH}")
+ install(FILES "${CMAKE_SOURCE_DIR}/man/apulse.1" DESTINATION share/man/man1)
++
++if (${INSTALL_SDK})
++    install(DIRECTORY "${CMAKE_SOURCE_DIR}/3rdparty/pulseaudio-headers/pulse" DESTINATION include)
++    install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/pkgconfig" DESTINATION "${CMAKE_INSTALL_LIBDIR}")
++endif()
+diff --git a/pkgconfig/libpulse-mainloop-glib.pc.in b/pkgconfig/libpulse-mainloop-glib.pc.in
+new file mode 100644
+index 0000000..957e3b2
+--- /dev/null
++++ b/pkgconfig/libpulse-mainloop-glib.pc.in
+@@ -0,0 +1,9 @@
++libdir=@CMAKE_INSTALL_FULL_LIBDIR@
++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
++
++Name: libpulse-mainloop-glib
++Description: PulseAudio GLib 2.0 Main Loop Wrapper (apulse)
++Version: 5.0
++Libs: -L${libdir} -lpulse-mainloop-glib -pthread
++Cflags: -I${includedir}
++Requires: glib-2.0
+diff --git a/pkgconfig/libpulse-simple.pc.in b/pkgconfig/libpulse-simple.pc.in
+new file mode 100644
+index 0000000..3809d50
+--- /dev/null
++++ b/pkgconfig/libpulse-simple.pc.in
+@@ -0,0 +1,9 @@
++libdir=@CMAKE_INSTALL_FULL__LIBDIR@
++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
++
++Name: libpulse-simple
++Description: PulseAudio Simplified Synchronous Client Interface (apulse)
++Version: 5.0
++Libs: -L${libdir} -lpulse-simple -pthread
++Cflags: -I${includedir}
++Requires: glib-2.0
+diff --git a/pkgconfig/libpulse.pc.in b/pkgconfig/libpulse.pc.in
+new file mode 100644
+index 0000000..edcbbd8
+--- /dev/null
++++ b/pkgconfig/libpulse.pc.in
+@@ -0,0 +1,9 @@
++libdir=@CMAKE_INSTALL_FULL_LIBDIR@
++includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
++
++Name: libpulse
++Description: PulseAudio Client Interface (apulse)
++Version: 5.0
++Libs: -L${libdir} -lpulse -pthread
++Cflags: -I${includedir}
++Requires: glib-2.0 alsa

diff --git a/media-sound/apulse/metadata.xml b/media-sound/apulse/metadata.xml
index 738e7433246..c51682e2af5 100644
--- a/media-sound/apulse/metadata.xml
+++ b/media-sound/apulse/metadata.xml
@@ -7,6 +7,8 @@
   </maintainer>
   <use>
     <flag name="pa-headers">Install PulseAudio headers</flag>
+    <flag name="sdk">Install PulseAudio headers and pkg-config files. Be aware apulse is not
+    a full PulseAudio replacement by design and some functionality may be missing.</flag>
   </use>
   <upstream>
     <remote-id type="github">i-rinat/apulse</remote-id>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/apulse/, media-sound/apulse/files/
@ 2020-05-10 22:28 Andrew Savchenko
  0 siblings, 0 replies; 5+ messages in thread
From: Andrew Savchenko @ 2020-05-10 22:28 UTC (permalink / raw
  To: gentoo-commits

commit:     e5cea54453c0241f41e2a001225c193f829d947d
Author:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
AuthorDate: Sun May 10 22:26:03 2020 +0000
Commit:     Andrew Savchenko <bircoph <AT> gentoo <DOT> org>
CommitDate: Sun May 10 22:28:02 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5cea544

media-sound/apulse: version bump

- Update to 0.1.13
- Bump to EAPI 7
- Migrate from cmake-utils to cmake eclass
- Use upstream full requests:
  - Check key before removal from hash table
  - Improve man page

Closes: https://bugs.gentoo.org/720340
Package-Manager: Portage-2.3.82, Repoman-2.3.20
Signed-off-by: Andrew Savchenko <bircoph <AT> gentoo.org>

 media-sound/apulse/Manifest                        |  1 +
 media-sound/apulse/apulse-0.1.13.ebuild            | 64 ++++++++++++++++++++++
 .../apulse/files/check-key-before-remove.patch     | 54 ++++++++++++++++++
 media-sound/apulse/files/man.patch                 | 30 ++++++++++
 4 files changed, 149 insertions(+)

diff --git a/media-sound/apulse/Manifest b/media-sound/apulse/Manifest
index f5ce430e94d..82ac13350e9 100644
--- a/media-sound/apulse/Manifest
+++ b/media-sound/apulse/Manifest
@@ -1 +1,2 @@
 DIST apulse-0.1.12.tar.gz 117220 BLAKE2B 04d88a298ff5e21e19fda1979ebbc96a6441f83212d6903a004a54ee360276985e66b637571a76e3fe6821d42762ac515b02a8a2cb0149a66f3150e34bd0d9b7 SHA512 9fe39ab93e90d7ec589c7632bf439bfc7fe8bbd0792ce1197ec8547fbe1901fec50facdf33c55cfbadbc1af4414fdf48f1f241406903a8f15f445b97dca7076a
+DIST apulse-0.1.13.tar.gz 117369 BLAKE2B 8cf527daf21420a72e46968a3b07ab61029f404a2b6574ac1f08dd40528f3e6e4baf7e38f5914b0c89252e16eec5e8f3722be51e5a61b6a71c683e994740b4bf SHA512 366385ae2304f7ff697ba70951d0753a5b1630310922e3763fd0813a73e0b4088b715135295aa2fa9111b8edcf91d82849dc31346b292b2e9db598bcdd47b007

diff --git a/media-sound/apulse/apulse-0.1.13.ebuild b/media-sound/apulse/apulse-0.1.13.ebuild
new file mode 100644
index 00000000000..6641e6bb6c8
--- /dev/null
+++ b/media-sound/apulse/apulse-0.1.13.ebuild
@@ -0,0 +1,64 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+CMAKE_ECLASS=cmake
+inherit multilib cmake-multilib
+
+DESCRIPTION="PulseAudio emulation for ALSA"
+HOMEPAGE="https://github.com/i-rinat/apulse"
+SRC_URI="https://github.com/i-rinat/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="MIT LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="debug sdk test"
+RESTRICT="!test? ( test )"
+
+DEPEND="dev-libs/glib:2[${MULTILIB_USEDEP}]
+	media-libs/alsa-lib[${MULTILIB_USEDEP}]
+	sdk? ( !media-sound/pulseaudio ) "
+RDEPEND="${DEPEND}
+	!!media-plugins/alsa-plugins[pulseaudio]"
+
+PATCHES=(
+	"${FILESDIR}/sdk.patch"
+	"${FILESDIR}/check-key-before-remove.patch"
+	"${FILESDIR}/man.patch"
+)
+
+src_prepare() {
+	cmake_src_prepare
+
+	if ! use sdk; then
+		# Ensure all relevant libdirs are added, to support all ABIs
+		DIRS=
+		_add_dir() { DIRS="${EPREFIX}/usr/$(get_libdir)/apulse${DIRS:+:${DIRS}}"; }
+		multilib_foreach_abi _add_dir
+		sed -e "s#@@DIRS@@#${DIRS}#g" "${FILESDIR}"/apulse > "${T}"/apulse || die
+	fi
+}
+
+multilib_src_configure() {
+	local mycmakeargs=(
+		"-DINSTALL_SDK=$(usex sdk)"
+		"-DLOG_TO_STDERR=$(usex debug)"
+		"-DWITH_TRACE=$(usex debug)"
+	)
+	cmake_src_configure
+}
+
+multilib_src_test() {
+	emake check
+}
+
+multilib_src_install_all() {
+	if ! use sdk; then
+		_install_wrapper() { newbin "${BUILD_DIR}/apulse" "${CHOST}-apulse"; }
+		multilib_foreach_abi _install_wrapper
+		dobin "${T}/apulse"
+	fi
+	einstalldocs
+}

diff --git a/media-sound/apulse/files/check-key-before-remove.patch b/media-sound/apulse/files/check-key-before-remove.patch
new file mode 100644
index 00000000000..28fe0fc0d16
--- /dev/null
+++ b/media-sound/apulse/files/check-key-before-remove.patch
@@ -0,0 +1,54 @@
+From bf146f0d711ce3e48cdc8ba772039d843d590b47 Mon Sep 17 00:00:00 2001
+From: "Miouyouyou (Myy)" <myy@miouyouyou.fr>
+Date: Sun, 20 Oct 2019 05:09:29 +0200
+Subject: [PATCH] stream: Check the key before invoking g_hash_table_remove
+
+Turns out that I hit a bug where pa_stream_unref would
+call g_hash_table_remove with a NULL key.
+
+Thanks for the lightweight and smooth error handling from
+Glib, g_hash_table_remove generated an ABORT call, crashing
+some Unity3D games I was trying to start.
+Now, you also CANNOT call g_hash_table_lookup with a NULL
+key. That also generate a crash... Ugh...
+
+So, yeah, we first check that the key is not 0, then check
+if the key is actually inside the Hash table and THEN remove
+it.
+
+Note, here's my ~/.asoundrc, just in case :
+defaults.pcm.!card Audio
+defaults.ctl.!card Audio
+
+Audio being :
+card 3: Audio [DigiHug USB Audio], device 0: USB Audio [USB Audio]
+  Subdevices: 0/1
+  Subdevice #0: subdevice #0
+card 3: Audio [DigiHug USB Audio], device 1: USB Audio [USB Audio #1]
+  Subdevices: 1/1
+  Subdevice #0: subdevice #0
+
+I'm using a FiiO device for sound output.
+
+Signed-off-by: Miouyouyou (Myy) <myy@miouyouyou.fr>
+---
+ src/apulse-stream.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/apulse-stream.c b/src/apulse-stream.c
+index 84b18bb..1de4885 100644
+--- a/src/apulse-stream.c
++++ b/src/apulse-stream.c
+@@ -1019,7 +1019,11 @@ pa_stream_unref(pa_stream *s)
+ 
+     s->ref_cnt--;
+     if (s->ref_cnt == 0) {
+-        g_hash_table_remove(s->c->streams_ht, GINT_TO_POINTER(s->idx));
++        GHashTable * __restrict const streams_ht =
++            s->c->streams_ht;
++        void const * key = GINT_TO_POINTER(s->idx);
++        if (key && g_hash_table_lookup(streams_ht, key))
++            g_hash_table_remove(streams_ht, key);
+         ringbuffer_free(s->rb);
+         free(s->peek_buffer);
+         free(s->write_buffer);

diff --git a/media-sound/apulse/files/man.patch b/media-sound/apulse/files/man.patch
new file mode 100644
index 00000000000..a26e32d8b9c
--- /dev/null
+++ b/media-sound/apulse/files/man.patch
@@ -0,0 +1,30 @@
+From 2c2bf366599d957837acbdf54eb300526fc125a1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?=C3=89rico=20Rolim?= <erico.erc@gmail.com>
+Date: Tue, 5 May 2020 14:24:52 -0300
+Subject: [PATCH] Add ENVIRONMENT to man-page.
+
+---
+ man/apulse.1 | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/man/apulse.1 b/man/apulse.1
+index cd67cf3..df75c60 100644
+--- a/man/apulse.1
++++ b/man/apulse.1
+@@ -36,6 +36,16 @@ compatibility layer between OSS programs and \fBALSA\fR, \fBapulse\fR was
+ designed to be compatibility layer between PulseAudio applications and
+ \fBALSA\fR.
+ 
++.SH ENVIRONMENT
++
++The following environment variables can be used to configure the devices used
++by \fBapulse\fR. Try \fIhw:0,0\fR, \fIplughw:0,0\fR and the like.
++Refer to the ALSA user guide for a full list of device names.
++
++\fIAPULSE_CAPTURE_DEVICE\fR: Can be used to configure the capture device.
++
++\fIAPULSE_PLAYBACK_DEVICE\fR: Can be used to configure the playback device.
++
+ .SH RETURN VALUE
+ 
+ \fBapulse\fR is a simple shell wrapper script that calls \fBexec\fR on the


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-sound/apulse/, media-sound/apulse/files/
@ 2024-06-07 13:15 Joonas Niilola
  0 siblings, 0 replies; 5+ messages in thread
From: Joonas Niilola @ 2024-06-07 13:15 UTC (permalink / raw
  To: gentoo-commits

commit:     555f912005a875066aabbdce2bba4e4d4e3fe46d
Author:     Alexey Sokolov <alexey+gentoo <AT> asokolov <DOT> org>
AuthorDate: Wed Apr  3 22:48:39 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Jun  7 13:15:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=555f9120

media-sound/apulse: fix build with musl 1.2.5

Closes: https://bugs.gentoo.org/927954
Signed-off-by: Alexey Sokolov <alexey+gentoo <AT> asokolov.org>
Closes: https://github.com/gentoo/gentoo/pull/36086
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 media-sound/apulse/apulse-0.1.13-r3.ebuild          |  1 +
 media-sound/apulse/files/apulse-0.1.13-libgen.patch | 13 +++++++++++++
 2 files changed, 14 insertions(+)

diff --git a/media-sound/apulse/apulse-0.1.13-r3.ebuild b/media-sound/apulse/apulse-0.1.13-r3.ebuild
index 8a3640b8115d..1289e259187c 100644
--- a/media-sound/apulse/apulse-0.1.13-r3.ebuild
+++ b/media-sound/apulse/apulse-0.1.13-r3.ebuild
@@ -26,6 +26,7 @@ PATCHES=(
 	"${FILESDIR}/sdk.patch"
 	"${FILESDIR}/check-key-before-remove.patch"
 	"${FILESDIR}/man.patch"
+	"${FILESDIR}/apulse-0.1.13-libgen.patch"
 )
 
 src_prepare() {

diff --git a/media-sound/apulse/files/apulse-0.1.13-libgen.patch b/media-sound/apulse/files/apulse-0.1.13-libgen.patch
new file mode 100644
index 000000000000..97d33fec66b7
--- /dev/null
+++ b/media-sound/apulse/files/apulse-0.1.13-libgen.patch
@@ -0,0 +1,13 @@
+Fix build with musl 1.2.5
+
+--- a/src/apulse-misc.c
++++ b/src/apulse-misc.c
+@@ -22,6 +22,8 @@
+  * SOFTWARE.
+  */
+ 
++#include <libgen.h>
++
+ #include "apulse.h"
+ #include "trace.h"
+ #include "util.h"


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-06-07 13:15 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-10 22:28 [gentoo-commits] repo/gentoo:master commit in: media-sound/apulse/, media-sound/apulse/files/ Andrew Savchenko
  -- strict thread matches above, loose matches on Subject: below --
2024-06-07 13:15 Joonas Niilola
2018-09-22 20:53 Andrew Savchenko
2015-08-27  7:26 Daniel Campbell
2015-08-24  9:41 Daniel Campbell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox