nginx-module.eclass: Use S as NGINX_MOD_S, use NGINX_S for build system

Since the introduction of this eclass to the tree, ${S} has always
pointed to the fake NGINX build system directory (i.e. the directory
with symlinks 'src/', 'configure' and 'auto/').

This caused problems in the past, e.g. see commit
fffbf942fc "nginx-module.eclass: Add
NGINX_MOD_CONFIG_DIR, fixup www-nginx/ngx-naxsi". Additionally, ${S} not
pointing to real sources required manual integration for live ebuilds
using git-r3 and Mercurial eclasses alike.

Following Sam's advice on IRC, this commit swaps ${S} and ${NGINX_MOD_S}
to ${NGINX_S} and ${S} respectively. Now, ${S} points to the actual
module's source, easing integration with other eclasses, and ${NGINX_S}
points to our fake build environment. Each phase function, when needed,
obviously pushd'es into ${NGINX_S}.

${NGINX_MOD_S} is now an alias to ${S}; it is deprecated and will be out
of the door in EAPI 9. No ebuilds listed on gpo.zugaina.org reference
${NGINX_MOD_S} so it is safe to not synchronise its value with ${S}.

git-r3 and mercurial eclasses may now be used with nginx-module.eclass
as in every other ebuild: set the relevant E(GIT|HG)_REPO_URI, inherit
the required eclass, and you are good to go!

