git: bcd61b6a5e15 - main - audio/jack-capture: Add dependencies; Fix format handling code

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Fri, 04 Nov 2022 21:33:00 UTC
The branch main has been updated by yuri:

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

commit bcd61b6a5e155e44c104892bad8bcb2f3e15977e
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-11-04 15:29:00 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-11-04 21:32:58 +0000

    audio/jack-capture: Add dependencies; Fix format handling code
---
 audio/jack-capture/Makefile                        |  6 ++++
 .../files/patch-gen__das__config__h.sh             | 38 ++++++++++++++++++++++
 .../jack-capture/files/patch-gen__setformat__c.sh  | 11 +++++++
 3 files changed, 55 insertions(+)

diff --git a/audio/jack-capture/Makefile b/audio/jack-capture/Makefile
index e36e617be35b..e727c1c65879 100644
--- a/audio/jack-capture/Makefile
+++ b/audio/jack-capture/Makefile
@@ -1,6 +1,7 @@
 PORTNAME=	jack-capture
 DISTVERSION=	0.9.73-38
 DISTVERSIONSUFFIX=	-g10cec47
+PORTREVISION=	1
 CATEGORIES=	audio
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -12,6 +13,9 @@ LICENSE_FILE=	${WRKSRC}/COPYING
 
 BUILD_DEPENDS=	bash:shells/bash
 LIB_DEPENDS=	libjack.so:audio/jack \
+		liblo.so:audio/liblo \
+		libmp3lame.so:audio/lame \
+		libogg.so:audio/libogg \
 		libsndfile.so:audio/libsndfile
 
 USES=		gmake localbase:ldflags pkgconfig
@@ -20,6 +24,8 @@ USE_GITHUB=	yes
 GH_ACCOUNT=	kmatheussen
 GH_PROJECT=	jack_capture
 
+MAKE_ENV=	CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+
 BINARY_ALIAS=	gcc=${CC} g++=${CXX}
 
 PLIST_FILES=	bin/jack_capture
diff --git a/audio/jack-capture/files/patch-gen__das__config__h.sh b/audio/jack-capture/files/patch-gen__das__config__h.sh
new file mode 100644
index 000000000000..dae63edce55d
--- /dev/null
+++ b/audio/jack-capture/files/patch-gen__das__config__h.sh
@@ -0,0 +1,38 @@
+--- gen_das_config_h.sh.orig	2022-11-04 16:32:42 UTC
++++ gen_das_config_h.sh
+@@ -16,7 +16,7 @@
+ echo "#include <sndfile.h>" >temp$$.c
+ echo "main(){return SF_FORMAT_OGG;}" >>temp$$.c
+ echo >>temp$$.c
+-if gcc temp$$.c 2>/dev/null; then
++if gcc $CFLAGS $LDFLAGS temp$$.c 2>/dev/null; then
+     echo "#define HAVE_OGG 1"
+ else
+     echo "#define HAVE_OGG 0"
+@@ -26,7 +26,7 @@ fi
+ echo "#include <lame/lame.h>" >temp$$.c
+ echo "main(){return 0;}" >>temp$$.c
+ echo >>temp$$.c
+-if gcc temp$$.c -lmp3lame 2>/dev/null; then
++if gcc $CFLAGS $LDFLAGS temp$$.c -lmp3lame 2>/dev/null; then
+     echo "#define HAVE_LAME 1"
+     echo "//COMPILEFLAGS -lmp3lame"
+ else
+@@ -37,7 +37,7 @@ fi
+ echo "#include <lo/lo.h>" >temp$$.c
+ echo "main(){return 0;}" >>temp$$.c
+ echo >>temp$$.c
+-if pkg-config --cflags --libs liblo >/dev/null 2>/dev/null && gcc temp$$.c `pkg-config --cflags --libs liblo` 2>/dev/null ; then
++if pkg-config --cflags --libs liblo >/dev/null 2>/dev/null && gcc $CFLAGS $LDFLAGS temp$$.c `pkg-config --cflags --libs liblo` 2>/dev/null ; then
+     echo "#define HAVE_LIBLO 1"
+     echo "//COMPILEFLAGS " `pkg-config --cflags --libs liblo`
+ else
+@@ -48,7 +48,7 @@ fi
+ echo "#include <jack/jack.h>" >temp$$.c
+ echo "main(){return (int)jack_port_get_latency_range;}" >>temp$$.c
+ echo >>temp$$.c
+-if gcc temp$$.c -ljack 2>/dev/null ; then
++if gcc $CFLAGS $LDFLAGS temp$$.c -ljack 2>/dev/null ; then
+     echo "#define NEW_JACK_LATENCY_API 1"
+ else
+     echo "#define NEW_JACK_LATENCY_API 0"
diff --git a/audio/jack-capture/files/patch-gen__setformat__c.sh b/audio/jack-capture/files/patch-gen__setformat__c.sh
new file mode 100644
index 000000000000..1ed7f8381ab4
--- /dev/null
+++ b/audio/jack-capture/files/patch-gen__setformat__c.sh
@@ -0,0 +1,11 @@
+--- gen_setformat_c.sh.orig	2022-11-04 20:56:46 UTC
++++ gen_setformat_c.sh
+@@ -63,7 +63,7 @@ for a in $ai;do
+     esac
+     echo "main(){return $format;}" >>temp.c
+     echo >>temp.c
+-    if gcc temp.c 2>/dev/null; then
++    if gcc $CFLAGS $LDFLAGS temp.c 2>/dev/null; then
+ 	echo "    (!strcasecmp(\""$a"\",soundfile_format)) ? $format :"
+     fi
+ done