summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/java-utils-2.eclass')
-rw-r--r--eclass/java-utils-2.eclass37
1 files changed, 10 insertions, 27 deletions
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index cef79405bf..1b7fcc295a 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -6,6 +6,7 @@
# java@gentoo.org
# @AUTHOR:
# Thomas Matthijs <axxo@gentoo.org>, Karl Trygve Kalleberg <karltk@gentoo.org>
+# @SUPPORTED_EAPIS: 5 6 7
# @BLURB: Base eclass for Java packages
# @DESCRIPTION:
# This eclass provides functionality which is used by java-pkg-2.eclass,
@@ -16,18 +17,23 @@
# that have optional Java support. In addition you can inherit java-ant-2 for
# Ant-based packages.
+case ${EAPI:-0} in
+ [567]) ;;
+ *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
+esac
+
+if [[ -z ${_JAVA_UTILS_2_ECLASS} ]] ; then
+_JAVA_UTILS_2_ECLASS=1
+
# EAPI 7 has version functions built-in. Use eapi7-ver for all earlier eclasses.
# Keep versionator inheritance in case consumers are using it implicitly.
-[[ ${EAPI} == [0123456] ]] && inherit eapi7-ver eutils multilib versionator
+[[ ${EAPI} == [56] ]] && inherit eapi7-ver eutils multilib versionator
IUSE="elibc_FreeBSD"
# Make sure we use java-config-2
export WANT_JAVA_CONFIG="2"
-# Prefix variables are only available for EAPI>=3
-has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
-
has test ${JAVA_PKG_IUSE} && RESTRICT+=" !test? ( test )"
# @VARIABLE: JAVA_PKG_E_DEPEND
@@ -975,10 +981,6 @@ java-pkg_jar-from() {
[[ -z ${target_pkg} ]] && die "Must specify a package"
- if [[ "${EAPI}" == "1" ]]; then
- target_pkg="${target_pkg//:/-}"
- fi
-
# default destjar to the target jar
[[ -z "${destjar}" ]] && destjar="${target_jar}"
@@ -1114,10 +1116,6 @@ java-pkg_getjars() {
local pkgs="${1}"
- if [[ "${EAPI}" == "1" ]]; then
- pkgs="${pkgs//:/-}"
- fi
-
jars="$(java-config ${deep} --classpath=${pkgs})"
[[ $? != 0 ]] && die "java-config --classpath=${pkgs} failed"
debug-print "${pkgs}:${jars}"
@@ -1183,10 +1181,6 @@ java-pkg_getjar() {
local pkg="${1}" target_jar="${2}" jar
- if [[ "${EAPI}" == "1" ]]; then
- pkg="${pkg//:/-}"
- fi
-
[[ -z ${pkg} ]] && die "Must specify package to get a jar from"
[[ -z ${target_jar} ]] && die "Must specify jar to get"
@@ -1272,10 +1266,6 @@ java-pkg_register-dependency() {
[[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) specified"
- if [[ "${EAPI}" == "1" ]]; then
- pkgs="${pkgs//:/-}"
- fi
-
if [[ -z "${jar}" ]]; then
for pkg in ${pkgs//,/ }; do
java-pkg_ensure-dep runtime "${pkg}"
@@ -1329,10 +1319,6 @@ java-pkg_register-optional-dependency() {
[[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) specified"
- if [[ "${EAPI}" == "1" ]]; then
- pkgs="${pkgs//:/-}"
- fi
-
if [[ -z "${jar}" ]]; then
for pkg in ${pkgs//,/ }; do
java-pkg_record-jar_ --optional "${pkg}"
@@ -2195,9 +2181,6 @@ java-pkg_init() {
# Don't set up build environment if installing from binary. #206024 #258423
[[ "${MERGE_TYPE}" == "binary" ]] && return
- # Also try Portage's nonstandard EMERGE_FROM for old EAPIs, if it doesn't
- # work nothing is lost.
- has ${EAPI:-0} 0 1 2 3 && [[ "${EMERGE_FROM}" == "binary" ]] && return
unset JAVAC
unset JAVA_HOME