git: 4e305910ee19 - main - databases/proxysql: Update to 3.0.6

From: Ryan Steinmetz <zi_at_FreeBSD.org>
Date: Thu, 19 Mar 2026 14:58:46 UTC
The branch main has been updated by zi:

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

commit 4e305910ee19c394cf511b72be807c036d2cb0ed
Author:     Ryan Steinmetz <zi@FreeBSD.org>
AuthorDate: 2026-03-19 14:58:40 +0000
Commit:     Ryan Steinmetz <zi@FreeBSD.org>
CommitDate: 2026-03-19 14:58:40 +0000

    databases/proxysql: Update to 3.0.6
---
 databases/proxysql/Makefile                        | 28 ++++++++++++++++------
 databases/proxysql/distinfo                        |  6 ++---
 .../patch-include_MySQL__HostGroups__Manager.h     | 14 -----------
 .../proxysql/files/patch-include_PgSQL__Thread.h   | 14 +++++++++++
 .../proxysql/files/patch-include_proxysql__utils.h | 22 +++++++++++++++++
 .../proxysql/files/patch-lib_PgSQL__Monitor.cpp    | 14 +++++++++++
 .../proxysql/files/patch-lib_ProxySQL__Admin.cpp   | 20 +++++++++-------
 .../proxysql/files/patch-lib_ProxySQL__GloVars.cpp | 14 -----------
 .../files/patch-lib_proxy__protocol__info.cpp      | 12 ++++++++++
 .../proxysql/files/patch-lib_proxysql__utils.cpp   | 16 +++++++++++++
 10 files changed, 113 insertions(+), 47 deletions(-)

diff --git a/databases/proxysql/Makefile b/databases/proxysql/Makefile
index b7c9ee594233..b136eada9ae1 100644
--- a/databases/proxysql/Makefile
+++ b/databases/proxysql/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	proxysql
-PORTVERSION=	2.6.6
-PORTREVISION=	1
+PORTVERSION=	3.0.6
 CATEGORIES=	databases
 
 MAINTAINER=	zi@FreeBSD.org
@@ -17,19 +16,18 @@ BUILD_DEPENDS=	aclocal:devel/automake \
 		ggrep:textproc/gnugrep \
 		libgcrypt>0:security/libgcrypt \
 		libtoolize:devel/libtool \
+		libevent>0:devel/libevent \
 		gnutls>0:security/gnutls
 LIB_DEPENDS=	libuuid.so:misc/libuuid
 RUN_DEPENDS=	libgcrypt>0:security/libgcrypt \
 		gnutls>0:security/gnutls
 
-USES=		compiler:c++11-lang gmake libtool perl5 python:build shebangfix
+USES=		bison:build compiler:c++11-lang gmake libtool perl5 pkgconfig python:build ssl
 USE_PERL5=	build
 USE_GCC=	yes
-MAKE_ENV=	GIT_VERSION=${PORTVERSION}
+MAKE_ENV=	GIT_VERSION="${PORTVERSION}" SOURCE_DATE_EPOCH="$$(date +%s)"
 USE_GITHUB=	yes
 ALL_TARGET=	build_deps default
-SHEBANG_FILES=	deps/libssl/verify-bio_st-match.sh
-CFLAGS+=	-DEV_USE_INOTIFY=0
 LDFLAGS+=	-L${LOCALBASE}/lib
 BINARY_ALIAS=	python3=${PYTHON_CMD}
 USE_RC_SUBR=	${PORTNAME}
@@ -39,6 +37,12 @@ GROUPS=		${PORTNAME}
 
 GH_ACCOUNT=	sysown
 
+.include <bsd.port.pre.mk>
+
+.if (${OSVERSION} < 1400000 && ${SSL_DEFAULT} == "base")
+IGNORE=		requires OpenSSL 3.x or greater
+.endif
+
 post-patch:
 	@${REINPLACE_CMD} -e 's,/etc/,${ETCDIR}/,g' ${WRKSRC}/lib/ProxySQL_GloVars.cpp
 	@${REINPLACE_CMD} \
