git: 26cfd6fb4e6f - main - www/nginx-devel: Add NJS_QJS and NJS_XML options
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 17 Sep 2026 16:47:52 UTC
The branch main has been updated by joneum:
URL: https://cgit.FreeBSD.org/ports/commit/?id=26cfd6fb4e6f3b5386028cc1b22fcb2b89be1f22
commit 26cfd6fb4e6f3b5386028cc1b22fcb2b89be1f22
Author: Jochen Neumeister <joneum@FreeBSD.org>
AuthorDate: 2026-09-17 16:47:11 +0000
Commit: Jochen Neumeister <joneum@FreeBSD.org>
CommitDate: 2026-09-17 16:47:43 +0000
www/nginx-devel: Add NJS_QJS and NJS_XML options
The port pulled quickjs, libxml2 and libxslt unconditionally with NJS
and always built the QuickJS engine. Split this into the NJS_QJS and
NJS_XML options, so that www/nginx, www/nginx-devel and www/freenginx
offer the same set.
Sponsored by: Netzkommune GmbH
---
www/nginx-devel/Makefile | 15 ++++++++++-----
www/nginx-devel/Makefile.extmod | 15 +++++++++++----
www/nginx-devel/Makefile.options.desc | 2 ++
3 files changed, 23 insertions(+), 9 deletions(-)
diff --git a/www/nginx-devel/Makefile b/www/nginx-devel/Makefile
index c43863520e42..62f3c6ee5fb2 100644
--- a/www/nginx-devel/Makefile
+++ b/www/nginx-devel/Makefile
@@ -78,7 +78,7 @@ OPTIONS_GROUP_MAILGRP= MAIL MAIL_IMAP MAIL_POP3 MAIL_SMTP MAIL_SSL
OPTIONS_GROUP_STREAMGRP= STREAM STREAM_REALIP STREAM_SSL \
STREAM_SSL_PREREAD
-OPTIONS_DEFINE= DEBUG DEBUGLOG DSO FILE_AIO IPV6 NJS OTEL THREADS WWW
+OPTIONS_DEFINE= DEBUG DEBUGLOG DSO FILE_AIO IPV6 NJS NJS_QJS NJS_XML OTEL THREADS WWW
OPTIONS_DEFAULT?= DSO FILE_AIO HTTP HTTP_ADDITION HTTP_AUTH_REQ HTTP_CACHE \
HTTP_DAV HTTP_FLV HTTP_GUNZIP_FILTER HTTP_GZIP_STATIC HTTP_MP4 \
HTTP_RANDOM_INDEX HTTP_REALIP HTTP_SECURE_LINK HTTP_SLICE HTTP_SSL \
@@ -253,9 +253,14 @@ CONFIGURE_ARGS+= --with-ld-opt="-L ${LOCALBASE}/lib -lpcre"
LIB_DEPENDS+= libpcre.so:devel/pcre
.endif
-.if ${PORT_OPTIONS:MNJS}
+.if ${PORT_OPTIONS:MNJS} && empty(PORT_OPTIONS:MNJS_XML)
+CONFIGURE_ENV+= NJS_LIBXSLT=NO
+NJS_CONFIGURE_ARGS= --no-libxml2
+.endif
+
+.if ${PORT_OPTIONS:MNJS_QJS}
_NJS_QJS_CFLAGS= -I ${LOCALBASE}/include/quickjs
-NJS_CONFIGURE_ARGS= --cc-opt="${CFLAGS} -I${LOCALBASE}/include/quickjs" \
+NJS_CONFIGURE_ARGS+= --cc-opt="${CFLAGS} -I${LOCALBASE}/include/quickjs" \
--ld-opt="-L${LOCALBASE}/lib" \
--with-quickjs
.endif
@@ -267,8 +272,8 @@ pre-everything::
.endif
.if ${PORT_OPTIONS:MNJS}
@${ECHO_MSG} "The built-in njs scripting engine is EOL, deprecated since njs 1.0.0."
- @${ECHO_MSG} "This port builds the recommended QuickJS engine as well; select it"
- @${ECHO_MSG} "in nginx.conf via the js_engine qjs directive."
+ @${ECHO_MSG} "Upstream recommends the QuickJS engine instead: enable the NJS_QJS"
+ @${ECHO_MSG} "option and select it in nginx.conf via the js_engine qjs directive."
.endif
.if ${PORT_OPTIONS:MPASSENGER}
@${ECHO_MSG} "This port install Passenger module only"
diff --git a/www/nginx-devel/Makefile.extmod b/www/nginx-devel/Makefile.extmod
index 158bf4a9f082..5c96c2682f76 100644
--- a/www/nginx-devel/Makefile.extmod
+++ b/www/nginx-devel/Makefile.extmod
@@ -252,11 +252,18 @@ NAXSI_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-naxsi-libinjection__sqli_c \
NJS_BUILD_DEPENDS= nginx-module-njs>=1.0.1:www/nginx-module-njs
WRKSRC_njs= ${WRKDIR}/njs
-NJS_LIB_DEPENDS= libquickjs.so:lang/quickjs \
- libxml2.so:textproc/libxml2 \
- libxslt.so:textproc/libxslt
NJS_VARS= DSO_EXTMODS+=njs NJS_SUBDIR=/nginx
-NJS_IMPLIES= HTTP STREAM
+NJS_IMPLIES= STREAM
+
+NJS_QJS_IMPLIES= NJS
+NJS_QJS_LIB_DEPENDS= libquickjs.so:lang/quickjs
+# njs auto-enables QuickJS whenever it is found at configure time,
+# keep the build deterministic when the option is disabled
+NJS_QJS_CONFIGURE_ENV_OFF= NJS_QUICKJS=NO
+
+NJS_XML_IMPLIES= HTTP NJS
+NJS_XML_LIB_DEPENDS= libxml2.so:textproc/libxml2 \
+ libxslt.so:textproc/libxslt
OTEL_GH_TUPLE= osokin:nginx-otel:3a655df:otel
OTEL_VARS= DSO_EXTMODS+=otel OTEL_SUBDIR=/
diff --git a/www/nginx-devel/Makefile.options.desc b/www/nginx-devel/Makefile.options.desc
index 1c64ea17938e..cb754b4b4629 100644
--- a/www/nginx-devel/Makefile.options.desc
+++ b/www/nginx-devel/Makefile.options.desc
@@ -90,6 +90,8 @@ MODSECURITY3_DESC= 3rd party modsecurity3 module
NATS_DESC= 3rd party nats module
NAXSI_DESC= 3rd party naxsi module
NJS_DESC= Enable javascript (NJS) module
+NJS_QJS_DESC= Enable QuickJS engine in NJS module
+NJS_XML_DESC= Enable XML functionality in NJS module
OTEL_DESC= Enable OpenTELemetry module
PASSENGER_DESC= 3rd party passenger module
POSTGRES_DESC= 3rd party postgres module