From 95b2da6540e19d72efbaf18a8711fadf331ab891 Mon Sep 17 00:00:00 2001 From: Christian Marangi Date: Sun, 3 Nov 2024 16:37:34 +0100 Subject: [PATCH] nginx: add patch fixing libxslt library detection 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 --- net/nginx/Makefile | 3 ++- .../nginx/106-libxslt-fix-detection.patch | 20 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 net/nginx/patches/nginx/106-libxslt-fix-detection.patch diff --git a/net/nginx/Makefile b/net/nginx/Makefile index f82bbbf2a6c16..c4a81986b32b1 100644 --- a/net/nginx/Makefile +++ b/net/nginx/Makefile @@ -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) \ diff --git a/net/nginx/patches/nginx/106-libxslt-fix-detection.patch b/net/nginx/patches/nginx/106-libxslt-fix-detection.patch new file mode 100644 index 0000000000000..fba35b977d88d --- /dev/null +++ b/net/nginx/patches/nginx/106-libxslt-fix-detection.patch @@ -0,0 +1,20 @@ +--- a/auto/lib/libxslt/conf ++++ b/auto/lib/libxslt/conf +@@ -12,7 +12,7 @@ + #include + #include + #include " +- 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 " +- ngx_feature_path="/usr/include/libxml2" ++ ngx_feature_path="${LIBXML2_INC:-/usr/include/libxml2}" + ngx_feature_libs="-lexslt" + ngx_feature_test="exsltRegisterAll();" + . auto/feature