git: 792accfdd2ee - main - www/freenginx-devel: third-party module management

From: Sergey A. Osokin <osa_at_FreeBSD.org>
Date: Fri, 16 Jan 2026 19:39:15 UTC
The branch main has been updated by osa:

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

commit 792accfdd2ee7513bb14490588bb3f4439337ef4
Author:     Sergey A. Osokin <osa@FreeBSD.org>
AuthorDate: 2026-01-16 19:36:30 +0000
Commit:     Sergey A. Osokin <osa@FreeBSD.org>
CommitDate: 2026-01-16 19:39:06 +0000

    www/freenginx-devel: third-party module management
    
    Update the stream-lua module to its recent release 0.0.17R4,
    and enable it.
    Remove ignore list.
    
    Bump PORTREVISION.
    
    Sponsored by:   tipi.work
---
 www/freenginx-devel/Makefile                       |  4 +---
 www/freenginx-devel/Makefile.extmod                | 11 ++++++---
 www/freenginx-devel/Makefile.ignore                |  3 ---
 www/freenginx-devel/distinfo                       |  6 ++---
 .../files/extra-patch-ngx_stream_lua_module.c      | 11 +++++++++
 .../files/extra-patch-ngx_stream_lua_socket_tcp.c  | 28 ++++++++++++++++++++++
 .../files/extra-patch-ngx_stream_lua_ssl_certby.c  | 11 +++++++++
 ...extra-patch-ngx_stream_lua_ssl_client_helloby.c | 11 +++++++++
 .../files/extra-patch-ngx_stream_lua_time.c        | 24 +++++++++++++++++++
 9 files changed, 97 insertions(+), 12 deletions(-)

diff --git a/www/freenginx-devel/Makefile b/www/freenginx-devel/Makefile
index c031c1954842..81fdbfa026de 100644
--- a/www/freenginx-devel/Makefile
+++ b/www/freenginx-devel/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	freenginx
 PORTVERSION=	${NGINX_VERSION}
 .include "version.mk"
-PORTREVISION=	10
+PORTREVISION=	11
 CATEGORIES=	www
 MASTER_SITES=	https://freenginx.org/download/ \
 		LOCAL/osa
@@ -243,8 +243,6 @@ IGNORE=		required at least GSSAPI_HEIMDAL or \
 		'make config' again
 .endif
 
-.include "Makefile.ignore"
-
 .if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 191
 CFLAGS+=	-Wno-error=cast-function-type-mismatch
 .endif
diff --git a/www/freenginx-devel/Makefile.extmod b/www/freenginx-devel/Makefile.extmod
index 8b54c4413dcd..8d4a628220f7 100644
--- a/www/freenginx-devel/Makefile.extmod
+++ b/www/freenginx-devel/Makefile.extmod
@@ -204,12 +204,17 @@ LUA_IMPLIES=		DEVEL_KIT
 LUA_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty
 LUA_VARS=		DSO_EXTMODS+=lua
 
-LUASTREAM_GH_TUPLE=	openresty:stream-lua-nginx-module:v0.0.17:luastream
+LUASTREAM_GH_TUPLE=	openresty:stream-lua-nginx-module:v0.0.17R4:luastream \
+			openresty:lua-resty-core:0b61f61:luarc \
+			openresty:lua-resty-lrucache:1759068:luarl
 LUASTREAM_CONFIGURE_ENV=LUAJIT_INC=${LOCALBASE}/include/luajit-2.1 \
 			LUAJIT_LIB=${LOCALBASE}/lib
+LUASTREAM_EXTRA_PATCHES=${PATCHDIR}/extra-patch-ngx_stream_lua_module.c \
+			${PATCHDIR}/extra-patch-ngx_stream_lua_socket_tcp.c \
+			${PATCHDIR}/extra-patch-ngx_stream_lua_ssl_certby.c \
+			${PATCHDIR}/extra-patch-ngx_stream_lua_ssl_client_helloby.c \
+			${PATCHDIR}/extra-patch-ngx_stream_lua_time.c
 LUASTREAM_IMPLIES=	DEVEL_KIT
-LUASTREAM_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit-openresty
-LUASTREAM_RUN_DEPENDS=	lua-resty-core>0:www/lua-resty-core
 LUASTREAM_VARS=		DSO_EXTMODS+=luastream
 
 LINK_GH_TUPLE=		Taymindis:nginx-link-function:3.2.4:link
