commit:     becd7144dee2424a8747c438b3562a2b16f5d7d9
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 20 16:34:54 2021 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sun Jun 20 16:41:38 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=becd7144

perl-module.eclass: add further test-related functionality

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 eclass/perl-module.eclass | 41 +++++++++++++++++++++++++++++++++++++++--
 1 file changed, 39 insertions(+), 2 deletions(-)

diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index 6285e936315..ec66990550c 100644
--- a/eclass/perl-module.eclass
+++ b/eclass/perl-module.eclass
@@ -43,7 +43,9 @@ esac
 # dev-lang/perl is automatically added by the eclass. It defaults to yes.
 # Set to no to disable, set to noslotop to add a perl dependency without
 # slot operator (EAPI=6). All packages installing into the vendor_perl
-# path must use yes here.
+# path must use yes here. (EAPI=8 and later) Also adds a test useflag,
+# a use-conditional build time dependency on virtual/perl-Test-Simple, and
+# the required RESTRICT setting.
 
 case ${EAPI:-0} in
        5)
@@ -103,7 +105,7 @@ case ${EAPI:-0} in
 
                EXPORT_FUNCTIONS ${PERL_EXPF}
                ;;
-       *)
+       7)
                [[ ${CATEGORY} == perl-core ]] && \
                        PERL_EXPF+=" pkg_postinst pkg_postrm"
 
@@ -128,6 +130,41 @@ case ${EAPI:-0} in
                        die "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6 
and later."
                fi
 
+               EXPORT_FUNCTIONS ${PERL_EXPF}
+               ;;
+       *)
+               [[ ${CATEGORY} == perl-core ]] && \
+                       PERL_EXPF+=" pkg_postinst pkg_postrm"
+
+               case "${GENTOO_DEPEND_ON_PERL:-yes}" in
+                       yes)
+                               DEPEND="dev-lang/perl"
+                               BDEPEND="dev-lang/perl
+                                        test? ( virtual/perl-Test-Simple )"
+                               RDEPEND="dev-lang/perl:="
+                               IUSE="test"
+                               # RESTRICT="!test? ( test )"
+                               # not handled correctly in portage yet
+                               ;;
+                       noslotop)
+                               DEPEND="dev-lang/perl"
+                               BDEPEND="dev-lang/perl
+                                        test? ( virtual/perl-Test-Simple )"
+                               RDEPEND="dev-lang/perl"
+                               IUSE="test"
+                               # RESTRICT="!test? ( test )"
+                               # not handled correctly in portage yet
+                               ;;
+               esac
+
+               if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT:-yes}" != "yes" ]]; then
+                       die "GENTOO_DEPEND_ON_PERL_SUBSLOT=no is banned in 
EAPI=6 and later."
+               fi
+
+               if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
+                       die "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6 
and later."
+               fi
+
                EXPORT_FUNCTIONS ${PERL_EXPF}
                ;;
 esac

Reply via email to