From: Oleg Pykhalov <go.wigust@gmail.com>
To: 43933@debbugs.gnu.org
Cc: Oleg Pykhalov <go.wigust@gmail.com>
Subject: [bug#43933] [PATCH 7/8] gnu: Add nginx-lua-module.
Date: Sun, 11 Oct 2020 21:30:11 +0300 [thread overview]
Message-ID: <20201011183012.15932-7-go.wigust@gmail.com> (raw)
In-Reply-To: <20201011183012.15932-1-go.wigust@gmail.com>
* 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 f7330aa749..d2177d2229 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -560,6 +560,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")
--
2.28.0
next prev parent reply other threads:[~2020-10-11 18:34 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-11 18:19 [bug#43933] [PATCH 0/8] services: nginx: Add lua module Oleg Pykhalov
2020-10-11 18:30 ` [bug#43933] [PATCH 1/8] gnu: Add lua-resty-core Oleg Pykhalov
2020-10-11 18:30 ` [bug#43933] [PATCH 2/8] gnu: Add lua-resty-lrucache Oleg Pykhalov
2020-10-11 18:30 ` [bug#43933] [PATCH 3/8] gnu: Add lua-resty-signal Oleg Pykhalov
2020-10-11 18:30 ` [bug#43933] [PATCH 4/8] gnu: Add lua-tablepool Oleg Pykhalov
2020-10-11 18:30 ` [bug#43933] [PATCH 5/8] gnu: Add lua-resty-shell Oleg Pykhalov
2020-10-11 18:30 ` [bug#43933] [PATCH 6/8] gnu: Add nginx-socket-cloexec Oleg Pykhalov
2020-10-11 18:30 ` Oleg Pykhalov [this message]
2020-10-11 18:30 ` [bug#43933] [PATCH 8/8] services: nginx: Add lua module Oleg Pykhalov
2020-10-14 20:43 ` bug#43933: [PATCH 1/8] gnu: Add lua-resty-core Oleg Pykhalov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201011183012.15932-7-go.wigust@gmail.com \
--to=go.wigust@gmail.com \
--cc=43933@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).