From: Zurab Kvachadze <zurabid2016@gmail.com>
To: gentoo-dev@lists.gentoo.org
Cc: Zurab Kvachadze <zurabid2016@gmail.com>
Subject: [gentoo-dev] [PATCH v4 29/44] www-nginx/ngx-lua-module: new package, add 0.10.27
Date: Thu, 3 Jul 2025 00:06:49 +0200 [thread overview]
Message-ID: <20250702220705.4649-30-zurabid2016@gmail.com> (raw)
In-Reply-To: <20250702220705.4649-1-zurabid2016@gmail.com>
This package requires two environmental variables being set in order to
use Lua: LUAJIT_LIB and LUAJIT_INC. The former is set to /usr/${libdir},
for the latter one, the ebuild uses pkg-config directly to get the
include directory.
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
---
www-nginx/ngx-lua-module/Manifest | 1 +
...lua-module-0.10.27-always-define-NDK.patch | 29 +++++++++
...0.10.27-do-not-log-non-openresty-lua.patch | 41 +++++++++++++
.../ngx-lua-module}/metadata.xml | 8 ++-
.../ngx-lua-module-0.10.27.ebuild | 59 +++++++++++++++++++
5 files changed, 135 insertions(+), 3 deletions(-)
create mode 100644 www-nginx/ngx-lua-module/Manifest
create mode 100644 www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch
create mode 100644 www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch
copy {dev-lua/lua-resty-lrucache => www-nginx/ngx-lua-module}/metadata.xml (56%)
create mode 100644 www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild
diff --git a/www-nginx/ngx-lua-module/Manifest b/www-nginx/ngx-lua-module/Manifest
new file mode 100644
index 000000000000..245ccaf878bd
--- /dev/null
+++ b/www-nginx/ngx-lua-module/Manifest
@@ -0,0 +1 @@
+DIST ngx-lua-module-0.10.27.tar.gz 758952 BLAKE2B 3c0a85fac3452a50eb4009405d7a8f76262d3d36c844139ce3eb829eefef098641b161e0ff27487332fa21269667a838bd2d913cea1c4b183cd9cad87ac76783 SHA512 ff1f7bb593a91402453709d63c95b304ef14d805f5a7f8e6689e95b93522823b80f76baced70664c9f46e9fc8da3941f153b9cf5d1dfbabfb0ee9d9bcc8151b4
diff --git a/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch b/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch
new file mode 100644
index 000000000000..309670bcb3d5
--- /dev/null
+++ b/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-always-define-NDK.patch
@@ -0,0 +1,29 @@
+From e156f14b262ec3dce32e87dfeb0dabce4821646c Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Sun, 16 Feb 2025 22:51:03 +0100
+Subject: [PATCH] src/ngx_http_lua_common.h: always #define NDK
+
+In Gentoo, NDK is a mandatory dependency. Make life easier for everybody
+and just define the NDK macro.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ src/ngx_http_lua_common.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/ngx_http_lua_common.h b/src/ngx_http_lua_common.h
+index cc2d36a3..42a7df6b 100644
+--- a/src/ngx_http_lua_common.h
++++ b/src/ngx_http_lua_common.h
+@@ -23,6 +23,8 @@
+ #include <lualib.h>
+ #include <lauxlib.h>
+
++#define NDK 1
++
+
+ #if defined(NDK) && NDK
+ #include <ndk.h>
+--
+2.45.3
+
diff --git a/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch b/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch
new file mode 100644
index 000000000000..98c5967da149
--- /dev/null
+++ b/www-nginx/ngx-lua-module/files/ngx-lua-module-0.10.27-do-not-log-non-openresty-lua.patch
@@ -0,0 +1,41 @@
+From 87a7e04982a2d2963b10965304d822554d1ec848 Mon Sep 17 00:00:00 2001
+From: Zurab Kvachadze <zurabid2016@gmail.com>
+Date: Tue, 11 Feb 2025 10:57:14 +0100
+Subject: [PATCH] Do not log error if non-OpenResty Lua is used
+
+Users are perfectly capable of reading the recommendation on README and
+deciding themselves which distribution of Lua to use. There is no need
+to scream at the users each time NGINX is started.
+
+Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
+---
+ src/ngx_http_lua_module.c | 13 +------------
+ 1 file changed, 1 insertion(+), 12 deletions(-)
+
+diff --git a/src/ngx_http_lua_module.c b/src/ngx_http_lua_module.c
+index 63367f46..4ddf7b21 100644
+--- a/src/ngx_http_lua_module.c
++++ b/src/ngx_http_lua_module.c
+@@ -895,18 +895,7 @@ ngx_http_lua_init(ngx_conf_t *cf)
+ if (lmcf->lua == NULL) {
+ dd("initializing lua vm");
+
+-#ifndef OPENRESTY_LUAJIT
+- if (ngx_process != NGX_PROCESS_SIGNALLER && !ngx_test_config) {
+- ngx_log_error(NGX_LOG_ALERT, cf->log, 0,
+- "detected a LuaJIT version which is not OpenResty's"
+- "; many optimizations will be disabled and "
+- "performance will be compromised (see "
+- "https://github.com/openresty/luajit2 for "
+- "OpenResty's LuaJIT or, even better, consider using "
+- "the OpenResty releases from https://openresty.org/"
+- "en/download.html)");
+- }
+-#else
++#ifdef OPENRESTY_LUAJIT
+ # if !defined(HAVE_LUA_RESETTHREAD)
+ ngx_log_error(NGX_LOG_ALERT, cf->log, 0,
+ "detected an old version of OpenResty's LuaJIT missing "
+--
+2.45.3
+
diff --git a/dev-lua/lua-resty-lrucache/metadata.xml b/www-nginx/ngx-lua-module/metadata.xml
similarity index 56%
copy from dev-lua/lua-resty-lrucache/metadata.xml
copy to www-nginx/ngx-lua-module/metadata.xml
index 81d1558075b9..42a518e970f5 100644
--- a/dev-lua/lua-resty-lrucache/metadata.xml
+++ b/www-nginx/ngx-lua-module/metadata.xml
@@ -10,10 +10,12 @@
<name>Proxy Maintainers</name>
</maintainer>
<longdescription>
- This library implements a simple LRU cache for OpenResty and the ngx_lua module.
+ The ngx-lua module embeds LuaJIT 2.0/2.1 into NGINX. By leveraging NGINX's subrequests, this
+ module allows the integration of the powerful Lua threads (known as Lua "coroutines") into
+ the NGINX event model.
</longdescription>
<upstream>
- <bugs-to>https://github.com/openresty/lua-resty-lrucache/issues</bugs-to>
- <remote-id type="github">openresty/lua-resty-lrucache</remote-id>
+ <bugs-to>https://github.com/openresty/lua-nginx-module/issues</bugs-to>
+ <remote-id type="github">openresty/lua-nginx-module</remote-id>
</upstream>
</pkgmetadata>
diff --git a/www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild b/www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild
new file mode 100644
index 000000000000..8be9b7197480
--- /dev/null
+++ b/www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild
@@ -0,0 +1,59 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Upstream supports luajit only.
+LUA_COMPAT=( luajit )
+
+MY_PN="lua-nginx-module"
+NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
+
+NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
+
+inherit lua-single nginx-module
+
+DESCRIPTION="A module embedding the power of Lua into NGINX HTTP Servers"
+HOMEPAGE="https://github.com/openresty/lua-nginx-module"
+SRC_URI="
+ https://github.com/openresty/lua-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
+"
+
+LICENSE="BSD-2"
+SLOT="0"
+
+REQUIRED_USE="${LUA_REQUIRED_USE}"
+
+# Tests require too much manual patching to get working.
+RESTRICT="test"
+
+BDEPEND="virtual/pkgconfig"
+DEPEND="${LUA_DEPS}"
+RDEPEND="
+ ${DEPEND}
+ dev-lua/lua-resty-core[${LUA_SINGLE_USEDEP}]
+ dev-lua/lua-resty-lrucache[${LUA_SINGLE_USEDEP}]
+"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-0.10.27-always-define-NDK.patch"
+ "${FILESDIR}/${PN}-0.10.27-do-not-log-non-openresty-lua.patch"
+)
+
+src_configure() {
+ # The config script does some manual auto-detection, which only looks for
+ # luajit-2.0, so we set the necessary variables manually.
+ export LUAJIT_LIB="${ESYSROOT}/usr/$(get_libdir)"
+ export LUAJIT_INC="$(lua_get_include_dir)"
+
+ nginx-module_src_configure
+}
+
+src_install() {
+ nginx-module_src_install
+
+ # Install headers from 'src/api' into '/usr/include/nginx/modules'.
+ insinto /usr/include/nginx/modules
+ find "${NGINX_MOD_S}/src/api" -type f -name '*.h' -print0 | xargs -0 doins
+ assert "find failed"
+}
--
2.49.0
next prev parent reply other threads:[~2025-07-02 22:34 UTC|newest]
Thread overview: 46+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-02 22:06 [gentoo-dev] [PATCH v4 00/44] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 01/44] nginx.eclass: Add new eclass for building the NGINX server Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 02/44] dev-perl/Test-Nginx: new package, add 0.31 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 03/44] nginx-module.eclass: Add new eclass for building NGINX external modules Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 04/44] profiles/arch/powerpc/ppc64: mask tests for www-servers/nginx Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 05/44] profiles/arch/riscv: " Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 06/44] www-servers/nginx: add myself as a proxy maintainer; update metadata.xml Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 07/44] www-servers/nginx: add nginx.tmpfiles for managing /var/tmp/nginx Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 08/44] www-servers/nginx: add nginx-r5.initd Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 09/44] www-servers/nginx: add nginx-r1.confd Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 10/44] www-servers/nginx: add nginx-r2.service Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 11/44] www-servers/nginx: add nginx-r2.logrotate Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 12/44] www-servers/nginx: add nginx-r4.conf Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 13/44] profiles/desc: reword and update nginx_modules_http.desc Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 14/44] profiles/desc: reword and update nginx_modules_mail.desc Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 15/44] profiles/desc: reword and update nginx_modules_stream.desc Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 16/44] profiles/categories: Add www-nginx category for external NGINX modules Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 17/44] app-metrics/nginx-lua-prometheus: revbump to r101, update EAPI 7 -> 8, remove r100 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 18/44] www-servers/nginx: add 1.29.0, use nginx.eclass Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 19/44] www-servers/nginx: add 9999 live version, " Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 20/44] www-nginx/ngx_devel_kit: new package, add 0.3.4 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 21/44] www-nginx/ngx-echo: new package, add 0.63 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 22/44] www-nginx/ngx-encrypted-session: new package, add 0.09 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 23/44] www-nginx/ngx-set-misc: new package, add 0.33 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 24/44] www-nginx/ngx-brotli: new package, add 20231109 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 25/44] www-nginx/ngx-headers-more: new package, add 0.37 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 26/44] www-nginx/ngx-upload-progress: new package, add 0.9.3 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 27/44] dev-lua/lua-resty-core: new package, add 0.1.30 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 28/44] dev-lua/lua-resty-lrucache: new package, add 0.15 Zurab Kvachadze
2025-07-02 22:06 ` Zurab Kvachadze [this message]
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 30/44] dev-lua/lua-resty-string: new package, add 0.16 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 31/44] dev-lua/lua-resty-mysql: new package, add 0.27 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 32/44] dev-lua/lua-resty-memcached: new package, add 0.17 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 33/44] www-nginx/ngx-xss: new package, add 0.06 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 34/44] www-nginx/ngx-eval: new package, add 0_p20240817 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 35/44] www-nginx/ngx-iconv: new package, add 0.14 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 36/44] www-nginx/ngx-srcache: new package, add 0.33 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 37/44] www-nginx/ngx-lua-upstream: new package, add 0.07 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 38/44] www-nginx/ngx-memc: new package, add 0.20 Zurab Kvachadze
2025-07-02 22:06 ` [gentoo-dev] [PATCH v4 39/44] www-nginx: enable tests for OpenResty modules Zurab Kvachadze
2025-07-02 22:07 ` [gentoo-dev] [PATCH v4 40/44] www-nginx/ngx-dav-ext: new package, add 3.0.0 Zurab Kvachadze
2025-07-02 22:07 ` [gentoo-dev] [PATCH v4 41/44] www-nginx/ngx-geoip2: new package, add 3.4 Zurab Kvachadze
2025-07-02 22:07 ` [gentoo-dev] [PATCH v4 42/44] www-nginx/ngx-fancyindex: new package, add 0.5.2 Zurab Kvachadze
2025-07-02 22:07 ` [gentoo-dev] [PATCH v4 43/44] www-nginx/ngx-vod: new package, add 1.33 Zurab Kvachadze
2025-07-02 22:07 ` [gentoo-dev] [PATCH v4 44/44] www-nginx/ngx-modsecurity: new package, add 1.0.3 Zurab Kvachadze
2025-07-05 7:23 ` [gentoo-dev] [PATCH v4 00/44] Rework NGINX packaging in Gentoo by introducing nginx{,-module}.eclass Sam James
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250702220705.4649-30-zurabid2016@gmail.com \
--to=zurabid2016@gmail.com \
--cc=gentoo-dev@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox