git: d8f39032884a - main - audio/cardinal: Fix build by adding the LIBLO option

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Mon, 08 Apr 2024 19:18:47 UTC
The branch main has been updated by yuri:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d8f39032884a7b0b7a8c742986bc0c1c060f105c

commit d8f39032884a7b0b7a8c742986bc0c1c060f105c
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2024-04-08 19:09:43 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2024-04-08 19:18:42 +0000

    audio/cardinal: Fix build by adding the LIBLO option
    
    The liblo library support is broken in Cardinal.
    
    Reported by:    fallout
---
 audio/cardinal/Makefile                         | 17 ++++++++++++-----
 audio/cardinal/files/patch-dpf_Makefile.base.mk | 14 ++++++++++++++
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/audio/cardinal/Makefile b/audio/cardinal/Makefile
index f8034c508e9a..d28cf75f6ef7 100644
--- a/audio/cardinal/Makefile
+++ b/audio/cardinal/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	cardinal
 DISTVERSION=	23.10
+PORTREVISION=	1
 CATEGORIES=	audio
 MASTER_SITES=	https://github.com/DISTRHO/Cardinal/releases/download/${DISTVERSION}/
 
@@ -19,7 +20,6 @@ LIB_DEPENDS=	libasound.so:audio/alsa-lib \
 		libdbus-1.so:devel/dbus \
 		libfftw3f.so:math/fftw3-float \
 		libjansson.so:devel/jansson \
-		liblo.so:audio/liblo \
 		libpffft.so:math/pffft \
 		libpulse-simple.so:audio/pulseaudio \
 		libsamplerate.so:audio/libsamplerate \
@@ -43,12 +43,19 @@ MAKE_ARGS=	SYSDEPS=true
 BINARY_ALIAS=	gcc-ar=ar \
 		python3=${PYTHON_CMD}
 
-OPTIONS_DEFINE=	DOCS LTO
+OPTIONS_DEFINE=		DOCS LIBLO LTO
+OPTIONS_DEFAULT=	#LIBLO LTO
 
-PORTDOCS=	*
+PORTDOCS=		*
 
-LTO_MAKE_ARGS=	WITH_LTO=true
-LTO_BROKEN=	Fails to build with LTO because it is gcc-centered
+LIBLO_DESC=		Build with liblo
+LIBLO_MAKE_ARGS=	WITH_LTO=true
+LIBLO_MAKE_ARGS_OFF=	WITH_LTO=false
+LIBLO_LIB_DEPENDS=	liblo.so:audio/liblo
+LIBLO_BROKEN=		fails to build with liblo, see https://github.com/DISTRHO/Cardinal/issues/641
+
+LTO_MAKE_ARGS=		WITH_LTO=true
+LTO_BROKEN=		Fails to build with LTO because it is gcc-centered
 
 .include <bsd.port.options.mk>
 
diff --git a/audio/cardinal/files/patch-dpf_Makefile.base.mk b/audio/cardinal/files/patch-dpf_Makefile.base.mk
new file mode 100644
index 000000000000..b8394c0e0b20
--- /dev/null
+++ b/audio/cardinal/files/patch-dpf_Makefile.base.mk
@@ -0,0 +1,14 @@
+
+- workaround for https://github.com/DISTRHO/Cardinal/issues/641
+
+--- dpf/Makefile.base.mk.orig	2024-04-08 16:00:03 UTC
++++ dpf/Makefile.base.mk
+@@ -373,7 +373,7 @@ endif
+ # ---------------------------------------------------------------------------------------------------------------------
+ # Check for optional libraries
+ 
+-HAVE_LIBLO = $(shell $(PKG_CONFIG) --exists liblo && echo true)
++HAVE_LIBLO = $(shell $(PKG_CONFIG) --exists liblo && echo $(WITH_LIBLO))
+ 
+ ifneq ($(SKIP_NATIVE_AUDIO_FALLBACK),true)
+ ifneq ($(SKIP_RTAUDIO_FALLBACK),true)