Subject: bug#76357: closed (Re: [bug#76357] [PATCH] gnu: web: add nginx-headers-more-module)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 20 Feb 2025 10:44:02 +0000

Your bug report

#76357: [PATCH] gnu: web: add nginx-headers-more-module

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
76357: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=76357
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: [bug#76357] [PATCH] gnu: web: add nginx-headers-more-module
From: Ludovic Courtès <[email-masked]>
To: Karl Hallsby <[email-masked]>
Cc: [email-masked]
Date: Thu, 20 Feb 2025 11:43:17 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Karl Hallsby <[email-masked]> skribis:

> From: Raven Hallsby <[email-masked]>
>
> * gnu/packages/web.scm (nginx-headers-more-module): New variable.
>
> Change-Id: I8219fefadd008b884f836f974d0850b352825ee0

Applied with the change below.

Thanks,
Ludo’.

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 7a4daee5c35..240163b034e 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -1035,8 +1035,8 @@ (define-public nginx-headers-more-module
             (delete 'install-man-page)))))
     (home-page "https://github.com/openresty/headers-more-nginx-module")
     (synopsis "Set, add, and clear input and output headers in NGINX http servers")
-    (description "Allows adding, setting, or clearing any output or input header
-specified.
+    (description "This NGINX module allows adding, setting, or clearing any
+output or input header specified.
 
 This is an enhanced version of the standard headers module because it provides
 more utilities like resetting or clearing \"builtin headers\" like @code{Content-Type},

Subject: [PATCH] gnu: web: add nginx-headers-more-module
From: Karl Hallsby <[email-masked]>
To: [email-masked]
Cc: Raven Hallsby <[email-masked]>
Date: Sun, 16 Feb 2025 22:47:45 -0600
List-Id: <debbugs-submit.debbugs.gnu.org>

From: Raven Hallsby <[email-masked]>

* gnu/packages/web.scm (nginx-headers-more-module): New variable.

Change-Id: I8219fefadd008b884f836f974d0850b352825ee0
---
 gnu/packages/web.scm | 62 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 1a70da4a90..fd386ee477 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -68,6 +68,7 @@
 ;;; Copyright © 2024 Tomas Volf <[email-masked]>
 ;;; Copyright © 2024 Zheng Junjie <[email-masked]>
 ;;; Copyright © 2024, 2025 Artyom V. Poptsov <[email-masked]>
+;;; Copyright © 2025 Raven Hallsby <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -986,6 +987,67 @@ (define-public nginx-rtmp-module
 stream.  Remote control of the module is possible over HTTP.")
     (license license:bsd-2)))
 
+(define-public nginx-headers-more-module
+  (package
+    (inherit nginx)
+    (name "nginx-headers-more-module")
+    (version "0.38")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/openresty/headers-more-nginx-module")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1dbgwzkpni616nawjkrq0xid60wdgab3vciy7nr966ac6rjyiliy"))))
+    (build-system gnu-build-system)
+    (inputs
+     `(("nginx-sources" ,(package-source nginx))
+       ,@(package-inputs nginx)))
+    (arguments
+     (substitute-keyword-arguments
+         `(#:make-flags '("modules") ;Only build this module not all of nginx.
+           ,@(package-arguments nginx))
+       ((#:configure-flags flags)
+        #~(cons "--add-dynamic-module=." #$flags))
+       ((#:phases phases)
+        #~(modify-phases #$phases
+            (add-after 'unpack 'unpack-nginx-sources
+              (lambda _
+                (begin
+                  ;; The nginx source code is needed to compile the module.
+                  (format #t "decompressing nginx source code~%")
+                  (invoke "tar" "xvf" #$(this-package-input "nginx-sources")
+                          ;; This package's LICENSE file would be
+                          ;; overwritten with the one from nginx when
+                          ;; unpacking the nginx source, so rename the nginx
+                          ;; one when unpacking.
+                          "--transform=s,/LICENSE$,/LICENSE.nginx,"
+                          "--strip-components=1"))))
+            (replace 'install
+              (lambda _
+                (let ((modules-dir (string-append #$output
+                                                  "/etc/nginx/modules")))
+                  (install-file "objs/ngx_http_headers_more_filter_module.so"
+                                modules-dir))))
+            (delete 'fix-root-dirs)
+            (delete 'install-man-page)))))
+    (home-page "https://github.com/openresty/headers-more-nginx-module")
+    (synopsis "Set, add, and clear input and output headers in NGINX http servers")
+    (description "Allows adding, setting, or clearing any output or input header
+specified.
+
+This is an enhanced version of the standard headers module because it provides
+more utilities like resetting or clearing \"builtin headers\" like @code{Content-Type},
+@code{Content-Length}, and @code{Server}.
+
+It also allows you to specify an optional HTTP status code criteria using the
+@code{-s} option and an optional content type criteria using the @code{-t}
+option while modifying the output headers with the more_set_headers and
+more_clear_headers directives.")
+    (license license:bsd-2)))
+
 (define-public nginx-module-vts
   (package
     (inherit nginx)

base-commit: ad74dedb9f167c088d37a3a30d5d6fe841e9127b
-- 
2.46.0