summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Savchenko <bircoph@gentoo.org>2018-09-22 23:44:06 +0300
committerAndrew Savchenko <bircoph@gentoo.org>2018-09-22 23:53:22 +0300
commitb152b819616a1174bdd133aa5d7dbba64dc262c1 (patch)
tree4f85bc8572cc0d52f27c5c25c0070615469ccafa /media-sound/apulse
parentapp-misc/evtest: Add myself as maintainer (diff)
downloadgentoo-b152b819616a1174bdd133aa5d7dbba64dc262c1.tar.gz
gentoo-b152b819616a1174bdd133aa5d7dbba64dc262c1.tar.bz2
gentoo-b152b819616a1174bdd133aa5d7dbba64dc262c1.zip
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@gentoo.org> Package-Manager: Portage-2.3.49, Repoman-2.3.10
Diffstat (limited to 'media-sound/apulse')
-rw-r--r--media-sound/apulse/apulse-0.1.12-r1.ebuild57
-rw-r--r--media-sound/apulse/files/sdk.patch90
-rw-r--r--media-sound/apulse/metadata.xml2
3 files changed, 149 insertions, 0 deletions
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 000000000000..c4fd6706ff22
--- /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 000000000000..145194f289ce
--- /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 738e74332466..c51682e2af50 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>