/[gentoo-x86]/eclass/java-utils-2.eclass
Gentoo

Diff of /eclass/java-utils-2.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.93 Revision 1.124
4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org> 4# Copyright (c) 2004, Karl Trygve Kalleberg <karltk@gentoo.org>
5# Copyright (c) 2004-2005, Gentoo Foundation 5# Copyright (c) 2004-2005, Gentoo Foundation
6# 6#
7# Licensed under the GNU General Public License, v2 7# Licensed under the GNU General Public License, v2
8# 8#
9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.93 2007/09/27 19:47:08 betelgeuse Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.124 2009/03/27 19:40:38 betelgeuse Exp $
10 10
11# ----------------------------------------------------------------------------- 11# -----------------------------------------------------------------------------
12# @eclass-begin 12# @eclass-begin
13# @eclass-shortdesc Java Utility eclass 13# @eclass-shortdesc Java Utility eclass
14# @eclass-maintainer java@gentoo.org 14# @eclass-maintainer java@gentoo.org
59# ----------------------------------------------------------------------------- 59# -----------------------------------------------------------------------------
60# @variable-internal JAVA_PKG_PORTAGE_DEP 60# @variable-internal JAVA_PKG_PORTAGE_DEP
61# 61#
62# The version of portage we need to function properly. Previously it was 62# The version of portage we need to function properly. Previously it was
63# portage with phase hooks support but now we use a version with proper env 63# portage with phase hooks support but now we use a version with proper env
64# saving. 64# saving. For EAPI 2 we have new enough stuff so let's have cleaner deps.
65# ----------------------------------------------------------------------------- 65# -----------------------------------------------------------------------------
66JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1.2.7" 66hasq "${EAPI}" 0 1 && JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1.2.7"
67 67
68# ----------------------------------------------------------------------------- 68# -----------------------------------------------------------------------------
69# @variable-internal JAVA_PKG_E_DEPEND 69# @variable-internal JAVA_PKG_E_DEPEND
70# 70#
71# This is a convience variable to be used from the other java eclasses. This is 71# This is a convience variable to be used from the other java eclasses. This is
72# the version of java-config we want to use. Usually the latest stable version 72# the version of java-config we want to use. Usually the latest stable version
73# so that ebuilds can use new features without depending on specific versions. 73# so that ebuilds can use new features without depending on specific versions.
74# ----------------------------------------------------------------------------- 74# -----------------------------------------------------------------------------
75JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.0.33-r1 ${JAVA_PKG_PORTAGE_DEP}" 75JAVA_PKG_E_DEPEND=">=dev-java/java-config-2.1.6 ${JAVA_PKG_PORTAGE_DEP}"
76hasq source ${JAVA_PKG_IUSE} && JAVA_PKG_E_DEPEND="${JAVA_PKG_E_DEPEND} source? ( app-arch/zip )"
76 77
77# ----------------------------------------------------------------------------- 78# -----------------------------------------------------------------------------
78# @variable-external JAVA_PKG_ALLOW_VM_CHANGE 79# @variable-external JAVA_PKG_ALLOW_VM_CHANGE
79# @variable-default yes 80# @variable-default yes
80# 81#
290 done 291 done
291 292
292 java-pkg_do_write_ 293 java-pkg_do_write_
293} 294}
294 295
295
296# ------------------------------------------------------------------------------ 296# ------------------------------------------------------------------------------
297# @internal-function depend-java-query 297# @internal-function depend-java-query
298# 298#
299# Wrapper for the depend-java-query binary to enable passing USE in env. 299# Wrapper for the depend-java-query binary to enable passing USE in env.
300# Using env variables keeps this eclass working with java-config versions that 300# Using env variables keeps this eclass working with java-config versions that
445 if [[ -e "${lib}" ]] ; then 445 if [[ -e "${lib}" ]] ; then
446 # install if it isn't a symlink 446 # install if it isn't a symlink
447 if [[ ! -L "${lib}" ]] ; then 447 if [[ ! -L "${lib}" ]] ; then
448 INSDESTTREE="${JAVA_PKG_LIBDEST}" \ 448 INSDESTTREE="${JAVA_PKG_LIBDEST}" \
449 INSOPTIONS="${LIBOPTIONS}" \ 449 INSOPTIONS="${LIBOPTIONS}" \
450 doins "${lib}" || "failed to install ${lib}" 450 doins "${lib}" || die "failed to install ${lib}"
451 java-pkg_append_ JAVA_PKG_LIBRARY "${JAVA_PKG_LIBDEST}" 451 java-pkg_append_ JAVA_PKG_LIBRARY "${JAVA_PKG_LIBDEST}"
452 debug-print "Installing ${lib} to ${JAVA_PKG_LIBDEST}" 452 debug-print "Installing ${lib} to ${JAVA_PKG_LIBDEST}"
453 # otherwise make a symlink to the symlink's origin 453 # otherwise make a symlink to the symlink's origin
454 else 454 else
455 # TODO use dosym 455 # TODO use dosym
556# ------------------------------------------------------------------------------ 556# ------------------------------------------------------------------------------
557# @ebuild-function java-pkg_dojavadoc 557# @ebuild-function java-pkg_dojavadoc
558# 558#
559# Installs javadoc documentation. This should be controlled by the doc use flag. 559# Installs javadoc documentation. This should be controlled by the doc use flag.
560# 560#
561# @param $1: optional --symlink creates to symlink like this for html
562# documentation bundles.
561# @param $1: - The javadoc root directory. 563# @param $2: - The javadoc root directory.
562# 564#
563# @example: 565# @example:
564# java-pkg_dojavadoc docs/api 566# java-pkg_dojavadoc docs/api
567# java-pkg_dojavadoc --symlink apidocs docs/api
565# 568#
566# ------------------------------------------------------------------------------ 569# ------------------------------------------------------------------------------
567java-pkg_dojavadoc() { 570java-pkg_dojavadoc() {
568 debug-print-function ${FUNCNAME} $* 571 debug-print-function ${FUNCNAME} $*
572
573 # For html documentation bundles that link to Javadoc
574 local symlink
575 if [[ ${1} = --symlink ]]; then
576 symlink=${2}
577 shift 2
578 fi
579
569 local dir="$1" 580 local dir="$1"
581 local dest=/usr/share/doc/${PF}/html
570 582
571 # QA checks 583 # QA checks
572 584
573 java-pkg_check-phase install 585 java-pkg_check-phase install
574 586
578 local msg="No index.html in javadoc directory" 590 local msg="No index.html in javadoc directory"
579 ewarn "${msg}" 591 ewarn "${msg}"
580 is-java-strict && die "${msg}" 592 is-java-strict && die "${msg}"
581 fi 593 fi
582 594
595 if [[ -e ${D}/${dest}/api ]]; then
596 eerror "${dest} already exists. Will not overwrite."
597 die "${dest}"
598 fi
599
583 # Renaming to match our directory layout 600 # Renaming to match our directory layout
584 601
585 local dir_to_install="${dir}" 602 local dir_to_install="${dir}"
586 if [[ "$(basename "${dir}")" != "api" ]]; then 603 if [[ "$(basename "${dir}")" != "api" ]]; then
587 dir_to_install="${T}/api" 604 dir_to_install="${T}/api"
589 cp -r "${dir}" "${dir_to_install}" || die "cp failed" 606 cp -r "${dir}" "${dir_to_install}" || die "cp failed"
590 fi 607 fi
591 608
592 # Actual installation 609 # Actual installation
593 610
594 java-pkg_dohtml -r ${dir_to_install} 611 java-pkg_dohtml -r "${dir_to_install}"
612
613 # Let's make a symlink to the directory we have everything else under
614 dosym ${dest}/api "${JAVA_PKG_SHAREPATH}/api" || die
615
616 if [[ ${symlink} ]]; then
617 debug-print "symlinking ${dest}/{api,${symlink}}"
618 dosym ${dest}/{api,${symlink}} || die
619 fi
595} 620}
596 621
597# ------------------------------------------------------------------------------ 622# ------------------------------------------------------------------------------
598# @ebuild-function java-pkg_dosrc 623# @ebuild-function java-pkg_dosrc
599# 624#
622 647
623 [[ ${#} -lt 1 ]] && die "At least one argument needed" 648 [[ ${#} -lt 1 ]] && die "At least one argument needed"
624 649
625 if ! [[ ${DEPEND} = *app-arch/zip* ]]; then 650 if ! [[ ${DEPEND} = *app-arch/zip* ]]; then
626 local msg="${FUNCNAME} called without app-arch/zip in DEPEND" 651 local msg="${FUNCNAME} called without app-arch/zip in DEPEND"
627 if is-java-strict; then 652 java-pkg_announce-qa-violation ${msg}
628 eerror "${msg}"
629 die "${msg}"
630 else
631 echo "${msg}"
632 echo "Please report this to http://bugs.gentoo.org."
633 fi
634 fi 653 fi
635 654
636 java-pkg_init_paths_ 655 java-pkg_init_paths_
637 656
638 local zip_name="${PN}-src.zip" 657 local zip_name="${PN}-src.zip"
838# @param $opt 857# @param $opt
839# --build-only - makes the jar(s) not added into package.env DEPEND line. 858# --build-only - makes the jar(s) not added into package.env DEPEND line.
840# (assumed automatically when called inside src_test) 859# (assumed automatically when called inside src_test)
841# --with-dependencies - get jars also from requested package's dependencies 860# --with-dependencies - get jars also from requested package's dependencies
842# transitively. 861# transitively.
862# --virtual - Packages passed to this function are to be handled as virtuals
863# and will not have individual jar dependencies recorded.
843# --into $dir - symlink jar(s) into $dir (must exist) instead of . 864# --into $dir - symlink jar(s) into $dir (must exist) instead of .
844# @param $1 - Package to get jars from, or comma-separated list of packages in 865# @param $1 - Package to get jars from, or comma-separated list of packages in
845# case other parameters are not used. 866# case other parameters are not used.
846# @param $2 - jar from package. If not specified, all jars will be used. 867# @param $2 - jar from package. If not specified, all jars will be used.
847# @param $3 - When a single jar is specified, destination filename of the 868# @param $3 - When a single jar is specified, destination filename of the
852 debug-print-function ${FUNCNAME} $* 873 debug-print-function ${FUNCNAME} $*
853 874
854 local build_only="" 875 local build_only=""
855 local destdir="." 876 local destdir="."
856 local deep="" 877 local deep=""
878 local virtual=""
857 879
858 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build" 880 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build"
859 881
860 while [[ "${1}" == --* ]]; do 882 while [[ "${1}" == --* ]]; do
861 if [[ "${1}" = "--build-only" ]]; then 883 if [[ "${1}" = "--build-only" ]]; then
862 build_only="build" 884 build_only="build"
863 elif [[ "${1}" = "--with-dependencies" ]]; then 885 elif [[ "${1}" = "--with-dependencies" ]]; then
864 deep="--with-dependencies" 886 deep="--with-dependencies"
887 elif [[ "${1}" = "--virtual" ]]; then
888 virtual="true"
865 elif [[ "${1}" = "--into" ]]; then 889 elif [[ "${1}" = "--into" ]]; then
866 destdir="${2}" 890 destdir="${2}"
867 shift 891 shift
868 else 892 else
869 die "java-pkg_jar-from called with unknown parameter: ${1}" 893 die "java-pkg_jar-from called with unknown parameter: ${1}"
872 done 896 done
873 897
874 local target_pkg="${1}" target_jar="${2}" destjar="${3}" 898 local target_pkg="${1}" target_jar="${2}" destjar="${3}"
875 899
876 [[ -z ${target_pkg} ]] && die "Must specify a package" 900 [[ -z ${target_pkg} ]] && die "Must specify a package"
901
902 if [[ "${EAPI}" == "1" ]]; then
903 target_pkg="${target_pkg//:/-}"
904 fi
877 905
878 # default destjar to the target jar 906 # default destjar to the target jar
879 [[ -z "${destjar}" ]] && destjar="${target_jar}" 907 [[ -z "${destjar}" ]] && destjar="${target_jar}"
880 908
881 local error_msg="There was a problem getting the classpath for ${target_pkg}." 909 local error_msg="There was a problem getting the classpath for ${target_pkg}."
893 done 921 done
894 # setting this disables further record-jar_ calls later 922 # setting this disables further record-jar_ calls later
895 build_only="build" 923 build_only="build"
896 else 924 else
897 java-pkg_ensure-dep "${build_only}" "${target_pkg}" 925 java-pkg_ensure-dep "${build_only}" "${target_pkg}"
926 fi
927
928 # Record the entire virtual as a dependency so that
929 # no jars are missed.
930 if [[ -z "${build_only}" && -n "${virtual}" ]]; then
931 java-pkg_record-jar_ "${target_pkg}"
932 # setting this disables further record-jars_ calls later
933 build_only="build"
898 fi 934 fi
899 935
900 pushd ${destdir} > /dev/null \ 936 pushd ${destdir} > /dev/null \
901 || die "failed to change directory to ${destdir}" 937 || die "failed to change directory to ${destdir}"
902 938
985 done 1021 done
986 1022
987 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*" 1023 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*"
988 1024
989 1025
990 local classpath pkgs="${1}" 1026 local pkgs="${1}"
1027
1028 if [[ "${EAPI}" == "1" ]]; then
1029 pkgs="${pkgs//:/-}"
1030 fi
1031
991 jars="$(java-config ${deep} --classpath=${pkgs})" 1032 jars="$(java-config ${deep} --classpath=${pkgs})"
992 [[ $? != 0 || -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed" 1033 [[ $? != 0 ]] && die "java-config --classpath=${pkgs} failed"
993 debug-print "${pkgs}:${jars}" 1034 debug-print "${pkgs}:${jars}"
994 1035
995 for pkg in ${pkgs//,/ }; do 1036 for pkg in ${pkgs//,/ }; do
996 java-pkg_ensure-dep "${build_only}" "${pkg}" 1037 java-pkg_ensure-dep "${build_only}" "${pkg}"
997 done 1038 done
998
999 if [[ -z "${classpath}" ]]; then
1000 classpath="${jars}"
1001 else
1002 classpath="${classpath}:${jars}"
1003 fi
1004 1039
1005 # Only record jars that aren't build-only 1040 # Only record jars that aren't build-only
1006 if [[ -z "${build_only}" ]]; then 1041 if [[ -z "${build_only}" ]]; then
1007 for pkg in ${pkgs//,/ }; do 1042 for pkg in ${pkgs//,/ }; do
1008 java-pkg_record-jar_ "${pkg}" 1043 java-pkg_record-jar_ "${pkg}"
1009 done 1044 done
1010 fi 1045 fi
1011 1046
1012 echo "${classpath}" 1047 echo "${jars}"
1013} 1048}
1014 1049
1015# ------------------------------------------------------------------------------ 1050# ------------------------------------------------------------------------------
1016# @ebuild-function java-pkg_getjar 1051# @ebuild-function java-pkg_getjar
1017# 1052#
1026# @example-return 1061# @example-return
1027# /usr/share/xerces-2/lib/xml-apis.jar 1062# /usr/share/xerces-2/lib/xml-apis.jar
1028# 1063#
1029# @param $opt 1064# @param $opt
1030# --build-only - makes the jar not added into package.env DEPEND line. 1065# --build-only - makes the jar not added into package.env DEPEND line.
1066# --virtual - Packages passed to this function are to be handled as virtuals
1067# and will not have individual jar dependencies recorded.
1031# @param $1 - package to use 1068# @param $1 - package to use
1032# @param $2 - jar to get 1069# @param $2 - jar to get
1033# ------------------------------------------------------------------------------ 1070# ------------------------------------------------------------------------------
1034java-pkg_getjar() { 1071java-pkg_getjar() {
1035 debug-print-function ${FUNCNAME} $* 1072 debug-print-function ${FUNCNAME} $*
1036 1073
1037 local build_only="" 1074 local build_only=""
1075 local virtual=""
1038 1076
1039 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build" 1077 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build"
1040 1078
1041 while [[ "${1}" == --* ]]; do 1079 while [[ "${1}" == --* ]]; do
1042 if [[ "${1}" = "--build-only" ]]; then 1080 if [[ "${1}" = "--build-only" ]]; then
1043 build_only="build" 1081 build_only="build"
1082 elif [[ "${1}" == "--virtual" ]]; then
1083 virtual="true"
1044 else 1084 else
1045 die "java-pkg_jar-from called with unknown parameter: ${1}" 1085 die "java-pkg_getjar called with unknown parameter: ${1}"
1046 fi 1086 fi
1047 shift 1087 shift
1048 done 1088 done
1049 1089
1050 [[ ${#} -ne 2 ]] && die "${FUNCNAME} takes only two arguments besides --*" 1090 [[ ${#} -ne 2 ]] && die "${FUNCNAME} takes only two arguments besides --*"
1051 1091
1052 local pkg="${1}" target_jar="${2}" jar 1092 local pkg="${1}" target_jar="${2}" jar
1093
1094 if [[ "${EAPI}" == "1" ]]; then
1095 pkg="${pkg//:/-}"
1096 fi
1097
1053 [[ -z ${pkg} ]] && die "Must specify package to get a jar from" 1098 [[ -z ${pkg} ]] && die "Must specify package to get a jar from"
1054 [[ -z ${target_jar} ]] && die "Must specify jar to get" 1099 [[ -z ${target_jar} ]] && die "Must specify jar to get"
1055 1100
1056 local error_msg="Could not find classpath for ${pkg}. Are you sure its installed?" 1101 local error_msg="Could not find classpath for ${pkg}. Are you sure its installed?"
1057 local classpath 1102 local classpath
1058 classpath=$(java-config --classpath=${pkg}) 1103 classpath=$(java-config --classpath=${pkg})
1059 [[ $? != 0 ]] && die ${error_msg} 1104 [[ $? != 0 ]] && die ${error_msg}
1060 1105
1061 java-pkg_ensure-dep "${build_only}" "${pkg}" 1106 java-pkg_ensure-dep "${build_only}" "${pkg}"
1107
1108 # Record the package(Virtual) as a dependency and then set build_only
1109 # So that individual jars are not recorded.
1110 if [[ -n "${virtual}" ]]; then
1111 java-pkg_record-jar_ "${pkg}"
1112 build_only="true"
1113 fi
1062 1114
1063 for jar in ${classpath//:/ }; do 1115 for jar in ${classpath//:/ }; do
1064 if [[ ! -f "${jar}" ]] ; then 1116 if [[ ! -f "${jar}" ]] ; then
1065 die "Installation problem with jar ${jar} in ${pkg} - is it installed?" 1117 die "Installation problem with jar ${jar} in ${pkg} - is it installed?"
1066 fi 1118 fi
1111 1163
1112 local pkgs="${1}" 1164 local pkgs="${1}"
1113 local jar="${2}" 1165 local jar="${2}"
1114 1166
1115 [[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) specified" 1167 [[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) specified"
1168
1169 if [[ "${EAPI}" == "1" ]]; then
1170 pkgs="${pkgs//:/-}"
1171 fi
1116 1172
1117 if [[ -z "${jar}" ]]; then 1173 if [[ -z "${jar}" ]]; then
1118 for pkg in ${pkgs//,/ }; do 1174 for pkg in ${pkgs//,/ }; do
1119 java-pkg_ensure-dep runtime "${pkg}" 1175 java-pkg_ensure-dep runtime "${pkg}"
1120 java-pkg_record-jar_ "${pkg}" 1176 java-pkg_record-jar_ "${pkg}"
1162 1218
1163 local pkgs="${1}" 1219 local pkgs="${1}"
1164 local jar="${2}" 1220 local jar="${2}"
1165 1221
1166 [[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) specified" 1222 [[ -z "${pkgs}" ]] && die "${FUNCNAME} called with no package(s) specified"
1223
1224 if [[ "${EAPI}" == "1" ]]; then
1225 pkgs="${pkgs//:/-}"
1226 fi
1167 1227
1168 if [[ -z "${jar}" ]]; then 1228 if [[ -z "${jar}" ]]; then
1169 for pkg in ${pkgs//,/ }; do 1229 for pkg in ${pkgs//,/ }; do
1170 java-pkg_record-jar_ --optional "${pkg}" 1230 java-pkg_record-jar_ --optional "${pkg}"
1171 done 1231 done
1672 dodir /usr/share/ant/${TASKS_DIR} 1732 dodir /usr/share/ant/${TASKS_DIR}
1673 touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}" 1733 touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
1674} 1734}
1675 1735
1676# ------------------------------------------------------------------------------ 1736# ------------------------------------------------------------------------------
1677# @internal-function java-pkg_ant-tasks-from-deps
1678#
1679# Function to determine ANT_TASKS from DEPEND variable for backwards
1680# compatibility with ebuilds that don't set ANT_TASKS before calling eant() or
1681# WANT_ANT_TASKS before inheriting java-pkg-2. If the DEPEND string contains
1682# "dev-java/ant" or "dev-java/ant-tasks", then it returns "all", otherwise
1683# "none". It's not smart enough to cope with USE flag depends but that shouldn't
1684# be a problem, the worst it can do is activace all tasks when not needed.
1685# Note that this is called only with JAVA_PKG_STRICT=1, to find ebuilds with
1686# insufficient dependencies, otherwise all available tasks are used for
1687# backwards compatilbility.
1688#
1689# @return "all" or "none"
1690# ------------------------------------------------------------------------------
1691java-pkg_ant-tasks-from-deps() {
1692 local found_ant found_ant_tasks
1693
1694 for dep in ${DEPEND}
1695 do
1696 local ant="$(awk '/(dev-java\/ant)/ { if (match($1, "(dev-java/ant)((-[0-9])+|$)", m)) print m[1] }' <<< ${dep})"
1697 [[ "${ant}" == "dev-java/ant" ]] && found_ant=true
1698 [[ "${dep}" == *"ant-tasks"* ]] && found_ant_tasks=true
1699 done
1700
1701 if [[ -n "${found_ant}" || -n "${found_ant_tasks}" ]]; then
1702 java-pkg_announce-qa-violation --nodie "The ebuild DEPENDS on deprecated ant or ant-tasks"
1703 echo "all"
1704 else
1705 # ebuild doesn't set ANT_TASKS and doesn't depend on ant-tasks or ant
1706 # so we deactivate all tasks that may be installed
1707 echo "none"
1708 fi
1709}
1710
1711# ------------------------------------------------------------------------------
1712# @internal-function java-pkg_ant-tasks-depend 1737# @internal-function java-pkg_ant-tasks-depend
1713# 1738#
1714# Translates the WANT_ANT_TASKS variable into valid dependencies. 1739# Translates the WANT_ANT_TASKS variable into valid dependencies.
1715# ------------------------------------------------------------------------------ 1740# ------------------------------------------------------------------------------
1716java-pkg_ant-tasks-depend() { 1741java-pkg_ant-tasks-depend() {
1718 1743
1719 if [[ -n "${WANT_ANT_TASKS}" ]]; then 1744 if [[ -n "${WANT_ANT_TASKS}" ]]; then
1720 local DEP="" 1745 local DEP=""
1721 for i in ${WANT_ANT_TASKS} 1746 for i in ${WANT_ANT_TASKS}
1722 do 1747 do
1723 if [[ ${i} != ant-* ]]; then 1748 if [[ ${i} = ant-* ]]; then
1749 DEP="${DEP}dev-java/${i} "
1750 elif [[ ${i} = */*:* ]]; then
1751 DEP="${DEP}${i} "
1752 else
1724 echo "Invalid atom in WANT_ANT_TASKS: ${i}" 1753 echo "Invalid atom in WANT_ANT_TASKS: ${i}"
1725 return 1 1754 return 1
1726 fi 1755 fi
1727 DEP="${DEP}dev-java/${i} "
1728 done 1756 done
1729 echo ${DEP} 1757 echo ${DEP}
1730 return 0 1758 return 0
1731 else 1759 else
1732 return 0 1760 return 0
1749# ------------------------------------------------------------------------------ 1777# ------------------------------------------------------------------------------
1750ejunit() { 1778ejunit() {
1751 debug-print-function ${FUNCNAME} $* 1779 debug-print-function ${FUNCNAME} $*
1752 1780
1753 local pkgs 1781 local pkgs
1782 if [[ -f ${JAVA_PKG_DEPEND_FILE} ]]; then
1754 for atom in $(cat ${JAVA_PKG_DEPEND_FILE} | tr : ' '); do 1783 for atom in $(cat ${JAVA_PKG_DEPEND_FILE} | tr : ' '); do
1755 pkgs=${pkgs},$(echo ${atom} | sed -re "s/^.*@//") 1784 pkgs=${pkgs},$(echo ${atom} | sed -re "s/^.*@//")
1756 done 1785 done
1786 fi
1757 1787
1758 local cp=$(java-pkg_getjars --with-dependencies junit${pkgs}) 1788 local cp=$(java-pkg_getjars --with-dependencies junit${pkgs})
1759 if [[ ${1} = -cp || ${1} = -classpath ]]; then 1789 if [[ ${1} = -cp || ${1} = -classpath ]]; then
1760 cp="${2}:${cp}" 1790 cp="${2}:${cp}"
1761 shift 2 1791 shift 2
1771# ------------------------------------------------------------------------------ 1801# ------------------------------------------------------------------------------
1772# @section-end helper 1802# @section-end helper
1773# ------------------------------------------------------------------------------ 1803# ------------------------------------------------------------------------------
1774 1804
1775# ------------------------------------------------------------------------------ 1805# ------------------------------------------------------------------------------
1806# @eclass-src_prepare
1807#
1808# src_prepare Searches for bundled jars
1809# Don't call directly, but via java-pkg-2_src_prepare!
1810# ------------------------------------------------------------------------------
1811
1812java-utils-2_src_prepare() {
1813 # Remember that eant will call this unless called via Portage
1814 if [[ ! -e "${T}/java-utils-2_src_prepare-run" ]] && is-java-strict; then
1815 echo "Searching for bundled jars:"
1816 java-pkg_find-normal-jars || echo "None found."
1817 echo "Searching for bundled classes (no output if none found):"
1818 find "${WORKDIR}" -name "*.class"
1819 echo "Search done."
1820 java-pkg_func-exists "java_prepare" && java_prepare
1821 fi
1822 touch "${T}/java-utils-2_src_prepare-run"
1823}
1824
1825# ------------------------------------------------------------------------------
1826# @eclass-pkg_preinst
1827#
1828# pkg_preinst Searches for missing and unneeded dependencies
1829# Don't call directly, but via java-pkg-2_pkg_preinst!
1830# ------------------------------------------------------------------------------
1831
1832java-utils-2_pkg_preinst() {
1833 if is-java-strict; then
1834 if has_version dev-java/java-dep-check; then
1835 [[ -e "${JAVA_PKG_ENV}" ]] || return
1836 local output=$(GENTOO_VM= java-dep-check --image "${D}" "${JAVA_PKG_ENV}")
1837 if [[ ${output} && has_version <=dev-java/java-dep-check-0.2 ]]; then
1838 ewarn "Possibly unneeded dependencies found in package.env:"
1839 for dep in ${output}; do
1840 ewarn "\t${dep}"
1841 done
1842 fi
1843 if [[ ${output} && has_version >dev-java/java-dep-check-0.2 ]]; then
1844 ewarn "${output}"
1845 fi
1846 else
1847 eerror "Install dev-java/java-dep-check for dependency checking"
1848 fi
1849 fi
1850}
1851
1852# ------------------------------------------------------------------------------
1776# @section-begin build 1853# @section-begin build
1777# @section-summary Build functions 1854# @section-summary Build functions
1778# 1855#
1779# These are some functions for building a package. In particular, it consists of 1856# These are some functions for building a package. In particular, it consists of
1780# wrappers for javac and ant. 1857# wrappers for javac and ant.
1787# compiler. Will also set proper ANT_TASKS from the variable ANT_TASKS, 1864# compiler. Will also set proper ANT_TASKS from the variable ANT_TASKS,
1788# variables: 1865# variables:
1789# EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the 1866# EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the
1790# gentoo.classpath property. Be sure to call 1867# gentoo.classpath property. Be sure to call
1791# java-ant_rewrite-classpath in src_unpack. 1868# java-ant_rewrite-classpath in src_unpack.
1869# EANT_NEEDS_TOOLS - add tools.jar to the gentoo.classpath. Should only be used
1870# for build-time purposes, the dependency is not recorded to
1871# package.env!
1792# JAVA_PKG_NO_BUNDLED_SEARCH - Don't search for bundled jars or class files 1872# JAVA_PKG_NO_BUNDLED_SEARCH - Don't search for bundled jars or class files
1793# *ANT_TASKS - used to determine ANT_TASKS before calling Ant. 1873# *ANT_TASKS - used to determine ANT_TASKS before calling Ant.
1794# ------------------------------------------------------------------------------ 1874# ------------------------------------------------------------------------------
1795eant() { 1875eant() {
1796 debug-print-function ${FUNCNAME} $* 1876 debug-print-function ${FUNCNAME} $*
1797 1877
1798 if [[ ${EBUILD_PHASE} = compile ]]; then 1878 if [[ ${EBUILD_PHASE} = compile ]]; then
1799 # Used to be done in hooks in java-ant-2.eclass but moved here so that we can 1879 java-ant-2_src_configure
1800 # finally get rid of the hooks without breaking stuff 1880 java-utils-2_src_prepare
1801
1802 [[ "${JAVA_ANT_IGNORE_SYSTEM_CLASSES}" && "${JAVA_PKG_BSFIX}" ]] \
1803 && java-ant_ignore-system-classes "${S}/build.xml"
1804
1805 if hasq java-ant-2 ${INHERITED}; then
1806 java-ant_bsfix
1807 fi
1808
1809 # eant can be called multiple times
1810 JAVA_PKG_BSFIX="off"
1811
1812 if [[ -z ${JAVA_PKG_NO_BUNDLED_SEARCH} ]] && is-java-strict; then
1813 echo "Searching for bundled jars:"
1814 java-pkg_find-normal-jars || echo "None found."
1815 echo "Searching for bundled classes (no output if none found):"
1816 find "${WORKDIR}" -name "*.class"
1817 echo "Search done."
1818 JAVA_PKG_NO_BUNDLED_SEARCH=true # eant can be called many times
1819 fi
1820 fi 1881 fi
1821 1882
1822 if ! hasq java-ant-2 ${INHERITED}; then 1883 if ! hasq java-ant-2 ${INHERITED}; then
1823 local msg="You should inherit java-ant-2 when using eant" 1884 local msg="You should inherit java-ant-2 when using eant"
1824 java-pkg_announce-qa-violation "${msg}" 1885 java-pkg_announce-qa-violation "${msg}"
1825 fi 1886 fi
1826 1887
1827 local antflags="-Dnoget=true -Dmaven.mode.offline=true" 1888 local antflags="-Dnoget=true -Dmaven.mode.offline=true -Dbuild.sysclasspath=ignore"
1828 1889
1829 java-pkg_init-compiler_ 1890 java-pkg_init-compiler_
1830 local compiler="${GENTOO_COMPILER}" 1891 local compiler="${GENTOO_COMPILER}"
1831 1892
1832 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" 1893 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1843 # java-config -p 1904 # java-config -p
1844 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})" 1905 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})"
1845 if [[ -n ${build_compiler_deps} ]]; then 1906 if [[ -n ${build_compiler_deps} ]]; then
1846 antflags="${antflags} -lib $(java-config -p ${build_compiler_deps})" 1907 antflags="${antflags} -lib $(java-config -p ${build_compiler_deps})"
1847 fi 1908 fi
1848 fi
1849
1850 if is-java-strict; then
1851 einfo "Disabling system classpath for ant"
1852 antflags="${antflags} -Dbuild.sysclasspath=ignore"
1853 fi 1909 fi
1854 1910
1855 for arg in "${@}"; do 1911 for arg in "${@}"; do
1856 if [[ ${arg} = -lib ]]; then 1912 if [[ ${arg} = -lib ]]; then
1857 if is-java-strict; then 1913 if is-java-strict; then
1866 echo "more info." 1922 echo "more info."
1867 fi 1923 fi
1868 fi 1924 fi
1869 done 1925 done
1870 1926
1871 # we use this in src_* so we run ant from / 1927 # parse WANT_ANT_TASKS for atoms
1872 if ROOT=/ has_version ">=dev-java/ant-core-1.7.0"; then 1928 local want_ant_tasks
1873 # default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly 1929 for i in ${WANT_ANT_TASKS}; do
1874 ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}" 1930 if [[ ${i} = */*:* ]]; then
1875 1931 i=${i#*/}
1876 # override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set 1932 i=${i%:0}
1877 ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}" 1933 want_ant_tasks+="${i/:/-} "
1878
1879 if is-java-strict; then
1880 # if ant-tasks were not set by ebuild or forced, try to determine them from depends
1881 if [[ -z "${ANT_TASKS}" ]]; then
1882 ANT_TASKS="$(java-pkg_ant-tasks-from-deps)"
1883 fi
1884 else 1934 else
1935 want_ant_tasks+="${i} "
1936 fi
1937 done
1938 # default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly
1939 ANT_TASKS="${ANT_TASKS:-${want_ant_tasks% }}"
1940
1941 # override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set
1942 ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}"
1943
1885 # if ant-tasks is not set by ebuild or forced, activate all of them 1944 # if ant-tasks is not set by ebuild or forced, use none
1886 ANT_TASKS="${ANT_TASKS:-all}" 1945 ANT_TASKS="${ANT_TASKS:-none}"
1887 fi
1888 1946
1889 # at this point, ANT_TASKS should be "all", "none" or explicit list 1947 # at this point, ANT_TASKS should be "all", "none" or explicit list
1890 if [[ "${ANT_TASKS}" == "all" ]]; then 1948 if [[ "${ANT_TASKS}" == "all" ]]; then
1891 einfo "Using all available ANT_TASKS" 1949 einfo "Using all available ANT_TASKS"
1892 elif [[ "${ANT_TASKS}" == "none" ]]; then 1950 elif [[ "${ANT_TASKS}" == "none" ]]; then
1893 einfo "Disabling all optional ANT_TASKS" 1951 einfo "Disabling all optional ANT_TASKS"
1894 else 1952 else
1895 einfo "Using following ANT_TASKS: ${ANT_TASKS}" 1953 einfo "Using following ANT_TASKS: ${ANT_TASKS}"
1896 fi 1954 fi
1897 1955
1898 export ANT_TASKS 1956 export ANT_TASKS
1899 fi
1900 1957
1901 [[ -n ${JAVA_PKG_DEBUG} ]] && antflags="${antflags} --execdebug -debug" 1958 [[ -n ${JAVA_PKG_DEBUG} ]] && antflags="${antflags} --execdebug -debug"
1902 [[ -n ${PORTAGE_QUIET} ]] && antflags="${antflags} -q" 1959 [[ -n ${PORTAGE_QUIET} ]] && antflags="${antflags} -q"
1903 1960
1904 local gcp="${EANT_GENTOO_CLASSPATH}" 1961 local gcp="${EANT_GENTOO_CLASSPATH}"
1905 local getjarsarg="" 1962 local getjarsarg=""
1906 1963
1907 if [[ ${EBUILD_PHASE} = "test" ]]; then 1964 if [[ ${EBUILD_PHASE} = "test" ]]; then
1908 antflags="${antflags} -DJunit.present=true" 1965 antflags="${antflags} -DJunit.present=true"
1909 [[ ${gcp} && ${ANT_TASKS} = *ant-junit* ]] && gcp="${gcp} junit" 1966 [[ ${ANT_TASKS} = *ant-junit* ]] && gcp="${gcp} junit"
1910 getjarsarg="--with-dependencies" 1967 getjarsarg="--with-dependencies"
1911 fi 1968 fi
1912 1969
1913 local cp 1970 local cp
1914 1971
1915 for atom in ${gcp}; do 1972 for atom in ${gcp}; do
1916 cp="${cp}:$(java-pkg_getjars ${getjarsarg} ${atom})" 1973 cp="${cp}:$(java-pkg_getjars ${getjarsarg} ${atom})"
1917 done 1974 done
1918 1975
1976 [[ -n "${EANT_NEEDS_TOOLS}" ]] && cp="${cp}:$(java-config --tools)"
1977
1919 if [[ ${cp} ]]; then 1978 if [[ ${cp} ]]; then
1920 # It seems ant does not like single quotes around ${cp} 1979 # It seems ant does not like single quotes around ${cp}
1980 cp=${cp#:}
1981 [[ ${EANT_GENTOO_CLASSPATH_EXTRA} ]] && \
1982 cp="${cp}:${EANT_GENTOO_CLASSPATH_EXTRA}"
1921 antflags="${antflags} -Dgentoo.classpath=\"${cp#:}\"" 1983 antflags="${antflags} -Dgentoo.classpath=\"${cp}\""
1922 fi 1984 fi
1923 1985
1924 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ant ${antflags} "${@}" 1986 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ant ${antflags} "${@}"
1925 debug-print "Calling ant (GENTOO_VM: ${GENTOO_VM}): ${antflags} ${@}" 1987 debug-print "Calling ant (GENTOO_VM: ${GENTOO_VM}): ${antflags} ${@}"
1926 ant ${antflags} "${@}" || die "eant failed" 1988 ant ${antflags} "${@}" || die "eant failed"
2026# This shouldn't be used directly. Instead, java-pkg and java-pkg-opt will 2088# This shouldn't be used directly. Instead, java-pkg and java-pkg-opt will
2027# call it during each of the phases of the merge process. 2089# call it during each of the phases of the merge process.
2028# 2090#
2029# ----------------------------------------------------------------------------- 2091# -----------------------------------------------------------------------------
2030java-pkg_init() { 2092java-pkg_init() {
2093 debug-print-function ${FUNCNAME} $*
2031 unset JAVAC 2094 unset JAVAC
2032 unset JAVA_HOME 2095 unset JAVA_HOME
2096
2097 java-config --help >/dev/null || {
2098 eerror ""
2099 eerror "Can't run java-config --help"
2100 eerror "Have you upgraded python recently but haven't"
2101 eerror "run python-updater yet?"
2102 die "Can't run java-config --help"
2103 }
2033 2104
2034 # People do all kinds of weird things. 2105 # People do all kinds of weird things.
2035 # http://forums.gentoo.org/viewtopic-p-3943166.html 2106 # http://forums.gentoo.org/viewtopic-p-3943166.html
2036 local silence="${SILENCE_JAVA_OPTIONS_WARNING}" 2107 local silence="${SILENCE_JAVA_OPTIONS_WARNING}"
2037 local accept="${I_WANT_GLOBAL_JAVA_OPTIONS}" 2108 local accept="${I_WANT_GLOBAL_JAVA_OPTIONS}"
2043 ewarn "make.conf for example) to silence this warning or" 2114 ewarn "make.conf for example) to silence this warning or"
2044 ewarn "I_WANT_GLOBAL_JAVA_OPTIONS to not filter it." 2115 ewarn "I_WANT_GLOBAL_JAVA_OPTIONS to not filter it."
2045 fi 2116 fi
2046 2117
2047 if [[ -z ${accept} ]]; then 2118 if [[ -z ${accept} ]]; then
2119 # export _JAVA_OPTIONS= doesn't work because it will show up in java
2120 # -version output
2048 unset _JAVA_OPTIONS 2121 unset _JAVA_OPTIONS
2049 # phase hooks make this run many times without this 2122 # phase hooks make this run many times without this
2050 I_WANT_GLOBAL_JAVA_OPTIONS="true" 2123 I_WANT_GLOBAL_JAVA_OPTIONS="true"
2051 fi 2124 fi
2052 2125
2060 2133
2061 # TODO we will probably want to set JAVAC and JAVACFLAGS 2134 # TODO we will probably want to set JAVAC and JAVACFLAGS
2062 2135
2063 # Do some QA checks 2136 # Do some QA checks
2064 java-pkg_check-jikes 2137 java-pkg_check-jikes
2138
2139 # Can't use unset here because Portage does not save the unset
2140 # see https://bugs.gentoo.org/show_bug.cgi?id=189417#c11
2065 2141
2066 # When users have crazy classpaths some packages can fail to compile. 2142 # When users have crazy classpaths some packages can fail to compile.
2067 # and everything should work with empty CLASSPATH. 2143 # and everything should work with empty CLASSPATH.
2068 # This also helps prevent unexpected dependencies on random things 2144 # This also helps prevent unexpected dependencies on random things
2069 # from the CLASSPATH. 2145 # from the CLASSPATH.
2070 unset CLASSPATH 2146 export CLASSPATH=
2071 2147
2072 # Unset external ANT_ stuff 2148 # Unset external ANT_ stuff
2073 unset ANT_TASKS 2149 export ANT_TASKS=
2074 unset ANT_OPTS 2150 export ANT_OPTS=
2151 export ANT_RESPECT_JAVA_HOME=
2075} 2152}
2076 2153
2077# ------------------------------------------------------------------------------ 2154# ------------------------------------------------------------------------------
2078# @function-internal java-pkg-init-compiler_ 2155# @function-internal java-pkg-init-compiler_
2079# 2156#
2170 done 2247 done
2171 2248
2172 # If it hasn't been defined already, default to javac 2249 # If it hasn't been defined already, default to javac
2173 if [[ -z ${GENTOO_COMPILER} ]]; then 2250 if [[ -z ${GENTOO_COMPILER} ]]; then
2174 if [[ -n ${compilers} ]]; then 2251 if [[ -n ${compilers} ]]; then
2175 einfo "No suitable compiler found: defaulting javac for compilation" 2252 einfo "No suitable compiler found: defaulting to JDK default for compilation"
2176 else 2253 else
2177 # probably don't need to notify users about the default. 2254 # probably don't need to notify users about the default.
2178 :;#einfo "Defaulting to javac for compilation" 2255 :;#einfo "Defaulting to javac for compilation"
2179 fi 2256 fi
2257 if java-config -g GENTOO_COMPILER 2> /dev/null; then
2258 export GENTOO_COMPILER=$(java-config -g GENTOO_COMPILER)
2259 else
2180 export GENTOO_COMPILER=javac 2260 export GENTOO_COMPILER=javac
2261 fi
2181 else 2262 else
2182 einfo "Using ${GENTOO_COMPILER} for compilation" 2263 einfo "Using ${GENTOO_COMPILER} for compilation"
2183 fi 2264 fi
2184 2265
2185} 2266}
2201 fi 2282 fi
2202 2283
2203 JAVA_PKG_SHAREPATH="${DESTTREE}/share/${JAVA_PKG_NAME}" 2284 JAVA_PKG_SHAREPATH="${DESTTREE}/share/${JAVA_PKG_NAME}"
2204 JAVA_PKG_SOURCESPATH="${JAVA_PKG_SHAREPATH}/sources/" 2285 JAVA_PKG_SOURCESPATH="${JAVA_PKG_SHAREPATH}/sources/"
2205 JAVA_PKG_ENV="${D}${JAVA_PKG_SHAREPATH}/package.env" 2286 JAVA_PKG_ENV="${D}${JAVA_PKG_SHAREPATH}/package.env"
2287 JAVA_PKG_VIRTUALS_PATH="${DESTTREE}/share/java-config-2/virtuals"
2288 JAVA_PKG_VIRTUAL_PROVIDER="${D}/${JAVA_PKG_VIRTUALS_PATH}/${JAVA_PKG_NAME}"
2206 2289
2207 [[ -z "${JAVA_PKG_JARDEST}" ]] && JAVA_PKG_JARDEST="${JAVA_PKG_SHAREPATH}/lib" 2290 [[ -z "${JAVA_PKG_JARDEST}" ]] && JAVA_PKG_JARDEST="${JAVA_PKG_SHAREPATH}/lib"
2208 [[ -z "${JAVA_PKG_LIBDEST}" ]] && JAVA_PKG_LIBDEST="${DESTTREE}/$(get_libdir)/${JAVA_PKG_NAME}" 2291 [[ -z "${JAVA_PKG_LIBDEST}" ]] && JAVA_PKG_LIBDEST="${DESTTREE}/$(get_libdir)/${JAVA_PKG_NAME}"
2209 [[ -z "${JAVA_PKG_WARDEST}" ]] && JAVA_PKG_WARDEST="${JAVA_PKG_SHAREPATH}/webapps" 2292 [[ -z "${JAVA_PKG_WARDEST}" ]] && JAVA_PKG_WARDEST="${JAVA_PKG_SHAREPATH}/webapps"
2210 2293
2234 "${JAVA_PKG_OPTIONAL_DEPEND_FILE}" ]]; then 2317 "${JAVA_PKG_OPTIONAL_DEPEND_FILE}" ]]; then
2235 # Create package.env 2318 # Create package.env
2236 ( 2319 (
2237 echo "DESCRIPTION=\"${DESCRIPTION}\"" 2320 echo "DESCRIPTION=\"${DESCRIPTION}\""
2238 echo "GENERATION=\"2\"" 2321 echo "GENERATION=\"2\""
2322 echo "SLOT=\"${SLOT}\""
2239 2323
2240 [[ -n "${JAVA_PKG_CLASSPATH}" ]] && echo "CLASSPATH=\"${JAVA_PKG_CLASSPATH}\"" 2324 [[ -n "${JAVA_PKG_CLASSPATH}" ]] && echo "CLASSPATH=\"${JAVA_PKG_CLASSPATH}\""
2241 [[ -n "${JAVA_PKG_LIBRARY}" ]] && echo "LIBRARY_PATH=\"${JAVA_PKG_LIBRARY}\"" 2325 [[ -n "${JAVA_PKG_LIBRARY}" ]] && echo "LIBRARY_PATH=\"${JAVA_PKG_LIBRARY}\""
2242 [[ -n "${JAVA_PROVIDE}" ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\"" 2326 [[ -n "${JAVA_PROVIDE}" ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\""
2243 [[ -f "${JAVA_PKG_DEPEND_FILE}" ]] \ 2327 [[ -f "${JAVA_PKG_DEPEND_FILE}" ]] \
2551# not. 2635# not.
2552# @param $1 (optional) - the file to check, otherwise checks whole ${D} 2636# @param $1 (optional) - the file to check, otherwise checks whole ${D}
2553# ------------------------------------------------------------------------------ 2637# ------------------------------------------------------------------------------
2554java-pkg_verify-classes() { 2638java-pkg_verify-classes() {
2555 #$(find ${D} -type f -name '*.jar' -o -name '*.class') 2639 #$(find ${D} -type f -name '*.jar' -o -name '*.class')
2640
2641 local version_verify="/usr/bin/class-version-verify.py"
2642
2643 if [[ ! -x "${version_verify}" ]]; then
2644 version_verify="/usr/$(get_libdir)/javatoolkit/bin/class-version-verify.py"
2645 fi
2646
2647 if [[ ! -x "${version_verify}" ]]; then
2648 ewarn "Unable to perform class version checks as"
2649 ewarn "class-version-verify.py is unavailable"
2650 ewarn "Please install dev-java/javatoolkit."
2651 return
2652 fi
2653
2556 local target=$(java-pkg_get-target) 2654 local target=$(java-pkg_get-target)
2557 local result 2655 local result
2558 local log="${T}/class-version-verify.log" 2656 local log="${T}/class-version-verify.log"
2559 if [[ -n "${1}" ]]; then 2657 if [[ -n "${1}" ]]; then
2560 class-version-verify.py -v -t ${target} "${1}" > "${log}" 2658 ${version_verify} -v -t ${target} "${1}" > "${log}"
2561 result=$? 2659 result=$?
2562 else 2660 else
2563 ebegin "Verifying java class versions (target: ${target})" 2661 ebegin "Verifying java class versions (target: ${target})"
2564 class-version-verify.py -v -t ${target} -r "${D}" > "${log}" 2662 ${version_verify} -v -t ${target} -r "${D}" > "${log}"
2565 result=$? 2663 result=$?
2566 eend ${result} 2664 eend ${result}
2567 fi 2665 fi
2568 [[ -n ${JAVA_PKG_DEBUG} ]] && cat "${log}" 2666 [[ -n ${JAVA_PKG_DEBUG} ]] && cat "${log}"
2569 if [[ ${result} != 0 ]]; then 2667 if [[ ${result} != 0 ]]; then
2674is-java-strict() { 2772is-java-strict() {
2675 [[ -n ${JAVA_PKG_STRICT} ]] 2773 [[ -n ${JAVA_PKG_STRICT} ]]
2676 return $? 2774 return $?
2677} 2775}
2678 2776
2777
2679# ------------------------------------------------------------------------------ 2778# ------------------------------------------------------------------------------
2680# @eclass-end 2779# @eclass-end
2681# ------------------------------------------------------------------------------ 2780# ------------------------------------------------------------------------------

Legend:
Removed from v.1.93  
changed lines
  Added in v.1.124

  ViewVC Help
Powered by ViewVC 1.1.20