perl-module.eclass: Allow EAPI=6, ban PERL_EXPORT_PHASE_FUNCTIONS, GENTOO_DEPEND_ON_P...
authorAndreas K. Huettel (dilfridge) <dilfridge@gentoo.org>
Sat, 28 Nov 2015 21:15:52 +0000 (22:15 +0100)
committerAndreas K. Hüttel <dilfridge@gentoo.org>
Sat, 19 Dec 2015 13:17:07 +0000 (14:17 +0100)
eclass/perl-module.eclass

index 0ef8d3d1e73a5c319d116a28b791d09b93cd4d51..f380730d871c3834a43dc1e22800a0ec347875f7 100644 (file)
@@ -37,21 +37,48 @@ case "${EAPI:-0}" in
                        RDEPEND="${DEPEND}"
                        ;;
                esac
+
+               case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
+                       yes)
+                               EXPORT_FUNCTIONS ${PERL_EXPF}
+                               ;;
+                       no)
+                               debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
+                               ;;
+                       *)
+                               die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass"
+                               ;;
+               esac
                ;;
-       *)
-               die "EAPI=${EAPI} is not supported by perl-module.eclass"
-               ;;
-esac
+       6)
+               [[ ${CATEGORY} == "perl-core" ]] && \
+                       PERL_EXPF+=" pkg_postinst pkg_postrm"
+
+               case "${GENTOO_DEPEND_ON_PERL:-yes}" in
+                       yes)
+                               DEPEND="dev-lang/perl:="
+                               RDEPEND="dev-lang/perl:="
+                               ;;
+                       noslotop)
+                               DEPEND="dev-lang/perl"
+                               RDEPEND="dev-lang/perl"
+                               ;;
+               esac
+
+               if [[ "${GENTOO_DEPEND_ON_PERL_SUBSLOT}" ]]; then
+                       eerror "GENTOO_DEPEND_ON_PERL_SUBSLOT is banned in EAPI=6. If you don't want a slot operator"
+                       die    "set GENTOO_DEPEND_ON_PERL=noslotop instead."
+               fi
+
+               if [[ "${PERL_EXPORT_PHASE_FUNCTIONS}" ]]; then
+                       eerror "PERL_EXPORT_PHASE_FUNCTIONS is banned in EAPI=6. Use perl-module.eclass if you need"
+                       die    "phase functions, perl-functions.eclass if not."
+               fi
 
-case "${PERL_EXPORT_PHASE_FUNCTIONS:-yes}" in
-       yes)
                EXPORT_FUNCTIONS ${PERL_EXPF}
                ;;
-       no)
-               debug-print "PERL_EXPORT_PHASE_FUNCTIONS=no"
-               ;;
        *)
-               die "PERL_EXPORT_PHASE_FUNCTIONS=${PERL_EXPORT_PHASE_FUNCTIONS} is not supported by perl-module.eclass"
+               die "EAPI=${EAPI} is not supported by perl-module.eclass"
                ;;
 esac