While preparing for upgrading some systems to 7.4 today, I found that the
nginx-lua module currently doesn't load.  It uses libpcre but doesn't link
against it, and this used to work when nginx itself used libpcre, but now
it's using libpcre2.  I figure the simplest thing to do is to just link
the module against libpcre, which the diff below seems to manage.

lua-nginx-module upstream added pcre2 support recently, so it may be possible
to backport that to the version we're stuck at, but that seems like a
post-release type of solution.


Index: Makefile
===================================================================
RCS file: /cvs/ports/www/nginx/Makefile,v
retrieving revision 1.173
diff -u -p -u -p -r1.173 Makefile
--- Makefile    26 Sep 2023 17:58:09 -0000      1.173
+++ Makefile    3 Oct 2023 12:45:56 -0000
@@ -97,7 +97,7 @@ WANTLIB-njs=          exslt m xml2 xslt
 WANTLIB-xslt=          exslt xml2 xslt
 WANTLIB-naxsi=
 WANTLIB-ldap_auth=     ldap
-WANTLIB-lua=           ${MODLUA_WANTLIB} m
+WANTLIB-lua=           ${MODLUA_WANTLIB} m pcre
 WANTLIB-headers_more=
 WANTLIB-perl=          c m perl
 WANTLIB-passenger=     m pthread ${COMPILER_LIBCXX}
@@ -109,7 +109,8 @@ LIB_DEPENDS-xslt=   textproc/libxml \
 LIB_DEPENDS-image_filter=graphics/gd
 LIB_DEPENDS-geoip2=    net/libmaxminddb
 LIB_DEPENDS-ldap_auth= databases/openldap
-LIB_DEPENDS-lua=       ${MODLUA_LIB_DEPENDS}
+LIB_DEPENDS-lua=       ${MODLUA_LIB_DEPENDS} \
+                       devel/pcre
 LIB_DEPENDS-rtmp=
 LIB_DEPENDS-securelink=
 LIB_DEPENDS-njs=       devel/pcre2 \
@@ -120,7 +121,8 @@ MODLUA_RUNDEP=              No
 RUN_DEPENDS=           www/nginx,-main=${VERSION}
 RUN_DEPENDS-main=      # blank (override default)
 RUN_DEPENDS-lua=       ${RUN_DEPENDS} \
-                       ${_MODLUA_RUN_DEPENDS}
+                       ${_MODLUA_RUN_DEPENDS} \
+                       devel/pcre
 RUN_DEPENDS-passenger= ${RUN_DEPENDS} \
                        ruby*-passenger-*:www/ruby-passenger
 
Index: patches/patch-lua-nginx-module_config
===================================================================
RCS file: patches/patch-lua-nginx-module_config
diff -N patches/patch-lua-nginx-module_config
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-lua-nginx-module_config       3 Oct 2023 12:45:56 -0000
@@ -0,0 +1,11 @@
+--- lua-nginx-module/config.orig       Tue Oct  3 22:18:35 2023
++++ lua-nginx-module/config    Tue Oct  3 22:21:42 2023
+@@ -181,7 +181,7 @@
+             if [ $NGX_RPATH = YES ]; then
+                 ngx_feature_libs="-R/usr/local/lib -L/usr/local/lib -llua -lm"
+             else
+-                ngx_feature_libs="-L/usr/local/lib -llua5.1 -lm"
++                ngx_feature_libs="-L/usr/local/lib -llua5.1 -lpcre -lm"
+             fi
+             . auto/feature
+         fi

Reply via email to