git: 6e980054b5f3 - main - databases/mysql57-{client,server}: Use bundled protobuf

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Thu, 14 Dec 2023 17:03:23 UTC
The branch main has been updated by sunpoet:

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

commit 6e980054b5f371e5d5512613fa79445863e90f68
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-12-14 16:22:25 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-12-14 17:03:03 +0000

    databases/mysql57-{client,server}: Use bundled protobuf
    
    - Bump PORTREVISION for dependency and package change
    
    mysql57 failed to build with protobuf 22+. Since the maintainer already committed
    a fix [1] on mysql80 to use bundled protobuf, we take the same approach to avoid
    build error with protobuf 22+ from ports tree and potential issue.
    
    PR:             270289
    Reference:      https://cgit.freebsd.org/ports/commit/?id=567557abbfc0a4deec492983ffc01da78c62bae4 [1]
---
 databases/mysql57-client/Makefile             |  2 +-
 databases/mysql57-server/Makefile             |  8 +++----
 databases/mysql57-server/files/patch-protobuf | 32 ---------------------------
 3 files changed, 5 insertions(+), 37 deletions(-)

diff --git a/databases/mysql57-client/Makefile b/databases/mysql57-client/Makefile
index 1d0f056d736c..3fbe5dcb7a63 100644
--- a/databases/mysql57-client/Makefile
+++ b/databases/mysql57-client/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	mysql
-PORTREVISION=	0
+PORTREVISION=	1
 PKGNAMESUFFIX=	57-client
 
 COMMENT=	Multithreaded SQL database (client)
diff --git a/databases/mysql57-server/Makefile b/databases/mysql57-server/Makefile
index 12692e94682e..0aae5a5ded25 100644
--- a/databases/mysql57-server/Makefile
+++ b/databases/mysql57-server/Makefile
@@ -1,6 +1,6 @@
 PORTNAME?=	mysql
 PORTVERSION=	5.7.44
-PORTREVISION?=	0
+PORTREVISION?=	1
 CATEGORIES=	databases
 MASTER_SITES=	MYSQL/MySQL-5.7
 PKGNAMESUFFIX?=	57-server
@@ -30,8 +30,7 @@ MY_TMPDIR=	/var/db/mysql_tmpdir
 
 LIB_DEPENDS+=	libcurl.so:ftp/curl \
 		libevent.so:devel/libevent \
-		liblz4.so:archivers/liblz4 \
-		libprotobuf.so:devel/protobuf
+		liblz4.so:archivers/liblz4
 
 CMAKE_BUILD_TYPE=	Release
 
@@ -43,6 +42,7 @@ CMAKE_ARGS+=	-DINSTALL_LAYOUT=FREEBSD \
 		-DINSTALL_INCLUDEDIR="include/mysql" \
 		-DINSTALL_INFODIR="${INFO_PATH}" \
 		-DINSTALL_LIBDIR="lib/mysql" \
+		-DINSTALL_PRIV_LIBDIR="lib/mysql/private" \
 		-DINSTALL_MANDIR="share/man" \
 		-DINSTALL_MYSQLDATADIR="${MY_DBDIR}" \
 		-DINSTALL_MYSQLKEYRINGDIR="etc/mysql/keyring" \
@@ -60,7 +60,7 @@ CMAKE_ARGS+=	-DINSTALL_LAYOUT=FREEBSD \
 		-DWITH_LIBEVENT=system \
 		-DWITH_LZ4=system \
 		-DWITH_ZLIB=system \
-		-DWITH_PROTOBUF=system \
+		-DWITH_PROTOBUF=bundled \
 		-DWITH_CURL=system \
 		-DINSTALL_MYSQLTESTDIR=0 \
 		-DWITH_DEBUG=0
diff --git a/databases/mysql57-server/files/patch-protobuf b/databases/mysql57-server/files/patch-protobuf
deleted file mode 100644
index 4326fdb49df2..000000000000
--- a/databases/mysql57-server/files/patch-protobuf
+++ /dev/null
@@ -1,32 +0,0 @@
-Deprecated 2-parameter SetTotalBytesLimit() has be removed since protobuf 3.18.0.
-
-Reference:	https://github.com/protocolbuffers/protobuf/commit/cda795437d00a15f375d3d5e2659adac715459c6
-
---- rapid/plugin/x/mysqlxtest_src/mysqlxtest.cc.orig	2021-11-29 20:09:43 UTC
-+++ rapid/plugin/x/mysqlxtest_src/mysqlxtest.cc
-@@ -629,12 +629,12 @@ class ErrorDumper : public ::google::protobuf::io::Err
-   std::stringstream m_out;
- 
- public:
--  virtual void AddError(int line, int column, const string & message)
-+  virtual void AddError(int line, int column, const std::string & message)
-   {
-     m_out << "ERROR in message: line " << line+1 << ": column " << column << ": " << message<<"\n";
-   }
- 
--  virtual void AddWarning(int line, int column, const string & message)
-+  virtual void AddWarning(int line, int column, const std::string & message)
-   {
-     m_out << "WARNING in message: line " << line+1 << ": column " << column << ": " << message<<"\n";
-   }
---- rapid/plugin/x/ngs/src/protocol_decoder.cc.orig	2021-11-29 20:09:43 UTC
-+++ rapid/plugin/x/ngs/src/protocol_decoder.cc
-@@ -123,7 +123,7 @@ Error_code Message_decoder::parse(Request &request)
-     google::protobuf::io::CodedInputStream stream(reinterpret_cast<const uint8_t*>(request.buffer()),
-                                                   static_cast<int>(request.buffer_size()));
-     // variable 'mysqlx_max_allowed_packet' has been checked when buffer was filling by data
--    stream.SetTotalBytesLimit(static_cast<int>(request.buffer_size()), -1 /*no warnings*/);
-+    stream.SetTotalBytesLimit(static_cast<int>(request.buffer_size()));
-     // Protobuf limits the number of nested objects when decoding messages
-     // lets set the value in explicit way (to ensure that is set accordingly with
-     // out stack size)