Index: head/www/nginx/Makefile =================================================================== --- head/www/nginx/Makefile +++ head/www/nginx/Makefile @@ -3,7 +3,7 @@ PORTNAME= nginx PORTVERSION= 1.12.2 -PORTREVISION?= 1 +PORTREVISION?= 2 PORTEPOCH= 2 CATEGORIES= www MASTER_SITES= http://nginx.org/download/ @@ -1141,11 +1141,12 @@ .endif .if ${PORT_OPTIONS:MBROTLI} -NGINX_BROTLI_VERSION= 12529813 +NGINX_BROTLI_VERSION= 990d925 LIB_DEPENDS+= libbrotlicommon.so:archivers/brotli -GH_ACCOUNT+= google:brotli +GH_ACCOUNT+= eustas:brotli GH_PROJECT+= ngx_brotli:brotli GH_TAGNAME+= ${NGINX_BROTLI_VERSION}:brotli +EXTRA_PATCHES+= ${PATCHDIR}/extra-patch-brotli_config .if ${PORT_OPTIONS:MDSO} CONFIGURE_ARGS+=--add-dynamic-module=${WRKSRC_brotli} .else @@ -1268,6 +1269,11 @@ @${REINPLACE_CMD} \ 's!%%PREFIX%%!${LOCALBASE}!g' \ ${WRKSRC_nginx_tarantool}/config +.endif +.if ${PORT_OPTIONS:MBROTLI} + @${REINPLACE_CMD} -E \ + 's!^brotli=.*!brotli="${LOCALBASE}"!' \ + ${WRKSRC_brotli}/config .endif pre-configure: Index: head/www/nginx/distinfo =================================================================== --- head/www/nginx/distinfo +++ head/www/nginx/distinfo @@ -1,4 +1,4 @@ -TIMESTAMP = 1511734956 +TIMESTAMP = 1512144757 SHA256 (nginx-1.12.2.tar.gz) = 305f379da1d5fb5aefa79e45c829852ca6983c7cd2a79328f8e084a324cf0416 SIZE (nginx-1.12.2.tar.gz) = 981687 SHA256 (ngx_cache_purge-2.3.tar.gz) = 279e0d8a46d3b1521fd43b3f78bc1c08b263899142a7cc5058c1c0361a92c89c @@ -123,8 +123,8 @@ SIZE (nginx-njs-753ebe6_GH0.tar.gz) = 191124 SHA256 (openresty-array-var-nginx-module-v0.05_GH0.tar.gz) = c949d4be6f3442c8e2937046448dc8d8def25c0e0fa6f4e805144cea45eabe80 SIZE (openresty-array-var-nginx-module-v0.05_GH0.tar.gz) = 11280 -SHA256 (google-ngx_brotli-12529813_GH0.tar.gz) = 788b25c4a3285b34d06e48a469fd0d0cb52d43b43edccd2935e22802dcfd2d69 -SIZE (google-ngx_brotli-12529813_GH0.tar.gz) = 10448 +SHA256 (eustas-ngx_brotli-990d925_GH0.tar.gz) = 16f1e1f01e689f82529e6effec3436e42878f390cfe735bd364b1e16eef669ef +SIZE (eustas-ngx_brotli-990d925_GH0.tar.gz) = 10558 SHA256 (calio-form-input-nginx-module-v0.12_GH0.tar.gz) = 5c1869d55897075adb3fdf840b21060dc54669a1f840a36d1539acc7e59dd106 SIZE (calio-form-input-nginx-module-v0.12_GH0.tar.gz) = 11090 SHA256 (calio-iconv-nginx-module-v0.14_GH0.tar.gz) = b8b9f355c05c0790226512f6732348a2404d48531688a1fc04ce6768163bf462 Index: head/www/nginx/files/extra-patch-brotli_config =================================================================== --- head/www/nginx/files/extra-patch-brotli_config +++ head/www/nginx/files/extra-patch-brotli_config @@ -0,0 +1,120 @@ +From ad89164d7405b39fd947c998c80fc64fc866a440 Mon Sep 17 00:00:00 2001 +From: Bernard Spil +Date: Thu, 30 Nov 2017 21:39:32 +0100 +Subject: [PATCH] Allow building with an already installed libbrotli + +Currently the module requires a bundled brotli source. This patch allows building with an external libbrotli (if detected) + +See also the [this bug report in FreeBSD](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224000) +--- + config | 22 ++++++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +diff --git a/config b/config +index 9d069f8..5e712d2 100644 +--- ../ngx_brotli-9891a98/config.orig 2017-11-28 11:00:45.000000000 +0100 ++++ ../ngx_brotli-9891a98/config 2017-11-30 21:05:56.300023000 +0100 +@@ -55,6 +55,14 @@ have=NGX_HTTP_BROTLI_STATIC_MODULE . auto/have # deprecated + # HTTP filter module with Brotli library + # + ++ ++ngx_module_type=HTTP_FILTER ++ngx_module_name=ngx_http_brotli_filter_module ++ ++brotli="/usr/local" ++ ++if [ ! -f "$brotli/include/brotli/encode.h" ]; then ++ + brotli="$ngx_addon_dir/deps/brotli" + + if [ ! -f "$brotli/include/brotli/encode.h" ]; then +@@ -71,8 +79,6 @@ END + exit 1 + fi + +-ngx_module_type=HTTP_FILTER +-ngx_module_name=ngx_http_brotli_filter_module + ngx_module_incs="$brotli/include" + ngx_module_deps="$brotli/common/constants.h \ + $brotli/common/dictionary.h \ +@@ -132,6 +138,18 @@ ngx_module_srcs="$brotli/common/dictionary.c \ + $brotli/enc/utf8_util.c \ + $ngx_addon_dir/src/ngx_http_brotli_filter_module.c" + ngx_module_libs="-lm" ++ ++else # encode.h in /usr/local ++ ++ngx_module_incs="$brotli/include" ++ngx_module_deps="$brotli/include/brotli/encode.h \ ++ $brotli/include/brotli/port.h \ ++ $brotli/include/brotli/types.h" ++ngx_module_srcs="$ngx_addon_dir/src/ngx_http_brotli_filter_module.c" ++ngx_module_libs="-lbrotlienc -lm" ++ ++fi # encode.h in /usr/local ++ + ngx_module_order="$ngx_module_name \ + ngx_pagespeed \ + ngx_http_postpone_filter_module \ + +From ad89164d7405b39fd947c998c80fc64fc866a440 Mon Sep 17 00:00:00 2001 +From: Bernard Spil +Date: Thu, 30 Nov 2017 21:39:32 +0100 +Subject: [PATCH] Allow building with an already installed libbrotli + +Currently the module requires a bundled brotli source. This patch allows building with an external libbrotli (if detected) + +See also the [this bug report in FreeBSD](https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=224000) +--- + config | 22 ++++++++++++++++++++-- + 1 file changed, 20 insertions(+), 2 deletions(-) + +diff --git a/config b/config +index 9d069f8..5e712d2 100644 +--- ../ngx_brotli-9891a98/config.orig 2017-11-28 11:00:45.000000000 +0100 ++++ ../ngx_brotli-9891a98/config 2017-11-30 21:05:56.300023000 +0100 +@@ -55,6 +55,14 @@ have=NGX_HTTP_BROTLI_STATIC_MODULE . auto/have # deprecated + # HTTP filter module with Brotli library + # + ++ ++ngx_module_type=HTTP_FILTER ++ngx_module_name=ngx_http_brotli_filter_module ++ ++brotli="/usr/local" ++ ++if [ ! -f "$brotli/include/brotli/encode.h" ]; then ++ + brotli="$ngx_addon_dir/deps/brotli" + + if [ ! -f "$brotli/include/brotli/encode.h" ]; then +@@ -71,8 +79,6 @@ END + exit 1 + fi + +-ngx_module_type=HTTP_FILTER +-ngx_module_name=ngx_http_brotli_filter_module + ngx_module_incs="$brotli/include" + ngx_module_deps="$brotli/common/constants.h \ + $brotli/common/dictionary.h \ +@@ -132,6 +138,18 @@ ngx_module_srcs="$brotli/common/dictionary.c \ + $brotli/enc/utf8_util.c \ + $ngx_addon_dir/src/ngx_http_brotli_filter_module.c" + ngx_module_libs="-lm" ++ ++else # encode.h in /usr/local ++ ++ngx_module_incs="$brotli/include" ++ngx_module_deps="$brotli/include/brotli/encode.h \ ++ $brotli/include/brotli/port.h \ ++ $brotli/include/brotli/types.h" ++ngx_module_srcs="$ngx_addon_dir/src/ngx_http_brotli_filter_module.c" ++ngx_module_libs="-lbrotlienc -lm" ++ ++fi # encode.h in /usr/local ++ + ngx_module_order="$ngx_module_name \ + ngx_pagespeed \ + ngx_http_postpone_filter_module \ +