summaryrefslogtreecommitdiff
path: root/www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild
blob: b69ecf8b00fb1884701e6acbcf4d61908da35c9f (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
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit flag-o-matic nginx-module

DESCRIPTION="An NGINX module that adds generic tools for third-party modules"
HOMEPAGE="https://github.com/vision5/ngx_devel_kit"
SRC_URI="
	https://github.com/vision5/ngx_devel_kit/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"

LICENSE="BSD"
SLOT="0"
KEYWORDS="amd64 arm64"

src_configure() {
	# ngx_devel_kit (NDK) is designed in a modular way. As such, only the
	# required modules are built based if the corresponding preprocessor macros
	# are defined.
	#
	# Since we do not want to deal with a dependency hell (other NGINX plugins
	# depend on dfferent NDK's modules) and a bunch of USE flag toggles, NDK is
	# compiled with all its modules. Fortunately, even with all the modules
	# built-in, the resulting binary is really small, so the size is not an
	# issue.
	#
	# For details, have a look at 'objs/ndk_config.c' in NDK's source tree and
	# the 'modular' section in 'README.md'.
	append-cflags -DNDK_ALL
	nginx-module_src_configure
}

src_install() {
	nginx-module_src_install

	pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"

	# Install ngx_devel_kit's headers for use by other modules.
	insinto /usr/include/nginx/modules
	find objs src -maxdepth 1 -type f -name '*.h' -print0 | xargs -0 doins
	assert "find failed"

	popd >/dev/null || die "popd failed"
}