summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas K. Hüttel <dilfridge@gentoo.org>2021-06-20 18:34:54 +0200
committerAndreas K. Hüttel <dilfridge@gentoo.org>2021-06-20 18:41:38 +0200
commitbecd7144dee2424a8747c438b3562a2b16f5d7d9 (patch)
tree24104286f3e4f47ad27e720304b92a75834e8862 /eclass/perl-module.eclass
parentdev-python/matplotlib: Enable py3.10 (diff)
downloadgentoo-becd7144dee2424a8747c438b3562a2b16f5d7d9.tar.gz
gentoo-becd7144dee2424a8747c438b3562a2b16f5d7d9.tar.bz2
gentoo-becd7144dee2424a8747c438b3562a2b16f5d7d9.zip
perl-module.eclass: add further test-related functionality
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Diffstat (limited to 'eclass/perl-module.eclass')
-rw-r--r--eclass/perl-module.eclass41
1 files changed, 39 insertions, 2 deletions
diff --git a/eclass/perl-module.eclass b/eclass/perl-module.eclass
index 6285e9363156..ec66990550c3 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"
@@ -130,6 +132,41 @@ case ${EAPI:-0} in
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
LICENSE="${LICENSE:-|| ( Artistic GPL-1+ )}"