summaryrefslogtreecommitdiff
path: root/www-nginx/ngx-lua-module/ngx-lua-module-0.10.27.ebuild
blob: d9b66d6eb2f38c62aebd5e76aa314a7cc267fce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# 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"
KEYWORDS="~amd64 ~arm64"

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"
}