/[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.95 Revision 1.107
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.95 2007/11/13 19:36:50 betelgeuse Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.107 2008/05/03 21:28:45 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
290 fi 290 fi
291 done 291 done
292 292
293 java-pkg_do_write_ 293 java-pkg_do_write_
294} 294}
295
296 295
297# ------------------------------------------------------------------------------ 296# ------------------------------------------------------------------------------
298# @internal-function depend-java-query 297# @internal-function depend-java-query
299# 298#
300# 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.
557# ------------------------------------------------------------------------------ 556# ------------------------------------------------------------------------------
558# @ebuild-function java-pkg_dojavadoc 557# @ebuild-function java-pkg_dojavadoc
559# 558#
560# 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.
561# 560#
561# @param $1: optional --symlink creates to symlink like this for html
562# documentation bundles.
562# @param $1: - The javadoc root directory. 563# @param $2: - The javadoc root directory.
563# 564#
564# @example: 565# @example:
565# java-pkg_dojavadoc docs/api 566# java-pkg_dojavadoc docs/api
567# java-pkg_dojavadoc --symlink apidocs docs/api
566# 568#
567# ------------------------------------------------------------------------------ 569# ------------------------------------------------------------------------------
568java-pkg_dojavadoc() { 570java-pkg_dojavadoc() {
569 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
570 local dir="$1" 580 local dir="$1"
581 local dest=/usr/share/doc/${PF}/html
571 582
572 # QA checks 583 # QA checks
573 584
574 java-pkg_check-phase install 585 java-pkg_check-phase install
575 586
579 local msg="No index.html in javadoc directory" 590 local msg="No index.html in javadoc directory"
580 ewarn "${msg}" 591 ewarn "${msg}"
581 is-java-strict && die "${msg}" 592 is-java-strict && die "${msg}"
582 fi 593 fi
583 594
595 if [[ -e ${D}/${dest}/api ]]; then
596 eerror "${dest} already exists. Will not overwrite."
597 die "${dest}"
598 fi
599
584 # Renaming to match our directory layout 600 # Renaming to match our directory layout
585 601
586 local dir_to_install="${dir}" 602 local dir_to_install="${dir}"
587 if [[ "$(basename "${dir}")" != "api" ]]; then 603 if [[ "$(basename "${dir}")" != "api" ]]; then
588 dir_to_install="${T}/api" 604 dir_to_install="${T}/api"
590 cp -r "${dir}" "${dir_to_install}" || die "cp failed" 606 cp -r "${dir}" "${dir_to_install}" || die "cp failed"
591 fi 607 fi
592 608
593 # Actual installation 609 # Actual installation
594 610
595 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
596} 620}
597 621
598# ------------------------------------------------------------------------------ 622# ------------------------------------------------------------------------------
599# @ebuild-function java-pkg_dosrc 623# @ebuild-function java-pkg_dosrc
600# 624#
623 647
624 [[ ${#} -lt 1 ]] && die "At least one argument needed" 648 [[ ${#} -lt 1 ]] && die "At least one argument needed"
625 649
626 if ! [[ ${DEPEND} = *app-arch/zip* ]]; then 650 if ! [[ ${DEPEND} = *app-arch/zip* ]]; then
627 local msg="${FUNCNAME} called without app-arch/zip in DEPEND" 651 local msg="${FUNCNAME} called without app-arch/zip in DEPEND"
628 if is-java-strict; then 652 java-pkg_announce-qa-violation ${msg}
629 eerror "${msg}"
630 die "${msg}"
631 else
632 echo "${msg}"
633 echo "Please report this to http://bugs.gentoo.org."
634 fi
635 fi 653 fi
636 654
637 java-pkg_init_paths_ 655 java-pkg_init_paths_
638 656
639 local zip_name="${PN}-src.zip" 657 local zip_name="${PN}-src.zip"
879 897
880 local target_pkg="${1}" target_jar="${2}" destjar="${3}" 898 local target_pkg="${1}" target_jar="${2}" destjar="${3}"
881 899
882 [[ -z ${target_pkg} ]] && die "Must specify a package" 900 [[ -z ${target_pkg} ]] && die "Must specify a package"
883 901
902 if [[ "${EAPI}" == "1" ]]; then
903 target_pkg="${target_pkg//:/-}"
904 fi
905
884 # default destjar to the target jar 906 # default destjar to the target jar
885 [[ -z "${destjar}" ]] && destjar="${target_jar}" 907 [[ -z "${destjar}" ]] && destjar="${target_jar}"
886 908
887 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}."
888 local classpath 910 local classpath
999 done 1021 done
1000 1022
1001 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*" 1023 [[ ${#} -ne 1 ]] && die "${FUNCNAME} takes only one argument besides --*"
1002 1024
1003 1025
1004 local classpath pkgs="${1}" 1026 local pkgs="${1}"
1027
1028 if [[ "${EAPI}" == "1" ]]; then
1029 pkgs="${pkgs//:/-}"
1030 fi
1031
1005 jars="$(java-config ${deep} --classpath=${pkgs})" 1032 jars="$(java-config ${deep} --classpath=${pkgs})"
1006 [[ $? != 0 || -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed" 1033 [[ $? != 0 ]] && die "java-config --classpath=${pkgs} failed"
1007 debug-print "${pkgs}:${jars}" 1034 debug-print "${pkgs}:${jars}"
1008 1035
1009 for pkg in ${pkgs//,/ }; do 1036 for pkg in ${pkgs//,/ }; do
1010 java-pkg_ensure-dep "${build_only}" "${pkg}" 1037 java-pkg_ensure-dep "${build_only}" "${pkg}"
1011 done 1038 done
1012
1013 if [[ -z "${classpath}" ]]; then
1014 classpath="${jars}"
1015 else
1016 classpath="${classpath}:${jars}"
1017 fi
1018 1039
1019 # Only record jars that aren't build-only 1040 # Only record jars that aren't build-only
1020 if [[ -z "${build_only}" ]]; then 1041 if [[ -z "${build_only}" ]]; then
1021 for pkg in ${pkgs//,/ }; do 1042 for pkg in ${pkgs//,/ }; do
1022 java-pkg_record-jar_ "${pkg}" 1043 java-pkg_record-jar_ "${pkg}"
1023 done 1044 done
1024 fi 1045 fi
1025 1046
1026 echo "${classpath}" 1047 echo "${jars}"
1027} 1048}
1028 1049
1029# ------------------------------------------------------------------------------ 1050# ------------------------------------------------------------------------------
1030# @ebuild-function java-pkg_getjar 1051# @ebuild-function java-pkg_getjar
1031# 1052#
1056 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build" 1077 [[ "${EBUILD_PHASE}" == "test" ]] && build_only="build"
1057 1078
1058 while [[ "${1}" == --* ]]; do 1079 while [[ "${1}" == --* ]]; do
1059 if [[ "${1}" = "--build-only" ]]; then 1080 if [[ "${1}" = "--build-only" ]]; then
1060 build_only="build" 1081 build_only="build"
1061 elif [[ "${1}" == --* ]]; then 1082 elif [[ "${1}" == "--virtual" ]]; then
1062 virtual="true" 1083 virtual="true"
1063 else 1084 else
1064 die "java-pkg_jar-from called with unknown parameter: ${1}" 1085 die "java-pkg_getjar called with unknown parameter: ${1}"
1065 fi 1086 fi
1066 shift 1087 shift
1067 done 1088 done
1068 1089
1069 [[ ${#} -ne 2 ]] && die "${FUNCNAME} takes only two arguments besides --*" 1090 [[ ${#} -ne 2 ]] && die "${FUNCNAME} takes only two arguments besides --*"
1070 1091
1071 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
1072 [[ -z ${pkg} ]] && die "Must specify package to get a jar from" 1098 [[ -z ${pkg} ]] && die "Must specify package to get a jar from"
1073 [[ -z ${target_jar} ]] && die "Must specify jar to get" 1099 [[ -z ${target_jar} ]] && die "Must specify jar to get"
1074 1100
1075 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?"
1076 local classpath 1102 local classpath
1137 1163
1138 local pkgs="${1}" 1164 local pkgs="${1}"
1139 local jar="${2}" 1165 local jar="${2}"
1140 1166
1141 [[ -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
1142 1172
1143 if [[ -z "${jar}" ]]; then 1173 if [[ -z "${jar}" ]]; then
1144 for pkg in ${pkgs//,/ }; do 1174 for pkg in ${pkgs//,/ }; do
1145 java-pkg_ensure-dep runtime "${pkg}" 1175 java-pkg_ensure-dep runtime "${pkg}"
1146 java-pkg_record-jar_ "${pkg}" 1176 java-pkg_record-jar_ "${pkg}"
1188 1218
1189 local pkgs="${1}" 1219 local pkgs="${1}"
1190 local jar="${2}" 1220 local jar="${2}"
1191 1221
1192 [[ -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
1193 1227
1194 if [[ -z "${jar}" ]]; then 1228 if [[ -z "${jar}" ]]; then
1195 for pkg in ${pkgs//,/ }; do 1229 for pkg in ${pkgs//,/ }; do
1196 java-pkg_record-jar_ --optional "${pkg}" 1230 java-pkg_record-jar_ --optional "${pkg}"
1197 done 1231 done
1698 dodir /usr/share/ant/${TASKS_DIR} 1732 dodir /usr/share/ant/${TASKS_DIR}
1699 touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}" 1733 touch "${D}/usr/share/ant/${TASKS_DIR}/${TASK_NAME}"
1700} 1734}
1701 1735
1702# ------------------------------------------------------------------------------ 1736# ------------------------------------------------------------------------------
1703# @internal-function java-pkg_ant-tasks-from-deps
1704#
1705# Function to determine ANT_TASKS from DEPEND variable for backwards
1706# compatibility with ebuilds that don't set ANT_TASKS before calling eant() or
1707# WANT_ANT_TASKS before inheriting java-pkg-2. If the DEPEND string contains
1708# "dev-java/ant" or "dev-java/ant-tasks", then it returns "all", otherwise
1709# "none". It's not smart enough to cope with USE flag depends but that shouldn't
1710# be a problem, the worst it can do is activace all tasks when not needed.
1711# Note that this is called only with JAVA_PKG_STRICT=1, to find ebuilds with
1712# insufficient dependencies, otherwise all available tasks are used for
1713# backwards compatilbility.
1714#
1715# @return "all" or "none"
1716# ------------------------------------------------------------------------------
1717java-pkg_ant-tasks-from-deps() {
1718 local found_ant found_ant_tasks
1719
1720 for dep in ${DEPEND}
1721 do
1722 local ant="$(awk '/(dev-java\/ant)/ { if (match($1, "(dev-java/ant)((-[0-9])+|$)", m)) print m[1] }' <<< ${dep})"
1723 [[ "${ant}" == "dev-java/ant" ]] && found_ant=true
1724 [[ "${dep}" == *"ant-tasks"* ]] && found_ant_tasks=true
1725 done
1726
1727 if [[ -n "${found_ant}" || -n "${found_ant_tasks}" ]]; then
1728 java-pkg_announce-qa-violation --nodie "The ebuild DEPENDS on deprecated ant or ant-tasks"
1729 echo "all"
1730 else
1731 # ebuild doesn't set ANT_TASKS and doesn't depend on ant-tasks or ant
1732 # so we deactivate all tasks that may be installed
1733 echo "none"
1734 fi
1735}
1736
1737# ------------------------------------------------------------------------------
1738# @internal-function java-pkg_ant-tasks-depend 1737# @internal-function java-pkg_ant-tasks-depend
1739# 1738#
1740# Translates the WANT_ANT_TASKS variable into valid dependencies. 1739# Translates the WANT_ANT_TASKS variable into valid dependencies.
1741# ------------------------------------------------------------------------------ 1740# ------------------------------------------------------------------------------
1742java-pkg_ant-tasks-depend() { 1741java-pkg_ant-tasks-depend() {
1775# ------------------------------------------------------------------------------ 1774# ------------------------------------------------------------------------------
1776ejunit() { 1775ejunit() {
1777 debug-print-function ${FUNCNAME} $* 1776 debug-print-function ${FUNCNAME} $*
1778 1777
1779 local pkgs 1778 local pkgs
1779 if [[ -f ${JAVA_PKG_DEPEND_FILE} ]]; then
1780 for atom in $(cat ${JAVA_PKG_DEPEND_FILE} | tr : ' '); do 1780 for atom in $(cat ${JAVA_PKG_DEPEND_FILE} | tr : ' '); do
1781 pkgs=${pkgs},$(echo ${atom} | sed -re "s/^.*@//") 1781 pkgs=${pkgs},$(echo ${atom} | sed -re "s/^.*@//")
1782 done 1782 done
1783 fi
1783 1784
1784 local cp=$(java-pkg_getjars --with-dependencies junit${pkgs}) 1785 local cp=$(java-pkg_getjars --with-dependencies junit${pkgs})
1785 if [[ ${1} = -cp || ${1} = -classpath ]]; then 1786 if [[ ${1} = -cp || ${1} = -classpath ]]; then
1786 cp="${2}:${cp}" 1787 cp="${2}:${cp}"
1787 shift 2 1788 shift 2
1848 if ! hasq java-ant-2 ${INHERITED}; then 1849 if ! hasq java-ant-2 ${INHERITED}; then
1849 local msg="You should inherit java-ant-2 when using eant" 1850 local msg="You should inherit java-ant-2 when using eant"
1850 java-pkg_announce-qa-violation "${msg}" 1851 java-pkg_announce-qa-violation "${msg}"
1851 fi 1852 fi
1852 1853
1853 local antflags="-Dnoget=true -Dmaven.mode.offline=true" 1854 local antflags="-Dnoget=true -Dmaven.mode.offline=true -Dbuild.sysclasspath=ignore"
1854 1855
1855 java-pkg_init-compiler_ 1856 java-pkg_init-compiler_
1856 local compiler="${GENTOO_COMPILER}" 1857 local compiler="${GENTOO_COMPILER}"
1857 1858
1858 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" 1859 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1869 # java-config -p 1870 # java-config -p
1870 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})" 1871 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})"
1871 if [[ -n ${build_compiler_deps} ]]; then 1872 if [[ -n ${build_compiler_deps} ]]; then
1872 antflags="${antflags} -lib $(java-config -p ${build_compiler_deps})" 1873 antflags="${antflags} -lib $(java-config -p ${build_compiler_deps})"
1873 fi 1874 fi
1874 fi
1875
1876 if is-java-strict; then
1877 einfo "Disabling system classpath for ant"
1878 antflags="${antflags} -Dbuild.sysclasspath=ignore"
1879 fi 1875 fi
1880 1876
1881 for arg in "${@}"; do 1877 for arg in "${@}"; do
1882 if [[ ${arg} = -lib ]]; then 1878 if [[ ${arg} = -lib ]]; then
1883 if is-java-strict; then 1879 if is-java-strict; then
1892 echo "more info." 1888 echo "more info."
1893 fi 1889 fi
1894 fi 1890 fi
1895 done 1891 done
1896 1892
1897 # we use this in src_* so we run ant from /
1898 if ROOT=/ has_version ">=dev-java/ant-core-1.7.0"; then
1899 # default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly 1893 # default ANT_TASKS to WANT_ANT_TASKS, if ANT_TASKS is not set explicitly
1900 ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}" 1894 ANT_TASKS="${ANT_TASKS:-${WANT_ANT_TASKS}}"
1901 1895
1902 # override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set 1896 # override ANT_TASKS with JAVA_PKG_FORCE_ANT_TASKS if it's set
1903 ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}" 1897 ANT_TASKS="${JAVA_PKG_FORCE_ANT_TASKS:-${ANT_TASKS}}"
1904 1898
1905 if is-java-strict; then
1906 # if ant-tasks were not set by ebuild or forced, try to determine them from depends
1907 if [[ -z "${ANT_TASKS}" ]]; then
1908 ANT_TASKS="$(java-pkg_ant-tasks-from-deps)"
1909 fi
1910 else
1911 # if ant-tasks is not set by ebuild or forced, activate all of them 1899 # if ant-tasks is not set by ebuild or forced, use none
1912 ANT_TASKS="${ANT_TASKS:-all}" 1900 ANT_TASKS="${ANT_TASKS:-none}"
1913 fi
1914 1901
1915 # at this point, ANT_TASKS should be "all", "none" or explicit list 1902 # at this point, ANT_TASKS should be "all", "none" or explicit list
1916 if [[ "${ANT_TASKS}" == "all" ]]; then 1903 if [[ "${ANT_TASKS}" == "all" ]]; then
1917 einfo "Using all available ANT_TASKS" 1904 einfo "Using all available ANT_TASKS"
1918 elif [[ "${ANT_TASKS}" == "none" ]]; then 1905 elif [[ "${ANT_TASKS}" == "none" ]]; then
1919 einfo "Disabling all optional ANT_TASKS" 1906 einfo "Disabling all optional ANT_TASKS"
1920 else 1907 else
1921 einfo "Using following ANT_TASKS: ${ANT_TASKS}" 1908 einfo "Using following ANT_TASKS: ${ANT_TASKS}"
1922 fi 1909 fi
1923 1910
1924 export ANT_TASKS 1911 export ANT_TASKS
1925 fi
1926 1912
1927 [[ -n ${JAVA_PKG_DEBUG} ]] && antflags="${antflags} --execdebug -debug" 1913 [[ -n ${JAVA_PKG_DEBUG} ]] && antflags="${antflags} --execdebug -debug"
1928 [[ -n ${PORTAGE_QUIET} ]] && antflags="${antflags} -q" 1914 [[ -n ${PORTAGE_QUIET} ]] && antflags="${antflags} -q"
1929 1915
1930 local gcp="${EANT_GENTOO_CLASSPATH}" 1916 local gcp="${EANT_GENTOO_CLASSPATH}"
2052# This shouldn't be used directly. Instead, java-pkg and java-pkg-opt will 2038# This shouldn't be used directly. Instead, java-pkg and java-pkg-opt will
2053# call it during each of the phases of the merge process. 2039# call it during each of the phases of the merge process.
2054# 2040#
2055# ----------------------------------------------------------------------------- 2041# -----------------------------------------------------------------------------
2056java-pkg_init() { 2042java-pkg_init() {
2043 debug-print-function ${FUNCNAME} $*
2057 unset JAVAC 2044 unset JAVAC
2058 unset JAVA_HOME 2045 unset JAVA_HOME
2059 2046
2060 # People do all kinds of weird things. 2047 # People do all kinds of weird things.
2061 # http://forums.gentoo.org/viewtopic-p-3943166.html 2048 # http://forums.gentoo.org/viewtopic-p-3943166.html
2069 ewarn "make.conf for example) to silence this warning or" 2056 ewarn "make.conf for example) to silence this warning or"
2070 ewarn "I_WANT_GLOBAL_JAVA_OPTIONS to not filter it." 2057 ewarn "I_WANT_GLOBAL_JAVA_OPTIONS to not filter it."
2071 fi 2058 fi
2072 2059
2073 if [[ -z ${accept} ]]; then 2060 if [[ -z ${accept} ]]; then
2061 # export _JAVA_OPTIONS= doesn't work because it will show up in java
2062 # -version output
2074 unset _JAVA_OPTIONS 2063 unset _JAVA_OPTIONS
2075 # phase hooks make this run many times without this 2064 # phase hooks make this run many times without this
2076 I_WANT_GLOBAL_JAVA_OPTIONS="true" 2065 I_WANT_GLOBAL_JAVA_OPTIONS="true"
2077 fi 2066 fi
2078 2067
2086 2075
2087 # TODO we will probably want to set JAVAC and JAVACFLAGS 2076 # TODO we will probably want to set JAVAC and JAVACFLAGS
2088 2077
2089 # Do some QA checks 2078 # Do some QA checks
2090 java-pkg_check-jikes 2079 java-pkg_check-jikes
2080
2081 # Can't use unset here because Portage does not save the unset
2082 # see https://bugs.gentoo.org/show_bug.cgi?id=189417#c11
2091 2083
2092 # When users have crazy classpaths some packages can fail to compile. 2084 # When users have crazy classpaths some packages can fail to compile.
2093 # and everything should work with empty CLASSPATH. 2085 # and everything should work with empty CLASSPATH.
2094 # This also helps prevent unexpected dependencies on random things 2086 # This also helps prevent unexpected dependencies on random things
2095 # from the CLASSPATH. 2087 # from the CLASSPATH.
2096 unset CLASSPATH 2088 export CLASSPATH=
2097 2089
2098 # Unset external ANT_ stuff 2090 # Unset external ANT_ stuff
2099 unset ANT_TASKS 2091 export ANT_TASKS=
2100 unset ANT_OPTS 2092 export ANT_OPTS=
2101} 2093}
2102 2094
2103# ------------------------------------------------------------------------------ 2095# ------------------------------------------------------------------------------
2104# @function-internal java-pkg-init-compiler_ 2096# @function-internal java-pkg-init-compiler_
2105# 2097#
2196 done 2188 done
2197 2189
2198 # If it hasn't been defined already, default to javac 2190 # If it hasn't been defined already, default to javac
2199 if [[ -z ${GENTOO_COMPILER} ]]; then 2191 if [[ -z ${GENTOO_COMPILER} ]]; then
2200 if [[ -n ${compilers} ]]; then 2192 if [[ -n ${compilers} ]]; then
2201 einfo "No suitable compiler found: defaulting javac for compilation" 2193 einfo "No suitable compiler found: defaulting to JDK default for compilation"
2202 else 2194 else
2203 # probably don't need to notify users about the default. 2195 # probably don't need to notify users about the default.
2204 :;#einfo "Defaulting to javac for compilation" 2196 :;#einfo "Defaulting to javac for compilation"
2205 fi 2197 fi
2198 if java-config -g GENTOO_COMPILER 2> /dev/null; then
2199 export GENTOO_COMPILER=$(java-config -g GENTOO_COMPILER)
2200 else
2206 export GENTOO_COMPILER=javac 2201 export GENTOO_COMPILER=javac
2202 fi
2207 else 2203 else
2208 einfo "Using ${GENTOO_COMPILER} for compilation" 2204 einfo "Using ${GENTOO_COMPILER} for compilation"
2209 fi 2205 fi
2210 2206
2211} 2207}
2262 "${JAVA_PKG_OPTIONAL_DEPEND_FILE}" ]]; then 2258 "${JAVA_PKG_OPTIONAL_DEPEND_FILE}" ]]; then
2263 # Create package.env 2259 # Create package.env
2264 ( 2260 (
2265 echo "DESCRIPTION=\"${DESCRIPTION}\"" 2261 echo "DESCRIPTION=\"${DESCRIPTION}\""
2266 echo "GENERATION=\"2\"" 2262 echo "GENERATION=\"2\""
2263 echo "SLOT=\"${SLOT}\""
2267 2264
2268 [[ -n "${JAVA_PKG_CLASSPATH}" ]] && echo "CLASSPATH=\"${JAVA_PKG_CLASSPATH}\"" 2265 [[ -n "${JAVA_PKG_CLASSPATH}" ]] && echo "CLASSPATH=\"${JAVA_PKG_CLASSPATH}\""
2269 [[ -n "${JAVA_PKG_LIBRARY}" ]] && echo "LIBRARY_PATH=\"${JAVA_PKG_LIBRARY}\"" 2266 [[ -n "${JAVA_PKG_LIBRARY}" ]] && echo "LIBRARY_PATH=\"${JAVA_PKG_LIBRARY}\""
2270 [[ -n "${JAVA_PROVIDE}" ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\"" 2267 [[ -n "${JAVA_PROVIDE}" ]] && echo "PROVIDES=\"${JAVA_PROVIDE}\""
2271 [[ -f "${JAVA_PKG_DEPEND_FILE}" ]] \ 2268 [[ -f "${JAVA_PKG_DEPEND_FILE}" ]] \

Legend:
Removed from v.1.95  
changed lines
  Added in v.1.107

  ViewVC Help
Powered by ViewVC 1.1.20