git: 209915b076fd - main - multimedia/motion: unbreak the port's build against MYSQL option

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Sun, 15 May 2022 14:30:36 UTC
The branch main has been updated by danfe:

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

commit 209915b076fd1f1989dde37f4a2173ca80eb7c9f
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2022-05-15 14:29:10 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2022-05-15 14:29:10 +0000

    multimedia/motion: unbreak the port's build against MYSQL option
    
    This is not a 100% correct fix, more of a mitigation: ``pkg-config
    --cflags mysqlclient'' fails with default OpenSSL, and thus MySQL
    header files could be be found:
    
      Package openssl was not found in the pkg-config search path.
      Perhaps you should add the directory containing `openssl.pc'
      to the PKG_CONFIG_PATH environment variable
      Package 'openssl', required by 'mysqlclient', not found
    
    The configure script makes several other bogus (at least in FreeBSD
    context) assumptions, but those could be fixed in a separate commit.
    
    Drop no longer supported options from the CONFIGURE_ARGS while here.
---
 multimedia/motion/Makefile                 |  9 +--------
 multimedia/motion/files/patch-configure.ac | 28 ++++++++++++++++++++++++++++
 2 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/multimedia/motion/Makefile b/multimedia/motion/Makefile
index 75aeff3b296f..d3e8702f7d96 100644
--- a/multimedia/motion/Makefile
+++ b/multimedia/motion/Makefile
@@ -28,8 +28,6 @@ GH_ACCOUNT=	Motion-Project
 USE_RC_SUBR=	${PORTNAME}
 
 GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--without-linuxthreads \
-		--without-jpeg-mmx
 
 # Standard bsd.port.mk variables
 SUB_FILES=	pkg-message
@@ -63,8 +61,7 @@ FFMPEG_CONFIGURE_ON=	--with-ffmpeg=${LOCALBASE}
 FFMPEG_CONFIGURE_OFF=	--without-ffmpeg
 
 MYSQL_USES=		mysql
-MYSQL_CONFIGURE_ON=	--with-mysql-lib=${LOCALBASE}/lib/mysql \
-			--with-mysql-include=${LOCALBASE}/include/mysql
+MYSQL_CONFIGURE_ON=	--with-mysql=${LOCALBASE}/include/mysql
 MYSQL_CONFIGURE_OFF=	--without-mysql
 
 PGSQL_USES=		pgsql
@@ -85,10 +82,6 @@ WEBCAMD_CONFIGURE_WITH=	pwcbsd
 
 .include <bsd.port.pre.mk>
 
-.if ${JPEG_PORT} == "graphics/jpeg-turbo"
-CONFIGURE_ARGS+=	--with-jpeg-turbo=${LOCALBASE}
-.endif
-
 post-patch:
 	@${REINPLACE_CMD} -e \
 		's|/usr/local|${LOCALBASE}|g' ${WRKSRC}/configure.ac
diff --git a/multimedia/motion/files/patch-configure.ac b/multimedia/motion/files/patch-configure.ac
new file mode 100644
index 000000000000..90ec4379d3b6
--- /dev/null
+++ b/multimedia/motion/files/patch-configure.ac
@@ -0,0 +1,28 @@
+--- configure.ac.orig	2020-10-25 20:53:44 UTC
++++ configure.ac
+@@ -327,15 +327,11 @@ AS_IF([test "${MYSQL}" = "no"], [
+     AC_MSG_CHECKING(for MySQL)
+     AC_MSG_RESULT(skipped)
+   ],[
+-    TEMP_PATH=$PKG_CONFIG_PATH
+-    AC_MSG_CHECKING(MySQL pkg-config path)
+     AS_IF([test "${MYSQL}" != "yes"], [
+-        PKG_CONFIG_PATH=${MYSQL}/lib/pkgconfig:$PKG_CONFIG_PATH
++        TEMP_CFLAGS="$TEMP_CFLAGS -I${MYSQL}"
+         MYSQL="yes"
+       ]
+     )
+-    export PKG_CONFIG_PATH
+-    AC_MSG_RESULT($PKG_CONFIG_PATH)
+ 
+     AC_MSG_CHECKING(for MySQL)
+     AS_IF([pkg-config mysqlclient], [
+@@ -347,8 +343,6 @@ AS_IF([test "${MYSQL}" = "no"], [
+       ]
+     )
+     AC_MSG_RESULT([$MYSQL])
+-    PKG_CONFIG_PATH=$TEMP_PATH
+-    export PKG_CONFIG_PATH
+   ]
+ )
+