diff options
| author | Raven Hallsby <karl@hallsby.com> | 2025-02-16 22:47:45 -0600 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-02-20 12:04:50 +0100 |
| commit | ed2ea6430ecede48f13de7facadfdaaf997ddaee (patch) | |
| tree | 6d801f188be67a081c43a51cb0e38d4bcf872fba | |
| parent | f1967dd68885ea68330b828f59aa95506596b209 (diff) | |
gnu: Add nginx-headers-more-module.
* gnu/packages/web.scm (nginx-headers-more-module): New variable.
Change-Id: I8219fefadd008b884f836f974d0850b352825ee0
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
| -rw-r--r-- | gnu/packages/web.scm | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 7f2c68bf904..240163b034e 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm | |||
| @@ -68,6 +68,7 @@ | |||
| 68 | ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz> | 68 | ;;; Copyright © 2024 Tomas Volf <~@wolfsden.cz> |
| 69 | ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> | 69 | ;;; Copyright © 2024 Zheng Junjie <873216071@qq.com> |
| 70 | ;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com> | 70 | ;;; Copyright © 2024, 2025 Artyom V. Poptsov <poptsov.artyom@gmail.com> |
| 71 | ;;; Copyright © 2025 Raven Hallsby <karl@hallsby.com> | ||
| 71 | ;;; | 72 | ;;; |
| 72 | ;;; This file is part of GNU Guix. | 73 | ;;; This file is part of GNU Guix. |
| 73 | ;;; | 74 | ;;; |
| @@ -986,6 +987,67 @@ on-demand streaming from a file on disk and pulling from an upstream RTMP | |||
| 986 | stream. Remote control of the module is possible over HTTP.") | 987 | stream. Remote control of the module is possible over HTTP.") |
| 987 | (license license:bsd-2))) | 988 | (license license:bsd-2))) |
| 988 | 989 | ||
| 990 | (define-public nginx-headers-more-module | ||
| 991 | (package | ||
| 992 | (inherit nginx) | ||
| 993 | (name "nginx-headers-more-module") | ||
| 994 | (version "0.38") | ||
| 995 | (source | ||
| 996 | (origin | ||
| 997 | (method git-fetch) | ||
| 998 | (uri (git-reference | ||
| 999 | (url "https://github.com/openresty/headers-more-nginx-module") | ||
| 1000 | (commit (string-append "v" version)))) | ||
| 1001 | (file-name (git-file-name name version)) | ||
| 1002 | (sha256 | ||
| 1003 | (base32 "1dbgwzkpni616nawjkrq0xid60wdgab3vciy7nr966ac6rjyiliy")))) | ||
| 1004 | (build-system gnu-build-system) | ||
| 1005 | (inputs | ||
| 1006 | `(("nginx-sources" ,(package-source nginx)) | ||
| 1007 | ,@(package-inputs nginx))) | ||
| 1008 | (arguments | ||
| 1009 | (substitute-keyword-arguments | ||
| 1010 | `(#:make-flags '("modules") ;Only build this module not all of nginx. | ||
| 1011 | ,@(package-arguments nginx)) | ||
| 1012 | ((#:configure-flags flags) | ||
| 1013 | #~(cons "--add-dynamic-module=." #$flags)) | ||
| 1014 | ((#:phases phases) | ||
| 1015 | #~(modify-phases #$phases | ||
| 1016 | (add-after 'unpack 'unpack-nginx-sources | ||
| 1017 | (lambda _ | ||
| 1018 | (begin | ||
| 1019 | ;; The nginx source code is needed to compile the module. | ||
| 1020 | (format #t "decompressing nginx source code~%") | ||
| 1021 | (invoke "tar" "xvf" #$(this-package-input "nginx-sources") | ||
| 1022 | ;; This package's LICENSE file would be | ||
| 1023 | ;; overwritten with the one from nginx when | ||
| 1024 | ;; unpacking the nginx source, so rename the nginx | ||
| 1025 | ;; one when unpacking. | ||
| 1026 | "--transform=s,/LICENSE$,/LICENSE.nginx," | ||
| 1027 | "--strip-components=1")))) | ||
| 1028 | (replace 'install | ||
| 1029 | (lambda _ | ||
| 1030 | (let ((modules-dir (string-append #$output | ||
| 1031 | "/etc/nginx/modules"))) | ||
| 1032 | (install-file "objs/ngx_http_headers_more_filter_module.so" | ||
| 1033 | modules-dir)))) | ||
| 1034 | (delete 'fix-root-dirs) | ||
| 1035 | (delete 'install-man-page))))) | ||
| 1036 | (home-page "https://github.com/openresty/headers-more-nginx-module") | ||
| 1037 | (synopsis "Set, add, and clear input and output headers in NGINX http servers") | ||
| 1038 | (description "This NGINX module allows adding, setting, or clearing any | ||
| 1039 | output or input header specified. | ||
| 1040 | |||
| 1041 | This is an enhanced version of the standard headers module because it provides | ||
| 1042 | more utilities like resetting or clearing \"builtin headers\" like @code{Content-Type}, | ||
| 1043 | @code{Content-Length}, and @code{Server}. | ||
| 1044 | |||
| 1045 | It also allows you to specify an optional HTTP status code criteria using the | ||
| 1046 | @code{-s} option and an optional content type criteria using the @code{-t} | ||
| 1047 | option while modifying the output headers with the more_set_headers and | ||
| 1048 | more_clear_headers directives.") | ||
| 1049 | (license license:bsd-2))) | ||
| 1050 | |||
| 989 | (define-public nginx-module-vts | 1051 | (define-public nginx-module-vts |
| 990 | (package | 1052 | (package |
| 991 | (inherit nginx) | 1053 | (inherit nginx) |
