commit:     e0b1493dce7b2f868d3348e58d746c22a265820d
Author:     Zurab Kvachadze <zurabid2016 <AT> gmail <DOT> com>
AuthorDate: Sun Feb  8 19:01:57 2026 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Feb 20 19:09:34 2026 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0b1493d

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
fffbf942fc40a82d37746e70c061864aefa116f5 "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 <AT> gentoo.org>
Signed-off-by: Zurab Kvachadze <zurabid2016 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 eclass/nginx-module.eclass                         | 115 ++++++++++++---------
 .../ngx-auth-ldap-0.1_p20240424.ebuild             |   5 +-
 www-nginx/ngx-authpam/ngx-authpam-1.5.5.ebuild     |   7 +-
 .../ngx-brotli-1.0.0_rc_p20231109.ebuild           |   5 +-
 .../ngx-cache-purge/ngx-cache-purge-2.3.ebuild     |   5 +-
 www-nginx/ngx-dav-ext/ngx-dav-ext-3.0.0.ebuild     |   5 +-
 www-nginx/ngx-echo/ngx-echo-0.63.ebuild            |   5 +-
 .../ngx-encrypted-session-0.09.ebuild              |   5 +-
 www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild     |   5 +-
 www-nginx/ngx-geoip2/ngx-geoip2-3.4.ebuild         |   5 +-
 .../ngx-headers-more/ngx-headers-more-0.37.ebuild  |   5 +-
 www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild          |   5 +-
 .../ngx-lua-module/ngx-lua-module-0.10.27.ebuild   |   7 +-
 .../ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild  |   5 +-
 www-nginx/ngx-memc/ngx-memc-0.20.ebuild            |   5 +-
 .../ngx-modsecurity/ngx-modsecurity-1.0.4.ebuild   |   5 +-
 www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild        |   9 +-
 .../ngx-push-stream/ngx-push-stream-0.6.0.ebuild   |   5 +-
 www-nginx/ngx-rtmp/ngx-rtmp-1.2.2.ebuild           |   5 +-
 www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild    |   5 +-
 www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild      |   5 +-
 .../ngx-upload-progress-0.9.3.ebuild               |   5 +-
 www-nginx/ngx-vod/ngx-vod-1.33.ebuild              |   5 +-
 www-nginx/ngx-vts/ngx-vts-0.2.4.ebuild             |   9 +-
 www-nginx/ngx-xss/ngx-xss-0.06.ebuild              |   5 +-
 www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild |   6 +-
 www-nginx/njs/njs-0.9.4.ebuild                     |  10 +-
 27 files changed, 150 insertions(+), 113 deletions(-)

diff --git a/eclass/nginx-module.eclass b/eclass/nginx-module.eclass
index efa93f376701..c470fcb5f00c 100644
--- a/eclass/nginx-module.eclass
+++ b/eclass/nginx-module.eclass
@@ -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"
-       default_src_prepare
-       popd >/dev/null || die "popd failed"
-
+       # Get back into the module root and apply patches.
        popd >/dev/null || die "popd failed"
+       default_src_prepare
 }
 
 # @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

diff --git a/www-nginx/ngx-auth-ldap/ngx-auth-ldap-0.1_p20240424.ebuild 
b/www-nginx/ngx-auth-ldap/ngx-auth-ldap-0.1_p20240424.ebuild
index 5b040b619909..2492eafd1f6b 100644
--- a/www-nginx/ngx-auth-ldap/ngx-auth-ldap-0.1_p20240424.ebuild
+++ b/www-nginx/ngx-auth-ldap/ngx-auth-ldap-0.1_p20240424.ebuild
@@ -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"

diff --git a/www-nginx/ngx-authpam/ngx-authpam-1.5.5.ebuild 
b/www-nginx/ngx-authpam/ngx-authpam-1.5.5.ebuild
index ba433c68ce38..82ff3fb336f7 100644
--- a/www-nginx/ngx-authpam/ngx-authpam-1.5.5.ebuild
+++ b/www-nginx/ngx-authpam/ngx-authpam-1.5.5.ebuild
@@ -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
 }

