[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/08: gnu: Add nginx-lua-module.
From: |
guix-commits |
Subject: |
07/08: gnu: Add nginx-lua-module. |
Date: |
Wed, 14 Oct 2020 16:41:46 -0400 (EDT) |
wigust pushed a commit to branch master
in repository guix.
commit e835c03e4462dd7f675cbc101fbda5b076cbdd86
Author: Oleg Pykhalov <go.wigust@gmail.com>
AuthorDate: Sun Oct 11 20:41:58 2020 +0300
gnu: Add nginx-lua-module.
* gnu/packages/web.scm (nginx-lua-module): New variable.
---
gnu/packages/web.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)
diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index 0c0e159..97bd8c4 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -561,6 +561,69 @@ documentation.")
(patches (append (search-patches "nginx-socket-cloexec.patch")
(origin-patches (package-source nginx))))))))
+(define-public nginx-lua-module
+ (package
+ (inherit nginx)
+ (name "nginx-lua-module")
+ (version "0.10.15")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/openresty/lua-nginx-module")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name "lua-nginx-module" version))
+ (sha256
+ (base32
+ "1j216isp0546hycklbr5wi8mlga5hq170hk7f2sm16sfavlkh5gz"))))
+ (build-system gnu-build-system)
+ (inputs
+ `(("nginx-sources" ,(package-source nginx-socket-cloexec))
+ ("luajit" ,luajit)
+ ,@(package-inputs nginx)))
+ (arguments
+ (substitute-keyword-arguments
+ `(#:configure-flags '("--add-dynamic-module=.")
+ #:make-flags '("modules")
+ #:modules ((guix build utils)
+ (guix build gnu-build-system)
+ (ice-9 popen)
+ (ice-9 regex)
+ (ice-9 textual-ports))
+ ,@(package-arguments nginx))
+ ((#:phases phases)
+ `(modify-phases ,phases
+ (add-after 'unpack 'unpack-nginx-sources
+ (lambda* (#:key inputs native-inputs #:allow-other-keys)
+ (begin
+ ;; The nginx source code is part of the module’s source.
+ (format #t "decompressing nginx source code~%")
+ (let ((tar (assoc-ref inputs "tar"))
+ (nginx-srcs (assoc-ref inputs "nginx-sources")))
+ (invoke (string-append tar "/bin/tar")
+ "xvf" nginx-srcs "--strip-components=1"))
+ #t)))
+ (add-before 'configure 'set-luajit-env
+ (lambda* (#:key inputs #:allow-other-keys)
+ (let ((luajit (assoc-ref inputs "luajit")))
+ (setenv "LUAJIT_LIB"
+ (string-append luajit "/lib"))
+ (setenv "LUAJIT_INC"
+ (string-append luajit "/include/luajit-2.1"))
+ #t)))
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((modules-dir (string-append (assoc-ref outputs "out")
"/etc/nginx/modules")))
+ (mkdir-p modules-dir)
+ (copy-file "objs/ngx_http_lua_module.so"
+ (string-append modules-dir
"/ngx_http_lua_module.so"))
+ #t)))
+ (delete 'fix-root-dirs)
+ (delete 'install-man-page)))))
+ (synopsis "NGINX module for Lua programming language support")
+ (description "This NGINX module provides a scripting support with Lua
+programming language.")))
+
(define-public lighttpd
(package
(name "lighttpd")
- branch master updated (dd64251 -> 00014f7), guix-commits, 2020/10/14
- 03/08: gnu: Add lua-resty-signal., guix-commits, 2020/10/14
- 01/08: gnu: Add lua-resty-core., guix-commits, 2020/10/14
- 02/08: gnu: Add lua-resty-lrucache., guix-commits, 2020/10/14
- 04/08: gnu: Add lua-tablepool., guix-commits, 2020/10/14
- 06/08: gnu: Add nginx-socket-cloexec., guix-commits, 2020/10/14
- 07/08: gnu: Add nginx-lua-module.,
guix-commits <=
- 05/08: gnu: Add lua-resty-shell., guix-commits, 2020/10/14
- 08/08: services: nginx: Add lua module., guix-commits, 2020/10/14