git: 18e5fa858bb6 - main - graphics/gdal: Fix MYSQL option

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Mon, 04 Sep 2023 09:08:39 UTC
The branch main has been updated by sunpoet:

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

commit 18e5fa858bb60e1c70006acf2e6b966d411dd8de
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-09-04 09:04:30 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-09-04 09:04:30 +0000

    graphics/gdal: Fix MYSQL option
    
    PR:             269256
    Reported by:    Martin Birgmeier <d8zNeCFG@aon.at>
---
 graphics/gdal/Makefile          |  1 +
 graphics/gdal/files/patch-mysql | 11 +++++++++++
 2 files changed, 12 insertions(+)

diff --git a/graphics/gdal/Makefile b/graphics/gdal/Makefile
index 0f6802fc166f..a06daf493b9f 100644
--- a/graphics/gdal/Makefile
+++ b/graphics/gdal/Makefile
@@ -199,6 +199,7 @@ ZSTD_CMAKE_BOOL=	GDAL_USE_ZSTD
 ZSTD_LIB_DEPENDS=	libzstd.so:archivers/zstd
 
 post-patch:
+	@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' ${WRKSRC}/cmake/modules/packages/FindMySQL.cmake
 # Clean up bundled libraries
 	@${RM} -r ${WRKSRC}/alg/internal_libqhull/
 	@${RM} -r ${WRKSRC}/frmts/gif/giflib/
diff --git a/graphics/gdal/files/patch-mysql b/graphics/gdal/files/patch-mysql
new file mode 100644
index 000000000000..0ecdfcec739d
--- /dev/null
+++ b/graphics/gdal/files/patch-mysql
@@ -0,0 +1,11 @@
+--- cmake/modules/packages/FindMySQL.cmake.orig	2023-07-06 11:14:14 UTC
++++ cmake/modules/packages/FindMySQL.cmake
+@@ -23,7 +23,7 @@ if( MYSQL_INCLUDE_DIR AND EXISTS "${MYSQL_INCLUDE_DIR}
+             "${MYSQL_VERSION_H}" )
+ endif()
+ 
+-find_library(MYSQL_LIBRARY NAMES mysqlclient mysqlclient_r)
++find_library(MYSQL_LIBRARY NAMES mysqlclient mysqlclient_r PATHS %%LOCALBASE%%/lib/mysql)
+ 
+ if( NOT CMAKE_C_COMPILER_LOADED )
+     message(AUTHOR_WARNING "C language not enabled: Skipping detection of extra link libraries.")