Skip to content

Commit

Permalink
www/nginx-devel: third-party modules management
Browse files Browse the repository at this point in the history
Remove third-party clojure module.

Fix build for third-party upload_progress module.	(*)
Obtained from:	https://github.com/masterzen/nginx-upload-progress-module/files/8980323/nginx_1.23.0.patch.txt (*)

Bump PORTREVISION.
  • Loading branch information
osokin committed Jul 11, 2022
1 parent d9c9555 commit fac9f62
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 19 deletions.
7 changes: 1 addition & 6 deletions www/nginx-devel/Makefile
Expand Up @@ -2,7 +2,7 @@

PORTNAME?= nginx
PORTVERSION= 1.23.0
PORTREVISION= 10
PORTREVISION= 11
CATEGORIES= www
MASTER_SITES= https://nginx.org/download/ \
LOCAL/osa
Expand Down Expand Up @@ -245,11 +245,6 @@ IGNORE= required HTTPV3_BORING or HTTPV3_QTLS \
NJS_CONFIGURE_ARGS= --no-pcre2
.endif

.if ${PORT_OPTIONS:MCLOJURE} || \
${PORT_OPTIONS:MHTTP_UPLOAD_PROGRESS}
IGNORE= a patch requires
.endif

pre-everything::
@${ECHO_MSG}
.if ${PORT_OPTIONS:MHTTP_UPSTREAM_FAIR}
Expand Down
14 changes: 4 additions & 10 deletions www/nginx-devel/Makefile.extmod
Expand Up @@ -2,7 +2,7 @@

OPTIONS_GROUP+= THIRDPARTYGRP
# External modules (arrayvar MUST appear after devel_kit for build-dep)
OPTIONS_GROUP_THIRDPARTYGRP= AJP AWS_AUTH BROTLI CACHE_PURGE CLOJURE COOKIE_FLAG CT \
OPTIONS_GROUP_THIRDPARTYGRP= AJP AWS_AUTH BROTLI CACHE_PURGE COOKIE_FLAG CT \
DEVEL_KIT ARRAYVAR DRIZZLE DYNAMIC_HC DYNAMIC_UPSTREAM ECHO ENCRYPTSESSION \
FORMINPUT GRIDFS HEADERS_MORE HTTP_ACCEPT_LANGUAGE HTTP_AUTH_DIGEST \
HTTP_AUTH_KRB5 HTTP_AUTH_LDAP HTTP_AUTH_PAM HTTP_DAV_EXT HTTP_EVAL \
Expand Down Expand Up @@ -32,13 +32,6 @@ BROTLI_VARS= DSO_EXTMODS+=brotli
CACHE_PURGE_GH_TUPLE= torden:ngx_cache_purge:2b977cf:cache_purge
CACHE_PURGE_VARS= DSO_EXTMODS+=cache_purge

CLOJURE_CATEGORIES+= java
CLOJURE_USE= JAVA=yes JAVA_OS=native JAVA_VERSION=1.8 \
JAVA_VENDOR=openjdk JAVA_BUILD=yes JAVA_RUN=yes
CLOJURE_GH_TUPLE= nginx-clojure:nginx-clojure:4b1e964:clojure
CLOJURE_CONFIGURE_ENV= "JNI_INCS=-I${LOCALBASE}/openjdk8/include -I${LOCALBASE}/openjdk8/include/freebsd"
CLOJURE_VARS= DSO_EXTMODS+=clojure CLOJURE_SUBDIR=/src/c

COOKIE_FLAG_GH_TUPLE= AirisX:nginx_cookie_flag_module:c4ff449:cookie_flag
COOKIE_FLAG_VARS= DSO_EXTMODS+=cookie_flag

Expand Down Expand Up @@ -179,8 +172,9 @@ HTTP_TARANTOOL_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_tarantool-config
HTTP_UPLOAD_GH_TUPLE= fdintino:nginx-upload-module:643b4c1:upload
HTTP_UPLOAD_VARS= DSO_EXTMODS+=upload

HTTP_UPLOAD_PROGRESS_GH_TUPLE= masterzen:nginx-upload-progress-module:68b3ab3:uploadprogress
HTTP_UPLOAD_PROGRESS_VARS= DSO_EXTMODS+=uploadprogress
HTTP_UPLOAD_PROGRESS_GH_TUPLE= masterzen:nginx-upload-progress-module:68b3ab3:uploadprogress
HTTP_UPLOAD_PROGRESS_VARS= DSO_EXTMODS+=uploadprogress
HTTP_UPLOAD_PROGRESS_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-ngx_http_uploadprogress_module.c

