git: f33bae87bb39 - main - audio/ocp: Fix detection using pkg-config with libmad 0.16

From: Daniel Engberg <diizzy_at_FreeBSD.org>
Date: Mon, 09 May 2022 00:01:15 UTC
The branch main has been updated by diizzy:

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

commit f33bae87bb39ae853b2e268a459e8900135d2029
Author:     Daniel Engberg <diizzy@FreeBSD.org>
AuthorDate: 2022-05-08 23:59:19 +0000
Commit:     Daniel Engberg <diizzy@FreeBSD.org>
CommitDate: 2022-05-09 00:01:00 +0000

    audio/ocp: Fix detection using pkg-config with libmad 0.16
    
    Filename for libmad's pc file is now libmad.pc, this broke pkg-config
    check however fallback detection code still worked.
    
    Approved by:    portmgr (blanket)
---
 audio/ocp/files/patch-configure | 46 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 46 insertions(+)

diff --git a/audio/ocp/files/patch-configure b/audio/ocp/files/patch-configure
new file mode 100644
index 000000000000..95716fbbddfd
--- /dev/null
+++ b/audio/ocp/files/patch-configure
@@ -0,0 +1,46 @@
+--- configure.orig	2022-05-08 19:20:04 UTC
++++ configure
+@@ -8815,12 +8815,12 @@ if test -n "$MAD_CFLAGS"; then
+     pkg_cv_MAD_CFLAGS="$MAD_CFLAGS"
+  elif test -n "$PKG_CONFIG"; then
+     if test -n "$PKG_CONFIG" && \
+-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mad\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "mad") 2>&5
++    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmad\""; } >&5
++  ($PKG_CONFIG --exists --print-errors "libmad") 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; then
+-  pkg_cv_MAD_CFLAGS=`$PKG_CONFIG --cflags "mad" 2>/dev/null`
++  pkg_cv_MAD_CFLAGS=`$PKG_CONFIG --cflags "libmad" 2>/dev/null`
+ 		      test "x$?" != "x0" && pkg_failed=yes
+ else
+   pkg_failed=yes
+@@ -8832,12 +8832,12 @@ if test -n "$MAD_LIBS"; then
+     pkg_cv_MAD_LIBS="$MAD_LIBS"
+  elif test -n "$PKG_CONFIG"; then
+     if test -n "$PKG_CONFIG" && \
+-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"mad\""; } >&5
+-  ($PKG_CONFIG --exists --print-errors "mad") 2>&5
++    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libmad\""; } >&5
++  ($PKG_CONFIG --exists --print-errors "libmad") 2>&5
+   ac_status=$?
+   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+   test $ac_status = 0; }; then
+-  pkg_cv_MAD_LIBS=`$PKG_CONFIG --libs "mad" 2>/dev/null`
++  pkg_cv_MAD_LIBS=`$PKG_CONFIG --libs "libmad" 2>/dev/null`
+ 		      test "x$?" != "x0" && pkg_failed=yes
+ else
+   pkg_failed=yes
+@@ -8858,9 +8858,9 @@ else
+         _pkg_short_errors_supported=no
+ fi
+         if test $_pkg_short_errors_supported = yes; then
+-	        MAD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "mad" 2>&1`
++	        MAD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libmad" 2>&1`
+         else
+-	        MAD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "mad" 2>&1`
++	        MAD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libmad" 2>&1`
+         fi
+ 	# Put the nasty error message in config.log where it belongs
+ 	echo "$MAD_PKG_ERRORS" >&5