diff --git a/www-nginx/ngx-brotli/ngx-brotli-1.0.0_rc_p20231109.ebuild 
b/www-nginx/ngx-brotli/ngx-brotli-1.0.0_rc_p20231109.ebuild
index 208fced4ea52..7f0425c5dc8e 100644
--- a/www-nginx/ngx-brotli/ngx-brotli-1.0.0_rc_p20231109.ebuild
+++ b/www-nginx/ngx-brotli/ngx-brotli-1.0.0_rc_p20231109.ebuild
@@ -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"

diff --git a/www-nginx/ngx-cache-purge/ngx-cache-purge-2.3.ebuild 
b/www-nginx/ngx-cache-purge/ngx-cache-purge-2.3.ebuild
index c268cf0a2d48..2c7e6a286a35 100644
--- a/www-nginx/ngx-cache-purge/ngx-cache-purge-2.3.ebuild
+++ b/www-nginx/ngx-cache-purge/ngx-cache-purge-2.3.ebuild
@@ -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"
 

diff --git a/www-nginx/ngx-dav-ext/ngx-dav-ext-3.0.0.ebuild 
b/www-nginx/ngx-dav-ext/ngx-dav-ext-3.0.0.ebuild
index 667f6f3db53f..26a215ba4e84 100644
--- a/www-nginx/ngx-dav-ext/ngx-dav-ext-3.0.0.ebuild
+++ b/www-nginx/ngx-dav-ext/ngx-dav-ext-3.0.0.ebuild
@@ -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"

diff --git a/www-nginx/ngx-echo/ngx-echo-0.63.ebuild 
b/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
index 331978a4ab88..1014cf32d2d8 100644
--- a/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
+++ b/www-nginx/ngx-echo/ngx-echo-0.63.ebuild
@@ -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"

diff --git a/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild 
b/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
index d832bd83e182..9f539cae8740 100644
--- a/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
+++ b/www-nginx/ngx-encrypted-session/ngx-encrypted-session-0.09.ebuild
@@ -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"

diff --git a/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild 
b/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
index a893d7bd518d..169a8eb8739e 100644
--- a/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
+++ b/www-nginx/ngx-eval/ngx-eval-0_p20240817.ebuild
@@ -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"

diff --git a/www-nginx/ngx-geoip2/ngx-geoip2-3.4.ebuild 
b/www-nginx/ngx-geoip2/ngx-geoip2-3.4.ebuild
index 5a4bb04df73c..08bd55de8691 100644
--- a/www-nginx/ngx-geoip2/ngx-geoip2-3.4.ebuild
+++ b/www-nginx/ngx-geoip2/ngx-geoip2-3.4.ebuild
@@ -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"

diff --git a/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild 
b/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
index 25d2eed4524d..891a3b93e5bf 100644
--- a/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
+++ b/www-nginx/ngx-headers-more/ngx-headers-more-0.37.ebuild
@@ -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"

diff --git a/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild 
b/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
index 84be156f3591..8ad061983413 100644
--- a/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
+++ b/www-nginx/ngx-iconv/ngx-iconv-0.14.ebuild
@@ -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"

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
index e5b72c9753a3..dd6bd441bb06 100644
--- 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
@@ -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"
 }

diff --git a/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild 
b/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
index 36fdbfe42c41..6c2f9e8bab18 100644
--- a/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
+++ b/www-nginx/ngx-lua-upstream/ngx-lua-upstream-0.07.ebuild
@@ -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"

diff --git a/www-nginx/ngx-memc/ngx-memc-0.20.ebuild 
b/www-nginx/ngx-memc/ngx-memc-0.20.ebuild
index c94d7368e5f9..d2096c872e3b 100644
--- a/www-nginx/ngx-memc/ngx-memc-0.20.ebuild
+++ b/www-nginx/ngx-memc/ngx-memc-0.20.ebuild
@@ -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"

