commit:     e6387a7bdbab6425bb3306d16b778424e12c8440
Author:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 15 21:33:54 2024 +0000
Commit:     Ionen Wolkens <ionen <AT> gentoo <DOT> org>
CommitDate: Fri Nov 15 22:24:50 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e6387a7b

media-sound/cava: add 0.10.3

Signed-off-by: Ionen Wolkens <ionen <AT> gentoo.org>

 media-sound/cava/Manifest                          |  1 +
 media-sound/cava/cava-0.10.3.ebuild                | 87 ++++++++++++++++++++++
 .../cava/files/cava-0.10.3-gentoo-iniparser4.patch | 15 ++++
 3 files changed, 103 insertions(+)

diff --git a/media-sound/cava/Manifest b/media-sound/cava/Manifest
index 52c7f5a5cdcb..6558228f2ead 100644
--- a/media-sound/cava/Manifest
+++ b/media-sound/cava/Manifest
@@ -1 +1,2 @@
 DIST cava-0.10.2.tar.gz 130036 BLAKE2B 
155a0152571a6b1b847340fe438389f58b963af047d4136595a8b2933a4ac5b1fff87600110765c7c1500072ebd8b730d971918b8701598526052d137465ac81
 SHA512 
c28ef5a89668b8f90a3b4cbf71b208dd067268d5ed9eca35ff3881bfab0fd7bf72efe2164f29af47ca7972637d8f1d6a86ff2b2e0c9c9221a1856d8dfa960065
+DIST cava-0.10.3.tar.gz 297550 BLAKE2B 
fbe4146aeeb07c99b37efd08a65e381e2cfc8800429fe3e144db76fc53c47f747f644d9d01146c7ec300d6b3d886492ab2cef44c1511691ec35b748f3fa188a2
 SHA512 
35ee4821e094c2ea567012329c21a8283450100eada4f7e33f7decd935db94adbefd2a2a41801e0ef49eea0dcd859c397c5b3dc7316f0640394d67e3b658876c

diff --git a/media-sound/cava/cava-0.10.3.ebuild 
b/media-sound/cava/cava-0.10.3.ebuild
new file mode 100644
index 000000000000..92919781923f
--- /dev/null
+++ b/media-sound/cava/cava-0.10.3.ebuild
@@ -0,0 +1,87 @@
+# Copyright 2022-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools toolchain-funcs
+
+DESCRIPTION="Console-based Audio Visualizer for Alsa"
+HOMEPAGE="https://github.com/karlstav/cava/";
+SRC_URI="
+       https://github.com/karlstav/cava/archive/refs/tags/${PV}.tar.gz
+               -> ${P}.tar.gz
+"
+
+LICENSE="MIT Unlicense"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="alsa jack +ncurses pipewire portaudio pulseaudio sdl sndio"
+
+RDEPEND="
+       dev-libs/iniparser:4
+       sci-libs/fftw:3.0=
+       alsa? ( media-libs/alsa-lib )
+       jack? ( virtual/jack )
+       ncurses? ( sys-libs/ncurses:= )
+       pipewire? ( media-video/pipewire:= )
+       portaudio? ( media-libs/portaudio )
+       pulseaudio? ( media-libs/libpulse )
+       sdl? (
+               media-libs/libglvnd
+               media-libs/libsdl2[opengl,video]
+       )
+       sndio? ( media-sound/sndio:= )
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+       virtual/pkgconfig
+       sdl? ( dev-build/autoconf-archive )
+"
+
+src_prepare() {
+       # TODO: depend on >=4.2.2 and remove after 4.2.2 is stable unless bug
+       # #933610 reintroduces slotting hacks (also drop ${inip} below)
+       local inip=
+       if has_version '<dev-libs/iniparser-4.2.2:4'; then
+               inip=4
+               eapply "${FILESDIR}"/${PN}-0.10.3-gentoo-iniparser4.patch
+       fi
+
+       default
+
+       # respect both ESYSROOT+slotting (can't use CPPFLAGS, comes before)
+       sed -i "s|/usr/include/iniparser|${ESYSROOT}&${inip} |" configure.ac || 
die
+
+       echo ${PV} > version || die
+       eautoreconf
+}
+
+src_configure() {
+       local econfargs=(
+               $(use_enable alsa input-alsa)
+               $(use_enable jack input-jack)
+               $(use_enable pipewire input-pipewire)
+               $(use_enable portaudio input-portaudio)
+               $(use_enable pulseaudio input-pulse)
+               $(use_enable sndio input-sndio)
+
+               $(use_enable ncurses output-ncurses)
+               $(use_enable sdl output-sdl)
+               # note: not behind USE=opengl and sdl2[opengl?] given have not 
gotten
+               # normal output-sdl to work without USE=opengl on sdl either way
+               $(use_enable sdl output-sdl_glsl)
+       )
+
+       # autoconf-archive (currently) does not support -lOpenGL for 
libglvnd[-X]
+       use sdl && econfargs+=( GL_LIBS="$($(tc-getPKG_CONFIG) --libs opengl || 
die)" )
+
+       econf "${econfargs[@]}"
+}
+
+pkg_postinst() {
+       if [[ ! ${REPLACING_VERSIONS##* } ]]; then
+               elog "A default ~/.config/cava/config will be created after 
initial"
+               elog "use of ${PN}, see it and 
${EROOT}/usr/share/doc/${PF}/README*"
+               elog "for configuring audio input and more."
+       fi
+}

diff --git a/media-sound/cava/files/cava-0.10.3-gentoo-iniparser4.patch 
b/media-sound/cava/files/cava-0.10.3-gentoo-iniparser4.patch
new file mode 100644
index 000000000000..30b9d9dc4600
--- /dev/null
+++ b/media-sound/cava/files/cava-0.10.3-gentoo-iniparser4.patch
@@ -0,0 +1,15 @@
+Gentoo uses non-standard naming for slotted iniparser:4 and it
+does not have a pkg-config file (ideally should be unslotted).
+Cava can use iniparser:0 as well but <3.2 forces legacy mode.
+
+See also: https://bugs.gentoo.org/933610
+--- a/configure.ac
++++ b/configure.ac
+@@ -424,5 +424,5 @@
+ 
+-AC_CHECK_LIB(iniparser,iniparser_load, have_iniparser=yes, have_iniparser=no)
++AC_CHECK_LIB(iniparser4,iniparser_load, have_iniparser=yes, have_iniparser=no)
+     if [[ $have_iniparser = "yes" ]] ; then
+-    LIBS="$LIBS -liniparser"
++    LIBS="$LIBS -liniparser4"
+     if [[ $build_mac = "yes" ]] ; then

Reply via email to