summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenda Xu <heroxbd@gentoo.org>2017-02-09 13:45:57 +0900
committerBenda Xu <heroxbd@gentoo.org>2017-02-09 20:13:53 +0900
commit44a5a4e78358f35fb3a2442ed0145abbe058a9d4 (patch)
tree4cf3c4c126fb8683c1d3886dfa55ddac525f98e0 /eclass/java-utils-2.eclass
parentsys-kernel/vanilla-sources: Automated version bump to {4.4.48,4.9.9} - remove... (diff)
downloadgentoo-44a5a4e78358f35fb3a2442ed0145abbe058a9d4.tar.gz
gentoo-44a5a4e78358f35fb3a2442ed0145abbe058a9d4.tar.bz2
gentoo-44a5a4e78358f35fb3a2442ed0145abbe058a9d4.zip
eclass/java-utils-2.eclass: support Prefix.
Reintroduce fbdddd87ff9 with EAPI gatekeeping code. Credit: Martin Mokrejš Bug: 595002
Diffstat (limited to 'eclass/java-utils-2.eclass')
-rw-r--r--eclass/java-utils-2.eclass21
1 files changed, 12 insertions, 9 deletions
diff --git a/eclass/java-utils-2.eclass b/eclass/java-utils-2.eclass
index ee4c31991407..c6132199f098 100644
--- a/eclass/java-utils-2.eclass
+++ b/eclass/java-utils-2.eclass
@@ -1,4 +1,4 @@
-# Copyright 2004-2015 Gentoo Foundation
+# Copyright 2004-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$
@@ -23,6 +23,9 @@ IUSE="elibc_FreeBSD"
# Make sure we use java-config-2
export WANT_JAVA_CONFIG="2"
+# Prefix variables is only available for EAPI>=3
+!use prefix && has "${EAPI:-0}" 0 1 2 && ED="${D}" EPREFIX= EROOT="${ROOT}"
+
# @VARIABLE: JAVA_PKG_PORTAGE_DEP
# @INTERNAL
# @DESCRIPTION:
@@ -338,7 +341,7 @@ java-pkg_dojar() {
if [[ -e "${jar}" ]] ; then
# Don't overwrite if jar has already been installed with the same
# name
- local dest="${D}${JAVA_PKG_JARDEST}/${jar_basename}"
+ local dest="${ED}${JAVA_PKG_JARDEST}/${jar_basename}"
if [[ -e "${dest}" ]]; then
ewarn "Overwriting ${dest}"
fi
@@ -352,13 +355,13 @@ java-pkg_dojar() {
insinto "${JAVA_PKG_JARDEST}"
doins "${jar}"
) || die "failed to install ${jar}"
- java-pkg_append_ JAVA_PKG_CLASSPATH "${JAVA_PKG_JARDEST}/${jar_basename}"
- debug-print "installed ${jar} to ${D}${JAVA_PKG_JARDEST}"
+ java-pkg_append_ JAVA_PKG_CLASSPATH "${EPREFIX}/${JAVA_PKG_JARDEST}/${jar_basename}"
+ debug-print "installed ${jar} to ${ED}${JAVA_PKG_JARDEST}"
# make a symlink to the original jar if it's symlink
else
# TODO use dosym, once we find something that could use it
# -nichoj
- ln -s "$(readlink "${jar}")" "${D}${JAVA_PKG_JARDEST}/${jar_basename}"
+ ln -s "$(readlink "${jar}")" "${ED}${JAVA_PKG_JARDEST}/${jar_basename}"
debug-print "${jar} is a symlink, linking accordingly"
fi
else
@@ -828,7 +831,7 @@ java-pkg_dolauncher() {
echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}"
cat "${var_tmp}" >> "${target}"
rm -f "${var_tmp}"
- echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
+ echo "source ${EPREFIX}/usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
if [[ -n "${target_dir}" ]]; then
(
@@ -1745,7 +1748,7 @@ java-pkg_register-ant-task() {
local TASK_NAME="${1:-${JAVA_PKG_NAME}}"
dodir /usr/share/ant/${TASKS_DIR}
- touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
+ touch "${ED}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
}
# @FUNCTION: java-pkg_ant-tasks-depend
@@ -2339,9 +2342,9 @@ java-pkg_init_paths_() {
JAVA_PKG_SHAREPATH="/usr/share/${JAVA_PKG_NAME}"
JAVA_PKG_SOURCESPATH="${JAVA_PKG_SHAREPATH}/sources/"
- JAVA_PKG_ENV="${D}${JAVA_PKG_SHAREPATH}/package.env"
+ JAVA_PKG_ENV="${ED}${JAVA_PKG_SHAREPATH}/package.env"
JAVA_PKG_VIRTUALS_PATH="/usr/share/java-config-2/virtuals"
- JAVA_PKG_VIRTUAL_PROVIDER="${D}/${JAVA_PKG_VIRTUALS_PATH}/${JAVA_PKG_NAME}"
+ JAVA_PKG_VIRTUAL_PROVIDER="${ED}${JAVA_PKG_VIRTUALS_PATH}/${JAVA_PKG_NAME}"
[[ -z "${JAVA_PKG_JARDEST}" ]] && JAVA_PKG_JARDEST="${JAVA_PKG_SHAREPATH}/lib"
[[ -z "${JAVA_PKG_LIBDEST}" ]] && JAVA_PKG_LIBDEST="/usr/$(get_libdir)/${JAVA_PKG_NAME}"