HTTP_UPSTREAM_CHECK_GH_TUPLE= yaoweibin:nginx_upstream_check_module:9aecf15:upstreamcheck
HTTP_UPSTREAM_CHECK_CONFIGURE_ON= --add-module=${WRKSRC_upstreamcheck}
Expand Down
2 changes: 0 additions & 2 deletions www/nginx-devel/distinfo
Expand Up @@ -19,8 +19,6 @@ SHA256 (google-ngx_brotli-9aec15e_GH0.tar.gz) = 0177b1158ff7092b9996346de28a0b29
SIZE (google-ngx_brotli-9aec15e_GH0.tar.gz) = 16194
SHA256 (torden-ngx_cache_purge-2b977cf_GH0.tar.gz) = 9de7dad5827edf37e803435ee764f6815562053daa0821aedaf539580307ff93
SIZE (torden-ngx_cache_purge-2b977cf_GH0.tar.gz) = 16739
SHA256 (nginx-clojure-nginx-clojure-4b1e964_GH0.tar.gz) = bc41ee5233e5eefba92067499a09ca82a0606036d3b9dd8e550b519674f32761
SIZE (nginx-clojure-nginx-clojure-4b1e964_GH0.tar.gz) = 753436
SHA256 (AirisX-nginx_cookie_flag_module-c4ff449_GH0.tar.gz) = 4b8c1c1e1ed59ed85751f4bd7d68026ad5051103c8b983e05ad17eb0cdab138e
SIZE (AirisX-nginx_cookie_flag_module-c4ff449_GH0.tar.gz) = 4713
SHA256 (grahamedgecombe-nginx-ct-93e9884_GH0.tar.gz) = 72fdd125b9207cdda135f368095f85b943a78a4ff004d1cd217972e12b1571b2
Expand Down
73 changes: 73 additions & 0 deletions www/nginx-devel/files/extra-patch-ngx_http_uploadprogress_module.c
@@ -0,0 +1,73 @@
--- ../nginx-upload-progress-module-68b3ab3/ngx_http_uploadprogress_module.c.orig 2021-12-24 10:53:38.000000000 -0500
+++ ../nginx-upload-progress-module-68b3ab3/ngx_http_uploadprogress_module.c 2022-07-10 22:24:32.435330000 -0400
@@ -559,12 +559,12 @@
ngx_chain_t out;
ngx_int_t rc, found=0, done=0, err_status=0;
off_t rest=0, length=0;
- ngx_uint_t len, i;
+ ngx_uint_t len;
ngx_slab_pool_t *shpool;
ngx_http_uploadprogress_conf_t *upcf;
ngx_http_uploadprogress_ctx_t *ctx;
ngx_http_uploadprogress_node_t *up;
- ngx_table_elt_t *expires, *cc, **ccp;
+ ngx_table_elt_t *expires, *cc;
ngx_http_uploadprogress_state_t state;
ngx_http_uploadprogress_template_t *t;

@@ -637,6 +637,7 @@
}

r->headers_out.expires = expires;
+ expires->next = NULL;

expires->hash = 1;
expires->key.len = sizeof("Expires") - 1;
@@ -646,37 +647,30 @@
len = sizeof("Mon, 28 Sep 1970 06:00:00 GMT");
expires->value.len = len - 1;

- ccp = r->headers_out.cache_control.elts;
- if (ccp == NULL) {
+ cc = r->headers_out.cache_control;

- if (ngx_array_init(&r->headers_out.cache_control, r->pool,
- 1, sizeof(ngx_table_elt_t *))
- != NGX_OK) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
+ if (cc == NULL) {

- ccp = ngx_array_push(&r->headers_out.cache_control);
- if (ccp == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
cc = ngx_list_push(&r->headers_out.headers);
if (cc == NULL) {
+ expires->hash = 0;
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}

+ r->headers_out.cache_control = cc;
+ cc->next = NULL;
+
cc->hash = 1;
cc->key.len = sizeof("Cache-Control") - 1;
cc->key.data = (u_char *) "Cache-Control";

- *ccp = cc;
-
} else {
- for (i = 1; i < r->headers_out.cache_control.nelts; i++) {
- ccp[i]->hash = 0;
+ for (cc = cc->next; cc; cc = cc->next) {
+ cc->hash = 0;
}

- cc = ccp[0];
+ cc = r->headers_out.cache_control;
+ cc->next = NULL;
}

expires->value.data = (u_char *) "Thu, 01 Jan 1970 00:00:01 GMT";
1 change: 0 additions & 1 deletion www/nginx-devel/pkg-plist
Expand Up @@ -14,7 +14,6 @@
%%DSO%%%%BROTLI%%libexec/nginx/ngx_http_brotli_filter_module.so
%%DSO%%%%BROTLI%%libexec/nginx/ngx_http_brotli_static_module.so
%%DSO%%%%CACHE_PURGE%%libexec/nginx/ngx_http_cache_purge_module.so
%%DSO%%%%CLOJURE%%libexec/nginx/ngx_http_clojure_module.so
%%DSO%%%%COOKIE_FLAG%%libexec/nginx/ngx_http_cookie_flag_filter_module.so
%%DSO%%%%CT%%libexec/nginx/ngx_http_ssl_ct_module.so
%%DSO%%%%CT%%libexec/nginx/ngx_ssl_ct_module.so
Expand Down

0 comments on commit fac9f62

Please sign in to comment.