@@ -50,8 +54,18 @@ post-patch:
 		-e 's,grep -P,g&,' \
 		-e '/ export C/d' \
 		-e 's,PROXYSQLCLICKHOUSE=1 ,,g' \
+		-e '/cd curl/s,$${MAKE},${GMAKE},' \
+		-e '/cd libmicrohttpd/s,$${MAKE},${GMAKE},' \
+		-e '/cd lz4/s,$${MAKE},${GMAKE},' \
+		-e '/cd libhttpserver.*MAKE/s,CC,MAKE=${GMAKE} CC,' \
+		-e '/cd libhttpserver/s,$${MAKE},${GMAKE},' \
+		-e '/get_result_from_pgconn/s,-p0,-p0 -l,' \
+		-e 's,without-readline,without-readline --without-icu,g' \
 		-e 's,--enable-fastopen=false ,--enable-fastopen=false --enable-shared=no ,g' \
 		${WRKSRC}/Makefile ${WRKSRC}/deps/Makefile
+	@${REINPLACE_CMD} -e 's,grep -oP,ggrep -oP,g' ${WRKSRC}/common_mk/*.mk
+	@${REINPLACE_CMD} -e 's,ENABLE_EPOLL := -DENABLE_EPOLL,ENABLE_EPOLL :=,g' \
+		${WRKSRC}/lib/Makefile
 
 do-install:
 	${INSTALL_PROGRAM} ${WRKSRC}/src/proxysql ${STAGEDIR}${LOCALBASE}/sbin
@@ -66,4 +80,4 @@ post-install:
 	${INSTALL_DATA} ${WRKSRC}/src/proxysql.cfg \
 		${STAGEDIR}${ETCDIR}/proxysql.cfg.sample
 
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
diff --git a/databases/proxysql/distinfo b/databases/proxysql/distinfo
index de4abe7a3946..1c1c7b2fb640 100644
--- a/databases/proxysql/distinfo
+++ b/databases/proxysql/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1727108943
-SHA256 (sysown-proxysql-2.6.6_GH0.tar.gz) = c447ac0c4532c6654cc648416e3dd1560824f67406f510efe52c4c6291a1ef4a
-SIZE (sysown-proxysql-2.6.6_GH0.tar.gz) = 50425374
+TIMESTAMP = 1773849369
+SHA256 (sysown-proxysql-3.0.6_GH0.tar.gz) = a56fc549406dcc6c525f5757f60e9b68a7df8b513f8042f5d9fdcd839f270d30
+SIZE (sysown-proxysql-3.0.6_GH0.tar.gz) = 62876841
diff --git a/databases/proxysql/files/patch-include_MySQL__HostGroups__Manager.h b/databases/proxysql/files/patch-include_MySQL__HostGroups__Manager.h
deleted file mode 100644
index 0829899a6aaa..000000000000
--- a/databases/proxysql/files/patch-include_MySQL__HostGroups__Manager.h
+++ /dev/null
@@ -1,14 +0,0 @@
---- include/MySQL_HostGroups_Manager.h.orig	2025-11-05 18:26:00 UTC
-+++ include/MySQL_HostGroups_Manager.h
-@@ -1250,9 +1250,9 @@ T j_get_srv_default_int_val(
- 				return val;
- 			} else {
- 				proxy_error(
--					"Invalid value %ld supplied for 'mysql_hostgroup_attributes.servers_defaults.%s' for hostgroup %d."
-+					"Invalid value %lld supplied for 'mysql_hostgroup_attributes.servers_defaults.%s' for hostgroup %d."
- 						" Value NOT UPDATED.\n",
--					static_cast<int64_t>(val), key.c_str(), hid
-+					static_cast<long long int>(val), key.c_str(), hid
- 				);
- 			}
- 		} else {
diff --git a/databases/proxysql/files/patch-include_PgSQL__Thread.h b/databases/proxysql/files/patch-include_PgSQL__Thread.h
new file mode 100644
index 000000000000..bf8e37a2bded
--- /dev/null
+++ b/databases/proxysql/files/patch-include_PgSQL__Thread.h
@@ -0,0 +1,14 @@
+--- include/PgSQL_Thread.h.orig	2025-11-08 01:19:28 UTC
++++ include/PgSQL_Thread.h
+@@ -212,10 +212,10 @@ class __attribute__((aligned(64))) PgSQL_Thread : publ
+ 	//PtrArray* mysql_sessions;
+ 	PtrArray* mirror_queue_mysql_sessions;
+ 	PtrArray* mirror_queue_mysql_sessions_cache;
++	CopyCmdMatcher *copy_cmd_matcher;
+ #ifdef IDLE_THREADS
+ 	PtrArray* idle_mysql_sessions;
+ 	PtrArray* resume_mysql_sessions;
+-	CopyCmdMatcher *copy_cmd_matcher;
+ 	pgsql_conn_exchange_t myexchange;
+ #endif // IDLE_THREADS
+ 
diff --git a/databases/proxysql/files/patch-include_proxysql__utils.h b/databases/proxysql/files/patch-include_proxysql__utils.h
new file mode 100644
index 000000000000..da6d62c21cf7
--- /dev/null
+++ b/databases/proxysql/files/patch-include_proxysql__utils.h
@@ -0,0 +1,22 @@
+--- include/proxysql_utils.h.orig	2025-11-08 01:40:32 UTC
++++ include/proxysql_utils.h
+@@ -25,19 +25,11 @@
+ #define	ETIME	ETIMEDOUT
+ #endif
+ 
+-#ifdef CXX17
+ template<class...> struct conjunction : std::true_type { };
+-template<class B1> struct std::conjunction<B1> : B1 { };
+-template<class B1, class... Bn>
+-struct std::conjunction<B1, Bn...> 
+-    : std::conditional<bool(B1::value), std::conjunction<Bn...>, B1>::type {};
+-#else
+-template<class...> struct conjunction : std::true_type { };
+ template<class B1> struct conjunction<B1> : B1 { };
+ template<class B1, class... Bn>
+ struct conjunction<B1, Bn...> 
+     : std::conditional<bool(B1::value), conjunction<Bn...>, B1>::type {};
+-#endif // CXX17
+ /**
+  * @brief Stores the result of formatting the first parameter with the provided
+  *  arguments, into the std::string reference provided in the second parameter.
diff --git a/databases/proxysql/files/patch-lib_PgSQL__Monitor.cpp b/databases/proxysql/files/patch-lib_PgSQL__Monitor.cpp
new file mode 100644
index 000000000000..85274fe63c73
--- /dev/null
+++ b/databases/proxysql/files/patch-lib_PgSQL__Monitor.cpp
@@ -0,0 +1,14 @@
+--- lib/PgSQL_Monitor.cpp.orig	2025-11-08 02:06:01 UTC
++++ lib/PgSQL_Monitor.cpp
+@@ -17,6 +17,11 @@
+ #include <vector>
+ #include <list>
+ 
++#ifdef __FreeBSD__
++#include <sys/limits.h>
++#define ULONG_LONG_MAX ULLONG_MAX
++#endif
++
+ using std::function;
+ using std::unique_ptr;
+ using std::vector;
diff --git a/databases/proxysql/files/patch-lib_ProxySQL__Admin.cpp b/databases/proxysql/files/patch-lib_ProxySQL__Admin.cpp
index 3d4ca9be6b03..6ccc4d2821e3 100644
--- a/databases/proxysql/files/patch-lib_ProxySQL__Admin.cpp
+++ b/databases/proxysql/files/patch-lib_ProxySQL__Admin.cpp
@@ -1,11 +1,13 @@
---- lib/ProxySQL_Admin.cpp.orig	2025-11-05 18:44:48 UTC
+--- lib/ProxySQL_Admin.cpp.orig	2026-03-18 17:48:48 UTC
 +++ lib/ProxySQL_Admin.cpp
-@@ -332,7 +332,7 @@ char rand_del[6];
- char rand_del[6];
- 
- //static int http_handler(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **ptr) {
--MHD_Result http_handler(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, long unsigned int *upload_data_size, void **ptr) {
-+MHD_Result http_handler(void *cls, struct MHD_Connection *connection, const char *url, const char *method, const char *version, const char *upload_data, size_t *upload_data_size, void **ptr) {
- 	return (MHD_Result) GloAdmin->AdminHTTPServer->handler(cls, connection, url, method, version, upload_data, upload_data_size, ptr);
- }
+@@ -2726,8 +2726,10 @@ ProxySQL_Admin::ProxySQL_Admin() :
+ 	// processlist configuration
+ 	variables.mysql_processlist.show_extended = 0;
+ 	variables.pgsql_processlist.show_extended = 0;
++#ifdef IDLE_THREADS
+ 	variables.mysql_processlist.show_idle_session = true;
+ 	variables.pgsql_processlist.show_idle_session = true;
++#endif
+ 	variables.mysql_processlist.max_query_length = PROCESSLIST_MAX_QUERY_LEN_DEFAULT;
+ 	variables.pgsql_processlist.max_query_length = PROCESSLIST_MAX_QUERY_LEN_DEFAULT;
  
diff --git a/databases/proxysql/files/patch-lib_ProxySQL__GloVars.cpp b/databases/proxysql/files/patch-lib_ProxySQL__GloVars.cpp
deleted file mode 100644
index d806d2c9ed55..000000000000
--- a/databases/proxysql/files/patch-lib_ProxySQL__GloVars.cpp
+++ /dev/null
@@ -1,14 +0,0 @@
---- lib/ProxySQL_GloVars.cpp.orig	2025-11-05 18:21:29 UTC
-+++ lib/ProxySQL_GloVars.cpp
-@@ -334,7 +334,10 @@ void update_ulong_var_if_set(uint64_t& cur_val, ez::ez
- 
- void update_ulong_var_if_set(uint64_t& cur_val, ez::ezOptionParser* opt, const char* cmd_opt) {
- 	if (opt->isSet(cmd_opt)) {
--		opt->get(cmd_opt)->getULong(cur_val);
-+		unsigned long new_val = cur_val;
-+
-+		opt->get(cmd_opt)->getULong(new_val);
-+		cur_val = new_val;
- 	}
- }
- 
diff --git a/databases/proxysql/files/patch-lib_proxy__protocol__info.cpp b/databases/proxysql/files/patch-lib_proxy__protocol__info.cpp
new file mode 100644
index 000000000000..477087e9bfc1
--- /dev/null
+++ b/databases/proxysql/files/patch-lib_proxy__protocol__info.cpp
@@ -0,0 +1,12 @@
+--- lib/proxy_protocol_info.cpp.orig	2025-11-08 01:35:22 UTC
++++ lib/proxy_protocol_info.cpp
+@@ -3,6 +3,9 @@
+ #include <stdio.h>
+ #include <assert.h>
+ #include <iostream>
++#ifdef __FreeBSD__
++#include <sys/socket.h>
++#endif
+ 
+ static bool DEBUG_ProxyProtocolInfo = false;
+ 
diff --git a/databases/proxysql/files/patch-lib_proxysql__utils.cpp b/databases/proxysql/files/patch-lib_proxysql__utils.cpp
new file mode 100644
index 000000000000..f79704dcd047
--- /dev/null
+++ b/databases/proxysql/files/patch-lib_proxysql__utils.cpp
@@ -0,0 +1,16 @@
+--- lib/proxysql_utils.cpp.orig	2026-01-16 09:33:05 UTC
++++ lib/proxysql_utils.cpp
+@@ -19,7 +19,13 @@
+ #include <unistd.h>
+ #include <dirent.h>
+ #include <sys/syscall.h>
++#ifdef __linux__
+ #include <linux/close_range.h>
++#endif
++#ifdef __FreeBSD__
++#include <sys/socket.h>
++#include <netinet/in.h>
++#endif
+ 
+ using std::function;
+ using std::string;