git: 4c9b3e03194c - main - www/freenginx-devel: third-party modules management (+)

From: Sergey A. Osokin <osa_at_FreeBSD.org>
Date: Wed, 08 Jul 2026 14:57:08 UTC
The branch main has been updated by osa:

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

commit 4c9b3e03194ccfa7193be04f7c3df84dcf75bbae
Author:     Sergey A. Osokin <osa@FreeBSD.org>
AuthorDate: 2026-07-08 14:55:18 +0000
Commit:     Sergey A. Osokin <osa@FreeBSD.org>
CommitDate: 2026-07-08 14:55:18 +0000

    www/freenginx-devel: third-party modules management (+)
    
    Fix and enable build for the substitution_filter module.
    
    Bump PORTREIVISON.
    
    Sponsored by:   tipi.work
---
 www/freenginx-devel/Makefile                       |  2 +-
 www/freenginx-devel/Makefile.extmod                |  2 +-
 .../extra-patch-ngx_http_subs_filter_module.c      | 39 ++++++++++++++++++++++
 3 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/www/freenginx-devel/Makefile b/www/freenginx-devel/Makefile
index db2755f9e210..06a5b5670f7d 100644
--- a/www/freenginx-devel/Makefile
+++ b/www/freenginx-devel/Makefile
@@ -1,7 +1,7 @@
 PORTNAME=	freenginx
 PORTVERSION=	${NGINX_VERSION}
 .include "version.mk"
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	www
 MASTER_SITES=	https://freenginx.org/download/ \
 		LOCAL/osa
diff --git a/www/freenginx-devel/Makefile.extmod b/www/freenginx-devel/Makefile.extmod
index 3e501810f98d..9a9265a3fe24 100644
--- a/www/freenginx-devel/Makefile.extmod
+++ b/www/freenginx-devel/Makefile.extmod
@@ -161,7 +161,7 @@ HTTP_SLICE_AHEAD_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-src_http_modules_ngx_htt
 
 HTTP_SUBS_FILTER_GH_TUPLE=	yaoweibin:ngx_http_substitutions_filter_module:e12e965:subs_filter
 HTTP_SUBS_FILTER_VARS=		DSO_EXTMODS+=subs_filter
-HTTP_SUBS_FILTER_IGNORE=	substitutions filter module: patching is required
+HTTP_SUBS_FILTER_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_subs_filter_module.c
 
 HTTP_TARANTOOL_GH_TUPLE=	tarantool:nginx_upstream_module:aeb8696:nginx_tarantool
 HTTP_TARANTOOL_EXTRA_PATCHES=	${PATCHDIR}/extra-patch-ngx_http_tarantool-config
diff --git a/www/freenginx-devel/files/extra-patch-ngx_http_subs_filter_module.c b/www/freenginx-devel/files/extra-patch-ngx_http_subs_filter_module.c
new file mode 100644
index 000000000000..285a53c7a16d
--- /dev/null
+++ b/www/freenginx-devel/files/extra-patch-ngx_http_subs_filter_module.c
@@ -0,0 +1,39 @@
+--- ../ngx_http_substitutions_filter_module-e12e965/ngx_http_subs_filter_module.c.orig	2026-07-08 10:43:06.946336000 -0400
++++ ../ngx_http_substitutions_filter_module-e12e965/ngx_http_subs_filter_module.c	2026-07-08 10:49:15.310554000 -0400
+@@ -1152,7 +1152,7 @@
+         }
+ 
+         /* Dirty hack, if it has captured variables */
+-        if (sc.captures_mask) {
++        if (sc.ncaptures) {
+             pair->has_captured = 1;
+         }
+ 
+@@ -1180,7 +1180,6 @@
+     u_char            errstr[NGX_MAX_CONF_ERRSTR];
+     ngx_int_t         n, options;
+     ngx_str_t         err, *value;
+-    ngx_uint_t        mask;
+ 
+     value = cf->args->elts;
+ 
+@@ -1215,19 +1214,6 @@
+         return NGX_ERROR;
+     }
+ 
+-    n = ngx_http_subs_regex_capture_count(pair->match_regex);
+-
+-    if (pair->has_captured) {
+-        mask = ((1 << (n + 1)) - 1);
+-        if ( mask < sc->captures_mask ) {
+-            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+-                               "You want to capture too many regex substrings, "
+-                               "more than %i in \"%V\"",
+-                               n, &value[2]);
+-
+-            return NGX_ERROR;
+-        }
+-    }
+ #else
+     ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+                        "the using of the regex \"%V\" requires PCRE library",