diff --git a/www-nginx/ngx-brotli/Manifest b/www-nginx/ngx-brotli/Manifest index 9a3492068a390..cff11d9080adb 100644 --- a/www-nginx/ngx-brotli/Manifest +++ b/www-nginx/ngx-brotli/Manifest @@ -1,2 +1 @@ -DIST brotli-ed738e842d2fbdf2d6459e39267a633c4a9b2f5d.tar.gz 512305 BLAKE2B b646e4565386870443d006a97a13b295c2c66de448e501f809700c303bb3daf5e4f84a2dacec16c43a534879243e4cda9292072630f13d5f7ca54f2c4372e560 SHA512 f493e7f15ca2804ae8715e48bdc954680f527533e684ec3762a7d49d05890915194289ed948c8cce95644274e1dcab952dcfbc84c0108aaf79f35f20270ffe6a DIST ngx-brotli-a71f9312c2deb28875acc7bacfdd5695a111aa53.tar.gz 16387 BLAKE2B 2883711581ff5073f8e6451078c046f70323e1c893c3b70f8feb1abfc6ccb420ddb5f5d3b5131eb127538cf9b0cd0d9843d450cacd49b7fc7dfeb0a8c8865de8 SHA512 62a904f1a8e63e169cf09517189d65dd9ee1a6cca2a8461bc4ea29d72f97b940048e34f8dcc4a332785ab603be79f1830e371d920f06bdaa460d7e57915cafdc diff --git a/www-nginx/ngx-brotli/files/ngx-brotli-1.0.0_rc_p20231109-use-system-brotli.patch b/www-nginx/ngx-brotli/files/ngx-brotli-1.0.0_rc_p20231109-use-system-brotli.patch new file mode 100644 index 0000000000000..9451bb1ee8ffb --- /dev/null +++ b/www-nginx/ngx-brotli/files/ngx-brotli-1.0.0_rc_p20231109-use-system-brotli.patch @@ -0,0 +1,103 @@ +From 0b42e57bb6fa4e039585f1ebac8584b8d45b7a2a Mon Sep 17 00:00:00 2001 +From: Mikel Olasagasti Uranga +Date: Wed, 16 Apr 2025 23:50:52 +0200 +Subject: [PATCH] filter/config: restore "system‑first, bundled‑fallback" Brotli detection + +63ca02a made the bundled sub‑module mandatory by hard‑coding +deps/brotli and linking the objects produced in ../out. This broke +distribution builds that are required to link against the shared +libbrotli already shipped by the system. + +This change brings back the original behaviour while integrating +`pkg-config`: + +* Detect a system installation with `pkg-config libbrotlienc`; + if found, use the reported cflags/libs and compile only the NGINX + wrapper source. +* If no suitable system copy exists, fall back to the bundled + git sub‑module exactly as before. +* Abort early with a clear error message when neither flavour is + available, including instructions to initialise the sub‑module. + +No command‑line flags are needed for the common case; packagers simply +omit the sub‑module and let `pkg-config` do the work, while end users +who prefer the bundled copy keep the sub‑module checked out. + +Fixes: 63ca02a (“filter: require bundled Brotli out/ artifacts”) + +Signed-off-by: Mikel Olasagasti Uranga +--- + filter/config | 50 +++++++++++++++++++++++++++++++++++--------------- + 1 file changed, 35 insertions(+), 15 deletions(-) + +diff --git a/filter/config b/filter/config +index 167e1d2..98b2504 100644 +--- a/filter/config ++++ b/filter/config +@@ -42,31 +42,51 @@ fi + ngx_module_type=HTTP_FILTER + ngx_module_name=ngx_http_brotli_filter_module + +-brotli="$ngx_addon_dir/deps/brotli/c" +-if [ ! -f "$brotli/include/brotli/encode.h" ]; then +-cat << END ++use_system_brotli=no ++brotli_prefix="" ++ ++if pkg-config --exists libbrotlienc 2>/dev/null ; then ++ brotli_prefix=$(pkg-config --variable=prefix libbrotlienc) ++ if [ -f "$brotli_prefix/include/brotli/encode.h" ]; then ++ use_system_brotli=yes ++ fi ++fi ++ ++if [ "$use_system_brotli" = no ]; then ++ brotli="$ngx_addon_dir/deps/brotli/c" ++ if [ ! -f "$brotli/include/brotli/encode.h" ]; then ++cat <