InĀ EAPI 9, NGINX_SUPPORT_MODULE_STUBS is enabled unconditionally. Signed-off-by: Zurab Kvachadze <[email protected]> --- eclass/nginx.eclass | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/eclass/nginx.eclass b/eclass/nginx.eclass index 05576be94a42..b7c600316324 100644 --- a/eclass/nginx.eclass +++ b/eclass/nginx.eclass @@ -6,7 +6,7 @@ # Zurab Kvachadze <[email protected]> # @AUTHOR: # Zurab Kvachadze <[email protected]> -# @SUPPORTED_EAPIS: 8 +# @SUPPORTED_EAPIS: 8 9 # @BLURB: Provides a common set of functions for building the NGINX server # @DESCRIPTION: # This eclass automates building, testing and installation of the NGINX server. @@ -21,15 +21,20 @@ # - NGINX_TESTS_COMMIT # And 1 optional variable (see description): # - NGINX_MISC_FILES +# +# EAPI porting notes: +# - 8 -> 9: +# * NGINX_SUPPORT_MODULE_STUBS is enabled unconditionally. + +if [[ -z ${_NGINX_ECLASS} ]]; then +_NGINX_ECLASS=1 case ${EAPI} in - 8) inherit eapi9-pipestatus ;; + 8) inherit eapi9-pipestatus edo ;; + 9) ;; *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;; esac -if [[ -z ${_NGINX_ECLASS} ]]; then -_NGINX_ECLASS=1 - # The 60tmpfiles-paths install check produces QA warning if it does not detect # tmpfiles_process() in pkg_postinst(). Even though the tmpfiles_process() is # clearly called in nginx_pkg_postinst(), the QA check can not deal with @@ -37,7 +42,7 @@ _NGINX_ECLASS=1 # Nonetheless, it is possible to opt out from the QA check by setting the # TMPFILES_OPTIONAL variable. TMPFILES_OPTIONAL=1 -inherit edo multiprocessing perl-functions systemd toolchain-funcs tmpfiles +inherit multiprocessing perl-functions systemd toolchain-funcs tmpfiles #-----> ebuild-defined variables <----- @@ -228,6 +233,8 @@ has "${NGINX_UPDATE_STREAM}" "${NGX_UPDATE_STREAMS_LIST[@]}" || # /etc/nginx/modules-{available,enabled} and to make the default config load # .conf stubs from /etc/nginx/modules-enabled. See nginx_src_install() for # details. +# +# The functionality is unconditionally enabled on EAPI 9. #-----> ebuild setup <----- @@ -860,7 +867,9 @@ nginx_src_install() { # If not using modules, do not 'include modules-enabled/*.conf;'. Also, just # in case, remove the line if NGINX_SUPPORT_MODULE_STUBS is unset. - if use !modules || [[ -z ${NGINX_SUPPORT_MODULE_STUBS} ]]; then + # + # If EAPI is 9, ignore the setting of NGINX_SUPPORT_MODULE_STUBS. + if use !modules || [[ ${EAPI} != 9 && -z ${NGINX_SUPPORT_MODULE_STUBS} ]]; then sed -i '/^@GENTOO_MODULES_INCLUDE@$/d' "${ED}"/etc/nginx/nginx.conf fi @@ -921,7 +930,8 @@ nginx_src_install() { includes = ${CATEGORY}/${PN} EOF - if [[ -n ${NGINX_SUPPORT_MODULE_STUBS} ]]; then + # Enable module stub support unconditionally on EAPI 9. + if [[ ${EAPI} = 9 || -n ${NGINX_SUPPORT_MODULE_STUBS} ]]; then keepdir /etc/nginx/modules-{available,enabled} sed -i 's|^@GENTOO_MODULES_INCLUDE@$|include modules-enabled/*.conf;|' \ -- 2.52.0