diff --git a/www/freenginx-devel/Makefile.ignore b/www/freenginx-devel/Makefile.ignore
deleted file mode 100644
index e28b60dd751c..000000000000
--- a/www/freenginx-devel/Makefile.ignore
+++ /dev/null
@@ -1,3 +0,0 @@
-.if ${PORT_OPTIONS:MLUASTREAM}
-IGNORE=		lua stream module: patching is required
-.endif
diff --git a/www/freenginx-devel/distinfo b/www/freenginx-devel/distinfo
index 562bd53e37c5..09c30eeaad26 100644
--- a/www/freenginx-devel/distinfo
+++ b/www/freenginx-devel/distinfo
@@ -1,4 +1,4 @@
-TIMESTAMP = 1768316421
+TIMESTAMP = 1768587623
 SHA256 (freenginx-1.29.4.tar.gz) = 51a596451e334b51ce8cef1291b576ed601ed557e1b500e6c1a77a469d603e27
 SIZE (freenginx-1.29.4.tar.gz) = 1249883
 SHA256 (nginx_mogilefs_module-1.0.4.tar.gz) = 7ac230d30907f013dff8d435a118619ea6168aa3714dba62c6962d350c6295ae
@@ -97,8 +97,8 @@ SHA256 (openresty-lua-resty-core-0b61f61_GH0.tar.gz) = 4454559a871381561d21692db
 SIZE (openresty-lua-resty-core-0b61f61_GH0.tar.gz) = 253494
 SHA256 (openresty-lua-resty-lrucache-1759068_GH0.tar.gz) = ab73a5f99eff239f90bd4bfea7cc34304795990d6f5530c6be072a11921807de
 SIZE (openresty-lua-resty-lrucache-1759068_GH0.tar.gz) = 17838
-SHA256 (openresty-stream-lua-nginx-module-v0.0.17_GH0.tar.gz) = 09cf5b90904a575b90c16d5cf861b978ef2dbe6d5340e5eb3707e2d2a3ac5cdc
-SIZE (openresty-stream-lua-nginx-module-v0.0.17_GH0.tar.gz) = 413563
+SHA256 (openresty-stream-lua-nginx-module-v0.0.17R4_GH0.tar.gz) = 214927614eef96d5b1f26c0adaf94a8fd8c32f73dd17e494c217ca40f60e5910
+SIZE (openresty-stream-lua-nginx-module-v0.0.17R4_GH0.tar.gz) = 417131
 SHA256 (openresty-memc-nginx-module-v0.20_GH0.tar.gz) = a42dd56dd6e2144755a127bcd2a6cc1a488258dc5cdb751d6a3e5dd5b6989239
 SIZE (openresty-memc-nginx-module-v0.20_GH0.tar.gz) = 34736
 SHA256 (owasp-modsecurity-ModSecurity-nginx-fd28e6a_GH0.tar.gz) = deafee4e4145a73b9369999e261368b34d4f7ff1be2596a559abd9e1d5df5526
