aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJochen Neumeister <joneum@FreeBSD.org>2026-08-05 07:54:11 +0000
committerJochen Neumeister <joneum@FreeBSD.org>2026-08-05 07:54:11 +0000
commit8c2ac84b701610ea2c269aeb8f06ead8eae48cb2 (patch)
tree5366f1ed679954b57465dbbb3628431d143cfafb
parent4e5730e9566af9b3b0a4f2eaa372c5aa61a36541 (diff)
www/{nginx,nginx-devel,freenginx}: 3rd-pary modules managemeht
Fix build and loading of the 3rd party gridfs module after the devel/mongo-c-driver 2.x update. The module config now obtains include and linker flags from pkg-config instead of deriving them from the ports tree's DISTVERSION. The previous approach ran a recursive make into devel/mongo-c-driver on every make invocation, even with GRIDFS unset, and derived the libbson include path from the mongo-c-driver version although devel/libbson is a separate port with its own DISTVERSION. Both directories happen to carry the same version today, so the mismatch was not visible yet. While here, add the missing assert.h include. The module calls assert() without declaring it, which left an unresolvable symbol "assert" in the shared object -- libc only exports __assert. Since nginx dlopen()s modules with RTLD_NOW, load_module refused to load the module at runtime. Also correct a typo in one of the patch file names. PR: 296604, 296605, 296606 Sponsored by: Netzkommune GmbH
-rw-r--r--www/freenginx/Makefile7
-rw-r--r--www/freenginx/Makefile.extmod4
-rw-r--r--www/freenginx/files/extra-patch-nginx-gridfs_config4
-rw-r--r--www/freenginx/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c (renamed from www/freenginx/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c)3
-rw-r--r--www/nginx-devel/Makefile7
-rw-r--r--www/nginx-devel/Makefile.extmod4
-rw-r--r--www/nginx-devel/files/extra-patch-nginx-gridfs_config4
-rw-r--r--www/nginx-devel/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c (renamed from www/nginx-devel/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c)3
-rw-r--r--www/nginx/Makefile7
-rw-r--r--www/nginx/Makefile.extmod4
-rw-r--r--www/nginx/files/extra-patch-nginx-gridfs_config4
-rw-r--r--www/nginx/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c (renamed from www/nginx/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c)3
12 files changed, 21 insertions, 33 deletions
diff --git a/www/freenginx/Makefile b/www/freenginx/Makefile
index 32418c79591c..81816580ab3d 100644
--- a/www/freenginx/Makefile
+++ b/www/freenginx/Makefile
@@ -1,6 +1,6 @@
PORTNAME= freenginx
PORTVERSION= 1.30.1
-PORTREVISION?= 4
+PORTREVISION?= 5
CATEGORIES= www
MASTER_SITES= https://freenginx.org/download/ \
LOCAL/joneum
@@ -286,11 +286,6 @@ post-patch-FASTDFS-on:
's!%%PREFIX%%!${PREFIX}!g;s!%%LOCALBASE%%!${LOCALBASE}!g' \
${WRKSRC_fastdfs}/src/config
-post-patch-GRIDFS-on:
- @${REINPLACE_CMD} -e 's!%%LOCALBASE%%!${LOCALBASE}!g' \
- -e 's!%%MONGOC_VERSION%%!${MONGOC_VERSION}!g' \
- ${WRKSRC_gridfs}/nginx-gridfs/config
-
post-patch-HTTP_AUTH_KRB5-on:
@${REINPLACE_CMD} 's!%%GSSAPILIBS%%!${GSSAPILIBS}!g; \
s!%%GSSAPIINCDIR%%!${GSSAPIINCDIR}!g; \
diff --git a/www/freenginx/Makefile.extmod b/www/freenginx/Makefile.extmod
index 896d941a38a6..40180b13b9af 100644
--- a/www/freenginx/Makefile.extmod
+++ b/www/freenginx/Makefile.extmod
@@ -70,9 +70,9 @@ FORMINPUT_VARS= DSO_EXTMODS+=forminput
GRIDFS_GH_TUPLE= nieoding:nginx-gridfs:059bdc3:gridfs
GRIDFS_LIB_DEPENDS= libbson2.so:devel/libbson \
libmongoc2.so:devel/mongo-c-driver
+GRIDFS_USES= pkgconfig
GRIDFS_VARS= DSO_EXTMODS+=gridfs GRIDFS_SUBDIR=/nginx-gridfs
-MONGOC_VERSION!= cd ${.CURDIR}/../../devel/mongo-c-driver; make -V DISTVERSION
-GRIDFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c \
+GRIDFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c \
${PATCHDIR}/extra-patch-nginx-gridfs_config
HEADERS_MORE_GH_TUPLE= openresty:headers-more-nginx-module:06dc0be:headers_more
diff --git a/www/freenginx/files/extra-patch-nginx-gridfs_config b/www/freenginx/files/extra-patch-nginx-gridfs_config
index 01c37fda60b1..730af5a858f9 100644
--- a/www/freenginx/files/extra-patch-nginx-gridfs_config
+++ b/www/freenginx/files/extra-patch-nginx-gridfs_config
@@ -5,8 +5,8 @@
ngx_module_name=ngx_http_gridfs_module
-ngx_module_incs="/usr/include/libmongoc-1.0 /usr/include/libbson-1.0"
-ngx_module_libs="-lmongoc-1.0 -lbson-1.0"
-+ngx_module_incs="%%LOCALBASE%%/include/mongoc-%%MONGOC_VERSION%% %%LOCALBASE%%/include/bson-%%MONGOC_VERSION%%"
-+ngx_module_libs="-lmongoc2 -lbson2"
++ngx_module_incs=`pkg-config --cflags-only-I mongoc2 bson2 | sed -e 's/-I//g'`
++ngx_module_libs=`pkg-config --libs mongoc2 bson2`
ngx_module_srcs="$ngx_addon_dir/ngx_http_gridfs_module.c"
. auto/module
-ngx_addon_name=$ngx_module_name
diff --git a/www/freenginx/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c b/www/freenginx/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c
index 765dd2b067ff..2471ad2c99e6 100644
--- a/www/freenginx/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c
+++ b/www/freenginx/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c
@@ -1,11 +1,12 @@
--- ../nginx-gridfs-059bdc3/nginx-gridfs/ngx_http_gridfs_module.c.orig 2018-01-20 07:53:32.000000000 +0000
+++ ../nginx-gridfs-059bdc3/nginx-gridfs/ngx_http_gridfs_module.c 2026-07-07 14:27:08.501699000 +0000
-@@ -1,7 +1,7 @@
+@@ -1,7 +1,8 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
-#include <mongoc.h>
+#include <mongoc/mongoc.h>
++#include <assert.h>
#include <signal.h>
#include <stdio.h>
diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile
index 1100f6e66804..2876b5667b1c 100644
--- a/www/nginx-devel/Makefile
+++ b/www/nginx-devel/Makefile
@@ -1,7 +1,7 @@
PORTNAME?= nginx
PORTVERSION= ${NGINX_VERSION}
.include "version.mk"
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= www
MASTER_SITES= https://nginx.org/download/ \
LOCAL/osa
@@ -292,11 +292,6 @@ post-patch-FASTDFS-on:
's!%%PREFIX%%!${PREFIX}!g;s!%%LOCALBASE%%!${LOCALBASE}!g' \
${WRKSRC_fastdfs}/src/config
-post-patch-GRIDFS-on:
- @${REINPLACE_CMD} -e 's!%%LOCALBASE%%!${LOCALBASE}!g' \
- -e 's!%%MONGOC_VERSION%%!${MONGOC_VERSION}!g' \
- ${WRKSRC_gridfs}/nginx-gridfs/config
-
post-patch-HTTP_AUTH_KRB5-on:
@${REINPLACE_CMD} 's!%%GSSAPILIBS%%!${GSSAPILIBS}!g; \
s!%%GSSAPIINCDIR%%!${GSSAPIINCDIR}!g; \
diff --git a/www/nginx-devel/Makefile.extmod b/www/nginx-devel/Makefile.extmod
index 1174bea762ad..68ffb0043707 100644
--- a/www/nginx-devel/Makefile.extmod
+++ b/www/nginx-devel/Makefile.extmod
@@ -64,9 +64,9 @@ FORMINPUT_VARS= DSO_EXTMODS+=forminput
GRIDFS_GH_TUPLE= nieoding:nginx-gridfs:059bdc3:gridfs
GRIDFS_LIB_DEPENDS= libbson2.so:devel/libbson \
libmongoc2.so:devel/mongo-c-driver
+GRIDFS_USES= pkgconfig
GRIDFS_VARS= DSO_EXTMODS+=gridfs GRIDFS_SUBDIR=/nginx-gridfs
-MONGOC_VERSION!= cd ${.CURDIR}/../../devel/mongo-c-driver; make -V DISTVERSION
-GRIDFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c \
+GRIDFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c \
${PATCHDIR}/extra-patch-nginx-gridfs_config
HEADERS_MORE_GH_TUPLE= openresty:headers-more-nginx-module:v0.39:headers_more
diff --git a/www/nginx-devel/files/extra-patch-nginx-gridfs_config b/www/nginx-devel/files/extra-patch-nginx-gridfs_config
index 01c37fda60b1..730af5a858f9 100644
--- a/www/nginx-devel/files/extra-patch-nginx-gridfs_config
+++ b/www/nginx-devel/files/extra-patch-nginx-gridfs_config
@@ -5,8 +5,8 @@
ngx_module_name=ngx_http_gridfs_module
-ngx_module_incs="/usr/include/libmongoc-1.0 /usr/include/libbson-1.0"
-ngx_module_libs="-lmongoc-1.0 -lbson-1.0"
-+ngx_module_incs="%%LOCALBASE%%/include/mongoc-%%MONGOC_VERSION%% %%LOCALBASE%%/include/bson-%%MONGOC_VERSION%%"
-+ngx_module_libs="-lmongoc2 -lbson2"
++ngx_module_incs=`pkg-config --cflags-only-I mongoc2 bson2 | sed -e 's/-I//g'`
++ngx_module_libs=`pkg-config --libs mongoc2 bson2`
ngx_module_srcs="$ngx_addon_dir/ngx_http_gridfs_module.c"
. auto/module
-ngx_addon_name=$ngx_module_name
diff --git a/www/nginx-devel/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c b/www/nginx-devel/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c
index 765dd2b067ff..2471ad2c99e6 100644
--- a/www/nginx-devel/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c
+++ b/www/nginx-devel/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c
@@ -1,11 +1,12 @@
--- ../nginx-gridfs-059bdc3/nginx-gridfs/ngx_http_gridfs_module.c.orig 2018-01-20 07:53:32.000000000 +0000
+++ ../nginx-gridfs-059bdc3/nginx-gridfs/ngx_http_gridfs_module.c 2026-07-07 14:27:08.501699000 +0000
-@@ -1,7 +1,7 @@
+@@ -1,7 +1,8 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
-#include <mongoc.h>
+#include <mongoc/mongoc.h>
++#include <assert.h>
#include <signal.h>
#include <stdio.h>
diff --git a/www/nginx/Makefile b/www/nginx/Makefile
index 23911b310554..aabd6f0726b1 100644
--- a/www/nginx/Makefile
+++ b/www/nginx/Makefile
@@ -1,7 +1,7 @@
PORTNAME= nginx
PORTVERSION= ${NGINX_VERSION}
.include "version.mk"
-PORTREVISION= 1
+PORTREVISION= 2
PORTEPOCH= 3
CATEGORIES= www
MASTER_SITES= https://nginx.org/download/ \
@@ -283,11 +283,6 @@ post-patch-FASTDFS-on:
's!%%PREFIX%%!${PREFIX}!g;s!%%LOCALBASE%%!${LOCALBASE}!g' \
${WRKSRC_fastdfs}/src/config
-post-patch-GRIDFS-on:
- @${REINPLACE_CMD} -e 's!%%LOCALBASE%%!${LOCALBASE}!g' \
- -e 's!%%MONGOC_VERSION%%!${MONGOC_VERSION}!g' \
- ${WRKSRC_gridfs}/nginx-gridfs/config
-
post-patch-HTTP_AUTH_KRB5-on:
@${REINPLACE_CMD} 's!%%GSSAPILIBS%%!${GSSAPILIBS}!g; \
s!%%GSSAPIINCDIR%%!${GSSAPIINCDIR}!g; \
diff --git a/www/nginx/Makefile.extmod b/www/nginx/Makefile.extmod
index 0863dbbf6a9d..e7fc726914bf 100644
--- a/www/nginx/Makefile.extmod
+++ b/www/nginx/Makefile.extmod
@@ -64,9 +64,9 @@ FORMINPUT_VARS= DSO_EXTMODS+=forminput
GRIDFS_GH_TUPLE= nieoding:nginx-gridfs:059bdc3:gridfs
GRIDFS_LIB_DEPENDS= libbson2.so:devel/libbson \
libmongoc2.so:devel/mongo-c-driver
+GRIDFS_USES= pkgconfig
GRIDFS_VARS= DSO_EXTMODS+=gridfs GRIDFS_SUBDIR=/nginx-gridfs
-MONGOC_VERSION!= cd ${.CURDIR}/../../devel/mongo-c-driver; make -V DISTVERSION
-GRIDFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c \
+GRIDFS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c \
${PATCHDIR}/extra-patch-nginx-gridfs_config
HEADERS_MORE_GH_TUPLE= openresty:headers-more-nginx-module:06dc0be:headers_more
diff --git a/www/nginx/files/extra-patch-nginx-gridfs_config b/www/nginx/files/extra-patch-nginx-gridfs_config
index 01c37fda60b1..730af5a858f9 100644
--- a/www/nginx/files/extra-patch-nginx-gridfs_config
+++ b/www/nginx/files/extra-patch-nginx-gridfs_config
@@ -5,8 +5,8 @@
ngx_module_name=ngx_http_gridfs_module
-ngx_module_incs="/usr/include/libmongoc-1.0 /usr/include/libbson-1.0"
-ngx_module_libs="-lmongoc-1.0 -lbson-1.0"
-+ngx_module_incs="%%LOCALBASE%%/include/mongoc-%%MONGOC_VERSION%% %%LOCALBASE%%/include/bson-%%MONGOC_VERSION%%"
-+ngx_module_libs="-lmongoc2 -lbson2"
++ngx_module_incs=`pkg-config --cflags-only-I mongoc2 bson2 | sed -e 's/-I//g'`
++ngx_module_libs=`pkg-config --libs mongoc2 bson2`
ngx_module_srcs="$ngx_addon_dir/ngx_http_gridfs_module.c"
. auto/module
-ngx_addon_name=$ngx_module_name
diff --git a/www/nginx/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c b/www/nginx/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c
index 765dd2b067ff..2471ad2c99e6 100644
--- a/www/nginx/files/extra-patch-ngnx-gridfs_ngx_http_gridfs_module.c
+++ b/www/nginx/files/extra-patch-nginx-gridfs_ngx_http_gridfs_module.c
@@ -1,11 +1,12 @@
--- ../nginx-gridfs-059bdc3/nginx-gridfs/ngx_http_gridfs_module.c.orig 2018-01-20 07:53:32.000000000 +0000
+++ ../nginx-gridfs-059bdc3/nginx-gridfs/ngx_http_gridfs_module.c 2026-07-07 14:27:08.501699000 +0000
-@@ -1,7 +1,7 @@
+@@ -1,7 +1,8 @@
#include <ngx_config.h>
#include <ngx_core.h>
#include <ngx_http.h>
-#include <mongoc.h>
+#include <mongoc/mongoc.h>
++#include <assert.h>
#include <signal.h>
#include <stdio.h>