commit:     14bde54732e00d72e472d23542c2c7d887275de6
Author:     Lucio Sauer <watermanpaint <AT> posteo <DOT> net>
AuthorDate: Thu Jan 25 09:02:45 2024 +0000
Commit:     Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
CommitDate: Fri Jan 26 07:57:13 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14bde547

media-sound/fluidsynth: Add USE flag doc for API documentation

Signed-off-by: Lucio Sauer <watermanpaint <AT> posteo.net>
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>

 media-sound/fluidsynth/fluidsynth-2.3.4.ebuild | 26 +++++++++++++++++++++++++-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/media-sound/fluidsynth/fluidsynth-2.3.4.ebuild 
b/media-sound/fluidsynth/fluidsynth-2.3.4.ebuild
index e1b9a0c3bb5e..e0278bd4e0f5 100644
--- a/media-sound/fluidsynth/fluidsynth-2.3.4.ebuild
+++ b/media-sound/fluidsynth/fluidsynth-2.3.4.ebuild
@@ -12,10 +12,14 @@ 
SRC_URI="https://github.com/FluidSynth/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.g
 LICENSE="LGPL-2.1+"
 SLOT="0/3"
 KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ppc ppc64 ~riscv sparc x86"
-IUSE="alsa dbus debug ipv6 jack ladspa lash network oss pipewire portaudio 
pulseaudio +readline sdl +sndfile systemd threads"
+IUSE="alsa dbus debug doc ipv6 jack ladspa lash network oss pipewire portaudio 
pulseaudio +readline sdl +sndfile systemd threads"
 
 BDEPEND="
        virtual/pkgconfig
+       doc? (
+               app-text/doxygen
+               dev-libs/libxslt
+       )
 "
 DEPEND="
        dev-libs/glib:2[${MULTILIB_USEDEP}]
@@ -73,6 +77,7 @@ src_configure() {
                -Denable-ubsan=OFF # compile and link against UBSan (for 
debugging fluidsynth internals)
                -Denable-waveout=OFF # Windows
                -Denable-winmidi=OFF # Windows
+               $(cmake_use_find_package doc Doxygen)
        )
 
        if use alsa; then
@@ -88,6 +93,22 @@ src_configure() {
        cmake-multilib_src_configure
 }
 
+compile_doxygen_doc() {
+       multilib_is_native_abi && cmake_build doxygen
+}
+
+src_compile() {
+       cmake-multilib_src_compile
+       use doc && multilib_foreach_abi compile_doxygen_doc
+}
+
+install_doxygen_doc() {
+       if multilib_is_native_abi; then
+               docinto .
+               dodoc -r "${BUILD_DIR}/doc/api/html"
+       fi
+}
+
 install_systemd_files() {
        if multilib_is_native_abi; then
                systemd_dounit "${BUILD_DIR}/fluidsynth.service"
@@ -109,6 +130,9 @@ src_install() {
        docinto examples
        dodoc doc/examples/*.c
 
+       if use doc; then
+               multilib_foreach_abi install_doxygen_doc
+       fi
        if use systemd; then
                multilib_foreach_abi install_systemd_files
 

Reply via email to