diff --git a/www/freenginx-devel/files/extra-patch-ngx_stream_lua_module.c b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_module.c
new file mode 100644
index 000000000000..e798321a33a5
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_module.c
@@ -0,0 +1,11 @@
+--- ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_module.c.orig	2026-01-16 13:32:48.810091000 -0500
++++ ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_module.c	2026-01-16 13:34:09.124848000 -0500
+@@ -919,7 +919,7 @@
+     ngx_stream_lua_srv_conf_t       *conf = child;
+ 
+ #if (NGX_STREAM_SSL)
+-#if defined(nginx_version) && nginx_version >= 1025005
++#if !defined (freenginx) && (defined(nginx_version) && nginx_version >= 1025005)
+     ngx_stream_ssl_srv_conf_t       *sscf;
+ #else
+     ngx_stream_ssl_conf_t           *sscf;
diff --git a/www/freenginx-devel/files/extra-patch-ngx_stream_lua_socket_tcp.c b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_socket_tcp.c
new file mode 100644
index 000000000000..2baadf6e3d75
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_socket_tcp.c
@@ -0,0 +1,28 @@
+--- ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_socket_tcp.c.orig	2026-01-16 13:52:57.596777000 -0500
++++ ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_socket_tcp.c	2026-01-16 13:58:13.256356000 -0500
+@@ -2072,7 +2072,9 @@
+     ngx_stream_lua_ctx_t                        *ctx;
+     ngx_stream_lua_co_ctx_t                     *coctx;
+     ngx_stream_lua_socket_tcp_upstream_t        *u;
++#if !defined (freenginx)
+     ngx_stream_ssl_srv_conf_t                   *sscf;
++#endif
+ 
+     /* Lua function arguments: self */
+ 
+@@ -2128,6 +2130,7 @@
+         return 1;
+     }
+ 
++#if !defined (freenginx)
+     sscf = ngx_stream_get_module_srv_conf(r->session, ngx_stream_ssl_module);
+ 
+     if (sscf == NULL || sscf->ssl.ctx == NULL) {
+@@ -2141,6 +2144,7 @@
+         lua_pushliteral(L, "failed to create ssl connection");
+         return 2;
+     }
++#endif
+ 
+     ctx = ngx_stream_lua_get_module_ctx(r, ngx_stream_lua_module);
+     if (ctx == NULL) {
diff --git a/www/freenginx-devel/files/extra-patch-ngx_stream_lua_ssl_certby.c b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_ssl_certby.c
new file mode 100644
index 000000000000..0d7731cd24bf
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_ssl_certby.c
@@ -0,0 +1,11 @@
+--- ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_ssl_certby.c.orig	2026-01-16 13:50:04.806469000 -0500
++++ ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_ssl_certby.c	2026-01-16 13:50:39.378314000 -0500
+@@ -1560,7 +1560,7 @@
+ 
+     ngx_stream_lua_ctx_t        *ctx;
+     ngx_ssl_conn_t              *ssl_conn;
+-#if defined(nginx_version) && nginx_version >= 1025005
++#if !defined (freenginx) && (defined(nginx_version) && nginx_version >= 1025005)
+     ngx_stream_ssl_srv_conf_t   *sscf;
+ #else
+     ngx_stream_ssl_conf_t       *sscf;
diff --git a/www/freenginx-devel/files/extra-patch-ngx_stream_lua_ssl_client_helloby.c b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_ssl_client_helloby.c
new file mode 100644
index 000000000000..e0d6003a0504
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_ssl_client_helloby.c
@@ -0,0 +1,11 @@
+--- ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_ssl_client_helloby.c.orig	2026-01-16 13:46:31.750245000 -0500
++++ ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_ssl_client_helloby.c	2026-01-16 13:47:46.016380000 -0500
+@@ -218,7 +218,7 @@
+         return -1;
+     }
+ 
+-#if (nginx_version > 1029001)
++#if !(freenginx) && (nginx_version > 1029001)
+ #ifdef SSL_CLIENT_HELLO_SUCCESS
+     /* see commit 0373fe5d98c1515640 for more details */
+     rc = ngx_ssl_client_hello_callback(ssl_conn, al, arg);
diff --git a/www/freenginx-devel/files/extra-patch-ngx_stream_lua_time.c b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_time.c
new file mode 100644
index 000000000000..0f2f6c792e0a
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_stream_lua_time.c
@@ -0,0 +1,24 @@
+--- ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_time.c.orig	2026-01-16 13:37:35.591811000 -0500
++++ ../stream-lua-nginx-module-0.0.17R4/src/ngx_stream_lua_time.c	2026-01-16 13:44:41.641936000 -0500
+@@ -36,7 +36,21 @@
+ double
+ ngx_stream_lua_ffi_req_start_time(ngx_stream_lua_request_t *r)
+ {
++#if defined freenginx
++    ngx_time_t              *tp;
++
++    tp = ngx_timeofday();
++    tp->sec -= (ngx_current_msec - r->session->start_time) / 1000;
++    tp->msec -= (ngx_current_msec - r->session->start_time) % 1000;
++    if (tp->msec > NGX_MAX_INT_T_VALUE) {
++        tp->msec += 1000;
++        tp->sec -= 1;
++    }
++
++    return tp->sec + tp->msec / 1000.0;
++#else
+     return r->session->start_sec + r->session->start_msec / 1000.0;
++#endif
+ }
+ 
+