commit:     9fe9f40bd344b8aa5f6536aff28a52ce2241b267
Author:     Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
AuthorDate: Fri May 14 17:53:47 2021 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Tue Jun 15 07:26:37 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fe9f40b

media-libs/libao: Fix automagic dependency on sndio

Related: https://gitlab.xiph.org/xiph/libao/-/merge_requests/8
Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>
Closes: https://github.com/gentoo/gentoo/pull/20808
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 .../files/libao-1.2.2-automagic_sndio_oss.patch    | 43 +++++++++++++++
 media-libs/libao/libao-1.2.2-r2.ebuild             | 62 ++++++++++++++++++++++
 media-libs/libao/metadata.xml                      |  3 ++
 profiles/arch/alpha/package.use.mask               |  1 +
 4 files changed, 109 insertions(+)

diff --git a/media-libs/libao/files/libao-1.2.2-automagic_sndio_oss.patch 
b/media-libs/libao/files/libao-1.2.2-automagic_sndio_oss.patch
new file mode 100644
index 00000000000..7c1e6895fc2
--- /dev/null
+++ b/media-libs/libao/files/libao-1.2.2-automagic_sndio_oss.patch
@@ -0,0 +1,43 @@
+From f1ef6b4b11080a98d622b6a6c657be5a3a9aae2f Mon Sep 17 00:00:00 2001
+From: "Haelwenn (lanodan) Monnier" <cont...@hacktivis.me>
+Date: Tue, 15 Jun 2021 08:41:08 +0200
+Subject: [PATCH] configure.ac: Put sndio and OSS behind AC_ARG_ENABLE
+
+This allows to avoid automagic dependencies
+---
+ configure.ac | 12 +++++++++---
+ 1 file changed, 9 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 0e53752..2f34123 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -266,8 +266,11 @@ AM_CONDITIONAL(HAVE_ESD,test "x$have_esd" = xyes)
+ dnl Check for OSS
+ 
+ have_oss="no";
+-AC_CHECK_HEADERS(sys/soundcard.h, have_oss=yes)
+-AC_CHECK_HEADERS(machine/soundcard.h, have_oss=yes)
++AC_ARG_ENABLE(oss, [  --disable-oss          disable OSS output plugin ])
++if test "x$enable_oss" != "xno"; then
++  AC_CHECK_HEADERS(sys/soundcard.h, have_oss=yes)
++  AC_CHECK_HEADERS(machine/soundcard.h, have_oss=yes)
++fi
+ AM_CONDITIONAL(HAVE_OSS,test "${have_oss}" = "yes")
+ 
+ 
+@@ -321,7 +324,10 @@ AM_CONDITIONAL(HAVE_SUN_AUDIO,test "${have_sun}" = yes)
+ dnl Check for libsndio audio
+ 
+ have_sndio="no";
+-AC_CHECK_HEADERS(sndio.h, have_sndio=yes)
++AC_ARG_ENABLE(sndio, [  --disable-sndio        disable sndio output plugin ])
++if test "x$enable_sndio" != "xno"; then
++  AC_CHECK_HEADERS(sndio.h, have_sndio=yes)
++fi
+ AM_CONDITIONAL(HAVE_SNDIO_AUDIO,test "${have_sndio}" = yes)
+ 
+ dnl Check for roaraudio
+-- 
+2.31.1
+

diff --git a/media-libs/libao/libao-1.2.2-r2.ebuild 
b/media-libs/libao/libao-1.2.2-r2.ebuild
new file mode 100644
index 00000000000..b3bfad6d156
--- /dev/null
+++ b/media-libs/libao/libao-1.2.2-r2.ebuild
@@ -0,0 +1,62 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools multilib multilib-minimal
+
+DESCRIPTION="The Audio Output library"
+HOMEPAGE="https://www.xiph.org/ao/";
+#SRC_URI="https://downloads.xiph.org/releases/ao/${P}.tar.gz";
+#SRC_URI="https://git.xiph.org/?p=libao.git;a=snapshot;h=refs/tags/${PV};sf=tgz
 -> ${P}.tar.gz"
+SRC_URI="https://github.com/xiph/libao/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 
~amd64-linux ~ppc-macos ~x64-macos ~x86-solaris"
+IUSE="alsa nas mmap pulseaudio sndio"
+
+RDEPEND="
+       alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
+       nas? ( >=media-libs/nas-1.9.4[${MULTILIB_USEDEP}] )
+       pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
+       sndio? ( media-sound/sndio:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+       "${FILESDIR}"/${P}-implicit.patch
+       "${FILESDIR}"/${P}-automagic_sndio_oss.patch
+)
+
+src_prepare() {
+       default
+       sed -i "s:/lib:/$(get_libdir):g" ao.m4 || die
+       eautoreconf
+}
+
+multilib_src_configure() {
+       local myeconfargs=(
+               --disable-arts
+               --disable-esd
+               --disable-static
+               $(use_enable alsa alsa)
+               $(use_enable mmap alsa-mmap)
+               $(use_enable nas)
+               $(use_enable pulseaudio pulse)
+               $(use_enable sndio)
+               --disable-oss # present only in overlays
+       )
+       ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
+}
+
+multilib_src_install() {
+       emake DESTDIR="${D}" docdir="${EPREFIX}/usr/share/doc/${PF}/html" 
install
+}
+
+multilib_src_install_all() {
+       dodoc AUTHORS CHANGES README TODO
+
+       find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
+}

diff --git a/media-libs/libao/metadata.xml b/media-libs/libao/metadata.xml
index c870d0eef0a..ea193e38f4d 100644
--- a/media-libs/libao/metadata.xml
+++ b/media-libs/libao/metadata.xml
@@ -5,4 +5,7 @@
        <email>so...@gentoo.org</email>
        <name>Gentoo Sound project</name>
 </maintainer>
+<use>
+       <flag name="sndio">Add support for <pkg>media-sound/sndio</pkg></flag>
+</use>
 </pkgmetadata>

diff --git a/profiles/arch/alpha/package.use.mask 
b/profiles/arch/alpha/package.use.mask
index 35da5fb33b0..a9342f00f37 100644
--- a/profiles/arch/alpha/package.use.mask
+++ b/profiles/arch/alpha/package.use.mask
@@ -37,6 +37,7 @@ media-video/ffmpeg sndio
 media-sound/moc sndio
 media-sound/mpd sndio
 media-libs/libsdl2 sndio
+media-libs/libao sndio
 
 # Sam James <s...@gentoo.org> (2021-01-19)
 # Avoid pulling in a large unkeyworded dep

Reply via email to