Closes: https://bugs.gentoo.org/967171
Suggested-by: Sam James <sam@gentoo.org>
Signed-off-by: Zurab Kvachadze <zurabid2016@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Zurab Kvachadze
2026-02-20 19:09:34 +00:00
committed by Sam James
parent f5707053d1
commit e0b1493dce
27 changed files with 150 additions and 113 deletions
+67 -48
View File
@@ -309,27 +309,39 @@ ngx_mod_link_lib() {
#-----> ebuild-defined variables <-----
# @ECLASS_VARIABLE: NGINX_MOD_S
# @DEPRECATED: S
# @DESCRIPTION:
# This variable is deprecated. ${S} must be used directly instead.
#
# Deprecated description:
# Holds the path to the module source directory, used in various phase
# functions. If unset at the time of inherit, defaults to ${S}.
: "${NGINX_MOD_S=${S}}"
if [[ -n ${NGINX_MOD_S} ]]; then
eqawarn "\${NGINX_MOD_S} will be removed in EAPI 9 and must not be used."
eqawarn "Use \${S} directly instead."
# Backwards compatibility stub for modules redefining module's source path
# via ${NGINX_MOD_S}.
S="${NGINX_MOD_S}"
fi
# @ECLASS_VARIABLE: NGINX_MOD_CONFIG_DIR
# @DESCRIPTION:
# Holds the path of the directory containing the config script relative to the
# module source directory specified by the ${NGINX_MOD_S} variable. If unset at
# the time of inherit, defaults to "" (an empty string, meaning the config
# script is located at the root of the module source directory).
# module source directory specified by the ${S} variable. If unset at the time
# of inherit, defaults to "" (an empty string, meaning the config script is
# located at the root of the module source directory).
#
# For example, in www-nginx/njs, NGINX_MOD_S="${WORKDIR}/${P}" and
# For example, in www-nginx/njs, S="${WORKDIR}/${P}" and
# NGINX_MOD_CONFIG_DIR="nginx".
: "${NGINX_MOD_CONFIG_DIR=""}"
# The ${S} variable is set to the path of the directory where the actual build
# will be performed. In this directory, symbolic links to NGINX's build system
# and NGINX's headers are created by the nginx-module_src_unpack() phase
# function.
S="${WORKDIR}/nginx"
# @ECLASS_VARIABLE: NGINX_S
# @INTERNAL
# @DESCRIPTION:
# Path of the fake NGINX build environment directory where the actual build will
# be performed. In this directory, symbolic links to NGINX's build system and
# NGINX's headers are created in the nginx-module_src_prepare() phase function.
NGINX_S="${WORKDIR}/nginx"
# @ECLASS_VARIABLE: NGINX_MOD_SHARED_OBJECTS
# @OUTPUT_VARIABLE
@@ -524,34 +536,40 @@ unset -f _ngx_mod_set_test_env
#-----> Phase functions <-----
# @FUNCTION: nginx-module_src_unpack
# @DESCRIPTION:
# Unpacks the sources and sets up the build directory in S=${WORKDIR}/nginx.
# Creates the following symbolic links (to not copy the files over):
# - '${S}/src' -> '/usr/include/nginx',
# - '${S}/auto' -> '/usr/src/nginx/auto',
# - '${S}/configure' -> '/usr/src/nginx/configure'.
# For additional information, see the nginx.eclass source, namely the
# nginx_src_install() function.
nginx-module_src_unpack() {
debug-print-function "${FUNCNAME[0]}" "$@"
default_src_unpack
mkdir nginx || die "mkdir failed"
ln -s "${BROOT}/usr/src/nginx/configure" nginx/configure || die "ln failed"
ln -s "${BROOT}/usr/src/nginx/auto" nginx/auto || die "ln failed"
ln -s "${ESYSROOT}/usr/include/nginx" nginx/src || die "ln failed"
}
# @FUNCTION: nginx-module_src_prepare
# @DESCRIPTION:
# Patches module's initialisation code so that any module's preprocessor
# definitions appear in the separate '__ngx_gentoo_mod_config.h' file inside the
# 'build' directory. This function also makes module's "config" script clear
# whatever content build/ngx_auto_config.h may have at the time of invocation.
# Then, default_src_prepare() is called.
# Creates a fake build environment and patches the module's initialisation code
# to play nicely with it.
#
# In the build environment initialisation part, the following symbolic links are
# created (to not copy files over):
# - '${NGINX_S}/src' -> '/usr/include/nginx',
# - '${NGINX_S}/auto' -> '/usr/src/nginx/auto',
# - '${NGINX_S}/configure' -> '/usr/src/nginx/configure'.
# For additional information of what resides under linked paths, see the
# nginx.eclass source, namely the nginx_src_install() function.
#
# The second part of the function patches module's initialisation code so that
# any module's preprocessor definitions appear in the separate
# '__ngx_gentoo_mod_config.h' file inside the 'build' directory. This function
# also makes module's "config" script clear whatever content
# build/ngx_auto_config.h may have at the time of invocation. Then,
# default_src_prepare() is called.
nginx-module_src_prepare() {
debug-print-function "${FUNCNAME[0]}" "$@"
pushd "${NGINX_MOD_S}/${NGINX_MOD_CONFIG_DIR}" >/dev/null ||
# Set up a fake build environment by creating symlinks to the build system
# and the headers.
ebegin "Setting up fake NGINX build environment"
mkdir "${NGINX_S}" || die "mkdir failed"
pushd "${NGINX_S}" >/dev/null || die "pushd failed"
ln -s "${BROOT}/usr/src/nginx/configure" configure || die "ln failed"
ln -s "${BROOT}/usr/src/nginx/auto" auto || die "ln failed"
ln -s "${ESYSROOT}/usr/include/nginx" src || die "ln failed"
popd >/dev/null || die "popd failed"
eend 0
pushd "${S}/${NGINX_MOD_CONFIG_DIR}" >/dev/null ||
die "pushd failed"
ebegin "Patching module's config"
@@ -588,12 +606,9 @@ nginx-module_src_prepare() {
# shellcheck disable=SC2320
eend $? || die "printf failed"
# cd into module root and apply patches.
pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"
# Get back into the module root and apply patches.
popd >/dev/null || die "popd failed"
default_src_prepare
popd >/dev/null || die "popd failed"
popd >/dev/null || die "popd failed"
}
# @FUNCTION: nginx-module_src_configure
@@ -608,6 +623,8 @@ nginx-module_src_prepare() {
# NGINX_MOD_LINK_MODULES is set.
nginx-module_src_configure() {
debug-print-function "${FUNCNAME[0]}" "$@"
pushd "${NGINX_S}" >/dev/null || die "pushd failed"
local ngx_mod_flags
ngx_mod_flags=(
--with-cc="$(tc-getCC)"
@@ -619,7 +636,7 @@ nginx-module_src_configure() {
--with-cc-opt="-isystem src/modules"
--with-ld-opt="${LDFLAGS}"
--builddir=build
--add-dynamic-module="${NGINX_MOD_S}/${NGINX_MOD_CONFIG_DIR}"
--add-dynamic-module="${S}/${NGINX_MOD_CONFIG_DIR}"
)
# NGINX build system adds directories under src/ to the include path based
@@ -672,6 +689,8 @@ nginx-module_src_configure() {
die "cat failed"
cp "${ESYSROOT}/usr/include/nginx/ngx_auto_headers.h" build ||
die "cp failed"
popd >/dev/null || die "popd failed"
}
# @FUNCTION: nginx-module_src_compile
@@ -680,11 +699,15 @@ nginx-module_src_configure() {
# NGINX_MOD_SHARED_OBJECTS array.
nginx-module_src_compile() {
debug-print-function "${FUNCNAME[0]}" "$@"
pushd "${NGINX_S}" >/dev/null || die "pushd failed"
emake modules
# Save the basenames of all the compiled modules into the
# NGINX_MOD_SHARED_OBJECTS array.
mapfile -d '' NGINX_MOD_SHARED_OBJECTS < \
<(find -H "${S}/build" -maxdepth 1 -type f -name '*.so' -printf '%P\0')
<(find -H "${NGINX_S}/build" -maxdepth 1 -type f -name '*.so' -printf '%P\0')
popd >/dev/null || die "popd failed"
}
# @FUNCTION: nginx-module_src_test
@@ -743,8 +766,6 @@ nginx-module_src_test() {
TEST_NGINX_LOAD_MODULES="${pkg_sonames[*]} ${TEST_NGINX_LOAD_MODULES}"
fi
pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"
# If NGINX_MOD_LINK_MODULES is non-empty, meaning the current module is
# linked to another module in moddir, set LD_LIBRARY_PATH to the module's
# directory so that the dynamic loader can find shared objects we depend on.
@@ -754,8 +775,6 @@ nginx-module_src_test() {
# Tests break when run in parallel.
TEST_NGINX_SERVROOT="${T}/servroot" \
edo prove -j1 -I. -r ./"${NGINX_MOD_TEST_DIR}"
popd >/dev/null || die "popd failed"
}
# @FUNCTION: nginx-module_src_install
@@ -764,7 +783,7 @@ nginx-module_src_test() {
nginx-module_src_install() {
debug-print-function "${FUNCNAME[0]}" "$@"
insinto "/usr/$(get_libdir)/nginx/modules"
doins build/*.so
doins "${NGINX_S}"/build/*.so
}
# @FUNCTION: nginx-module_pkg_postinst
@@ -789,5 +808,5 @@ nginx-module_pkg_postinst() {
fi
EXPORT_FUNCTIONS src_unpack src_prepare src_configure src_compile src_test \
src_install pkg_postinst
EXPORT_FUNCTIONS src_prepare src_configure src_compile src_test src_install \
pkg_postinst
@@ -1,11 +1,10 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="nginx-auth-ldap"
MY_COMMIT="241200eac8e4acae74d353291bd27f79e5ca3dc4"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${MY_COMMIT}"
inherit nginx-module
@@ -15,6 +14,8 @@ SRC_URI="
https://github.com/kvspb/nginx-auth-ldap/archive/${MY_COMMIT}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${MY_COMMIT}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="ngx_http_auth_pam_module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
inherit nginx-module
@@ -14,6 +13,8 @@ SRC_URI="
https://github.com/sto/ngx_http_auth_pam_module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
@@ -25,5 +26,5 @@ RDEPEND="${DEPEND}"
src_install() {
nginx-module_src_install
dodoc "${NGINX_MOD_S}/ChangeLog"
dodoc ChangeLog
}
@@ -1,4 +1,4 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -6,7 +6,6 @@ EAPI=8
NGX_BROTLI_P="ngx-brotli-a71f9312c2deb28875acc7bacfdd5695a111aa53"
MY_PN="${PN//-/_}"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${NGX_BROTLI_P#ngx-brotli-}"
inherit nginx-module
DESCRIPTION="NGINX module for Brotli compression"
@@ -15,6 +14,8 @@ SRC_URI="
https://github.com/google/ngx_brotli/archive/${NGX_BROTLI_P#ngx-brotli-}.tar.gz -> ${NGX_BROTLI_P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${NGX_BROTLI_P#ngx-brotli-}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="ngx_cache_purge"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_OPENRESTY_TESTS=1
inherit nginx-module
@@ -15,6 +14,8 @@ SRC_URI="
https://github.com/FRiCKLE/ngx_cache_purge/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="nginx-dav-ext-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
inherit nginx-module
@@ -14,6 +13,8 @@ SRC_URI="
https://github.com/arut/nginx-dav-ext-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
+3 -2
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="echo-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_OPENRESTY_TESTS=1
NGINX_MOD_TEST_LOAD_ORDER=(
@@ -19,6 +18,8 @@ SRC_URI="
https://github.com/openresty/echo-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="encrypted-session-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
@@ -22,6 +21,8 @@ SRC_URI="
https://github.com/openresty/encrypted-session-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,11 +1,10 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_COMMIT="13425e897c19f4f4436c5ca4414dddd37fc65190"
MY_P="nginx-eval-module-${MY_COMMIT}"
NGINX_MOD_S="${WORKDIR}/${MY_P}"
NGINX_MOD_OPENRESTY_TESTS=1
NGINX_MOD_TEST_LOAD_ORDER=(
@@ -20,6 +19,8 @@ SRC_URI="
https://github.com/openresty/nginx-eval-module/archive/${MY_COMMIT}.tar.gz -> ${MY_P}.tar.gz
"
S="${WORKDIR}/${MY_P}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
+3 -2
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="ngx_http_geoip2_module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
inherit nginx-module
@@ -14,6 +13,8 @@ SRC_URI="
https://github.com/leev/ngx_http_geoip2_module/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="headers-more-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_OPENRESTY_TESTS=1
# ngx-headers-more must be loaded after ngx-lua-module module for test to work.
@@ -22,6 +21,8 @@ SRC_URI="
https://github.com/openresty/headers-more-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
+3 -2
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="iconv-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
@@ -25,6 +24,8 @@ SRC_URI="
https://github.com/calio/iconv-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,4 +1,4 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -7,7 +7,6 @@ EAPI=8
LUA_COMPAT=( luajit )
MY_PN="lua-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
@@ -19,6 +18,8 @@ SRC_URI="
https://github.com/openresty/lua-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -55,6 +56,6 @@ 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
find src/api -type f -name '*.h' -print0 | xargs -0 doins
assert "find failed"
}
@@ -1,4 +1,4 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -7,7 +7,6 @@ EAPI=8
LUA_COMPAT=( luajit )
MY_PN="lua-upstream-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx-lua-module )
@@ -24,6 +23,8 @@ SRC_URI="
https://github.com/openresty/lua-upstream-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
+3 -2
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="memc-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_OPENRESTY_TESTS=1
NGINX_MOD_TEST_LOAD_ORDER=(
@@ -21,6 +20,8 @@ SRC_URI="
https://github.com/openresty/memc-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="ModSecurity-nginx"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-v${PV}"
inherit nginx-module
@@ -18,6 +17,8 @@ SRC_URI="
https://github.com/owasp-modsecurity/ModSecurity-nginx/releases/download/v${PV}/${MY_PN}-v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-v${PV}"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="amd64 arm64"
+5 -4
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="naxsi"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_CONFIG_DIR="naxsi_src"
inherit nginx-module
@@ -17,6 +16,8 @@ SRC_URI="
https://github.com/wargio/naxsi/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
@@ -32,7 +33,7 @@ PATCHES=(
src_install() {
nginx-module_src_install
insinto /etc/nginx/naxsi
doins -r "${NGINX_MOD_S}"/naxsi_rules/*
doins -r naxsi_rules/*
docompress -x "/usr/share/doc/${PF}"
dodoc -r "${NGINX_MOD_S}"/docs/*
dodoc -r docs/*
}
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="nginx-push-stream-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
inherit nginx-module
@@ -14,6 +13,8 @@ SRC_URI="
https://github.com/wandenberg/nginx-push-stream-module/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="amd64 arm64"
+3 -2
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="nginx-rtmp-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
inherit nginx-module
@@ -14,6 +13,8 @@ SRC_URI="
https://github.com/arut/nginx-rtmp-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="set-misc-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_LINK_MODULES=( www-nginx/ngx_devel_kit )
@@ -21,6 +20,8 @@ SRC_URI="
https://github.com/openresty/set-misc-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="srcache-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
NGINX_MOD_OPENRESTY_TESTS=1
# ngx-srcache must be after ngx-xss, but before ngx-lua-module. The former might
@@ -25,6 +24,8 @@ SRC_URI="
https://github.com/openresty/srcache-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,4 +1,4 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -11,7 +11,8 @@ HOMEPAGE="https://github.com/masterzen/nginx-upload-progress-module"
SRC_URI="
https://github.com/masterzen/nginx-upload-progress-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
+3 -2
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="nginx-vod-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
inherit nginx-module
@@ -14,6 +13,8 @@ SRC_URI="
https://github.com/kaltura/nginx-vod-module/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="AGPL-3+"
SLOT="0"
KEYWORDS="amd64 arm64"
+5 -4
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="nginx-module-vts"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
inherit nginx-module
@@ -14,6 +13,8 @@ SRC_URI="
https://github.com/vozlt/nginx-module-vts/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -21,10 +22,10 @@ KEYWORDS="amd64 arm64"
src_install() {
nginx-module_src_install
dodoc "${NGINX_MOD_S}/CHANGELOG.md"
dodoc CHANGELOG.md
# Install the HTML status pages.
insinto usr/share/"${PN}"
doins "${NGINX_MOD_S}"/share/*.html
doins share/*.html
}
pkg_postinst() {
+3 -2
View File
@@ -1,10 +1,9 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
MY_PN="xss-nginx-module"
NGINX_MOD_S="${WORKDIR}/${MY_PN}-${PV}"
# Strangely, 10-year-old tests work perfectly.
NGINX_MOD_OPENRESTY_TESTS=1
@@ -20,6 +19,8 @@ SRC_URI="
https://github.com/openresty/xss-nginx-module/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
"
S="${WORKDIR}/${MY_PN}-${PV}"
LICENSE="BSD-2"
SLOT="0"
KEYWORDS="amd64 arm64"
@@ -1,4 +1,4 @@
# Copyright 1999-2025 Gentoo Authors
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -35,12 +35,8 @@ 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"
}
+4 -6
View File
@@ -66,13 +66,11 @@ src_configure() {
myargs+=( "${nocliargs[@]}" )
fi
pushd "${NGINX_MOD_S}" >/dev/null || die "pushd failed"
edo ./configure "${myargs[@]}"
popd >/dev/null || die "popd failed"
## The NGINX module part.
# Build the stream module unconditionally.
sed -i "s/\\\$STREAM/YES/" "${NGINX_MOD_S}/${NGINX_MOD_CONFIG_DIR}/config" ||
sed -i "s/\\\$STREAM/YES/" nginx/config ||
die "sed failed"
# Export PKG_CONFIG for pkg-config-based QuickJS-NG detection.
@@ -101,16 +99,16 @@ src_configure() {
src_compile() {
# Build the core first.
if use tools; then
emake -C "${NGINX_MOD_S}"
emake
else
emake -C "${NGINX_MOD_S}" libnjs libqjs
emake libnjs libqjs
fi
nginx-module_src_compile
}
src_install() {
use tools && dobin "${NGINX_MOD_S}"/build/njs
use tools && dobin build/njs
nginx-module_src_install
}