Skip to content

Commit

Permalink
nginx: add patch fixing libxslt library detection
Browse files Browse the repository at this point in the history
Nginx hardcode the libxml2 include path to /usr/include/libxml2. This
works in a local build as pretty much everyone have the libxml2 library
installed but doesn't on buildbot container as the library doesn't
exist.

This effectively makes the host library leak intro library detection but
doesn't actually link to it as linking is still done with the correct
library in staging dir.

To fix this add a patch to define custom libxml2 include directory
instead of hardcoding it to host library.

Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
  • Loading branch information
Ansuel committed Nov 3, 2024
1 parent 663ecca commit 95b2da6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
3 changes: 2 additions & 1 deletion net/nginx/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ ifneq ($(CONFIG_PACKAGE_nginx-mod-lua),)
LUAJIT_LIB=$(STAGING_DIR)/usr/lib
endif

CONFIGURE_VARS += CONFIG_BIG_ENDIAN=$(CONFIG_BIG_ENDIAN)
CONFIGURE_VARS += LIBXML2_INC=$(STAGING_DIR)/usr/include/libxml2 \
CONFIG_BIG_ENDIAN=$(CONFIG_BIG_ENDIAN)

CONFIGURE_ARGS += \
--crossbuild=Linux::$(ARCH) \
Expand Down
20 changes: 20 additions & 0 deletions net/nginx/patches/nginx/106-libxslt-fix-detection.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
--- a/auto/lib/libxslt/conf
+++ b/auto/lib/libxslt/conf
@@ -12,7 +12,7 @@
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>"
- ngx_feature_path="/usr/include/libxml2"
+ ngx_feature_path="${LIBXML2_INC:-/usr/include/libxml2}"
ngx_feature_libs="-lxml2 -lxslt"
ngx_feature_test="xmlParserCtxtPtr ctxt = NULL;
xsltStylesheetPtr sheet = NULL;
@@ -100,7 +100,7 @@ fi
ngx_feature_name=NGX_HAVE_EXSLT
ngx_feature_run=no
ngx_feature_incs="#include <libexslt/exslt.h>"
- ngx_feature_path="/usr/include/libxml2"
+ ngx_feature_path="${LIBXML2_INC:-/usr/include/libxml2}"
ngx_feature_libs="-lexslt"
ngx_feature_test="exsltRegisterAll();"
. auto/feature

0 comments on commit 95b2da6

Please sign in to comment.