diff --git a/www-nginx/ngx-modsecurity/ngx-modsecurity-1.0.4.ebuild 
b/www-nginx/ngx-modsecurity/ngx-modsecurity-1.0.4.ebuild
index 2ff9f95b55ae..6d39eb7e45da 100644
--- a/www-nginx/ngx-modsecurity/ngx-modsecurity-1.0.4.ebuild
+++ b/www-nginx/ngx-modsecurity/ngx-modsecurity-1.0.4.ebuild
@@ -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"

diff --git a/www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild 
b/www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild
index 4a5888a087af..ce22466d986f 100644
--- a/www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild
+++ b/www-nginx/ngx-naxsi/ngx-naxsi-1.7-r1.ebuild
@@ -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/*
 }

diff --git a/www-nginx/ngx-push-stream/ngx-push-stream-0.6.0.ebuild 
b/www-nginx/ngx-push-stream/ngx-push-stream-0.6.0.ebuild
index 1fb3c3a8bc37..c15f1084571b 100644
--- a/www-nginx/ngx-push-stream/ngx-push-stream-0.6.0.ebuild
+++ b/www-nginx/ngx-push-stream/ngx-push-stream-0.6.0.ebuild
@@ -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"

diff --git a/www-nginx/ngx-rtmp/ngx-rtmp-1.2.2.ebuild 
b/www-nginx/ngx-rtmp/ngx-rtmp-1.2.2.ebuild
index a341e3d6681f..527ff5342e5e 100644
--- a/www-nginx/ngx-rtmp/ngx-rtmp-1.2.2.ebuild
+++ b/www-nginx/ngx-rtmp/ngx-rtmp-1.2.2.ebuild
@@ -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"
 

diff --git a/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild 
b/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
index 2f281e30cbd9..d63a80ddf472 100644
--- a/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
+++ b/www-nginx/ngx-set-misc/ngx-set-misc-0.33.ebuild
@@ -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"

diff --git a/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild 
b/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
index 13a470714866..71ed96b1985b 100644
--- a/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
+++ b/www-nginx/ngx-srcache/ngx-srcache-0.33.ebuild
@@ -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"

diff --git a/www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild 
b/www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild
index 6502419dc8f2..0461b8f06f21 100644
--- a/www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild
+++ b/www-nginx/ngx-upload-progress/ngx-upload-progress-0.9.3.ebuild
@@ -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"

diff --git a/www-nginx/ngx-vod/ngx-vod-1.33.ebuild 
b/www-nginx/ngx-vod/ngx-vod-1.33.ebuild
index 21c50e6482e2..5a9f493bff0f 100644
--- a/www-nginx/ngx-vod/ngx-vod-1.33.ebuild
+++ b/www-nginx/ngx-vod/ngx-vod-1.33.ebuild
@@ -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"

diff --git a/www-nginx/ngx-vts/ngx-vts-0.2.4.ebuild 
b/www-nginx/ngx-vts/ngx-vts-0.2.4.ebuild
index a979e52cdef7..db24c5d6d0ae 100644
--- a/www-nginx/ngx-vts/ngx-vts-0.2.4.ebuild
+++ b/www-nginx/ngx-vts/ngx-vts-0.2.4.ebuild
@@ -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() {

diff --git a/www-nginx/ngx-xss/ngx-xss-0.06.ebuild 
b/www-nginx/ngx-xss/ngx-xss-0.06.ebuild
index 84d38cc1109c..0b4e1e2f51e9 100644
--- a/www-nginx/ngx-xss/ngx-xss-0.06.ebuild
+++ b/www-nginx/ngx-xss/ngx-xss-0.06.ebuild
@@ -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"

diff --git a/www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild 
b/www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild
index b69ecf8b00fb..cd4fdaf60682 100644
--- a/www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild
+++ b/www-nginx/ngx_devel_kit/ngx_devel_kit-0.3.4.ebuild
@@ -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"
 }

diff --git a/www-nginx/njs/njs-0.9.4.ebuild b/www-nginx/njs/njs-0.9.4.ebuild
index 1c6e6d36d89f..121278b44e2c 100644
--- a/www-nginx/njs/njs-0.9.4.ebuild
+++ b/www-nginx/njs/njs-0.9.4.ebuild
@@ -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
 }

Reply via email to