/[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.20 Revision 1.33
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.33 2006/12/07 02:27:22 flameeyes Exp $
9 10
10 11
11# ----------------------------------------------------------------------------- 12# -----------------------------------------------------------------------------
12# @eclass-begin 13# @eclass-begin
13# @eclass-shortdesc Java Utility eclass 14# @eclass-shortdesc Java Utility eclass
22# Java packages, or java-pkg-opt for packages that have optional Java support. 23# Java packages, or java-pkg-opt for packages that have optional Java support.
23# 24#
24# ----------------------------------------------------------------------------- 25# -----------------------------------------------------------------------------
25 26
26inherit eutils versionator multilib 27inherit eutils versionator multilib
28
29IUSE="elibc_FreeBSD"
27 30
28# ----------------------------------------------------------------------------- 31# -----------------------------------------------------------------------------
29# @section-begin variables 32# @section-begin variables
30# @section-title Variables 33# @section-title Variables
31# 34#
287 cp "${original_jar}" "${new_jar_dest}" \ 290 cp "${original_jar}" "${new_jar_dest}" \
288 || die "Failed to copy ${original_jar} to ${new_jar_dest}" 291 || die "Failed to copy ${original_jar} to ${new_jar_dest}"
289 java-pkg_dojar "${new_jar_dest}" 292 java-pkg_dojar "${new_jar_dest}"
290} 293}
291 294
292
293# ------------------------------------------------------------------------------ 295# ------------------------------------------------------------------------------
294# @ebuild-function java-pkg_addcp 296# @ebuild-function java-pkg_addcp
295# 297#
296# Add something to the package's classpath. For jars, you should use dojar, 298# Add something to the package's classpath. For jars, you should use dojar,
297# newjar, or regjar. This is typically used to add directories to the classpath. 299# newjar, or regjar. This is typically used to add directories to the classpath.
301# ------------------------------------------------------------------------------ 303# ------------------------------------------------------------------------------
302java-pkg_addcp() { 304java-pkg_addcp() {
303 java-pkg_append_ JAVA_PKG_CLASSPATH "${@}" 305 java-pkg_append_ JAVA_PKG_CLASSPATH "${@}"
304 java-pkg_do_write_ 306 java-pkg_do_write_
305} 307}
306
307 308
308# ------------------------------------------------------------------------------ 309# ------------------------------------------------------------------------------
309# @ebuild-function java-pkg_doso 310# @ebuild-function java-pkg_doso
310# 311#
311# Installs any number of JNI libraries 312# Installs any number of JNI libraries
428# ------------------------------------------------------------------------------ 429# ------------------------------------------------------------------------------
429java-pkg_dohtml() { 430java-pkg_dohtml() {
430 debug-print-function ${FUNCNAME} $* 431 debug-print-function ${FUNCNAME} $*
431 432
432 [[ ${#} -lt 1 ]] && die "At least one argument required for ${FUNCNAME}" 433 [[ ${#} -lt 1 ]] && die "At least one argument required for ${FUNCNAME}"
433 # TODO-nichoj find out what exactly -f package-list does 434
435 # from /usr/lib/portage/bin/dohtml -h
436 # -f Set list of allowed extensionless file names.
434 dohtml -f package-list "$@" 437 dohtml -f package-list "$@"
438
435 # this probably shouldn't be here but it provides 439 # this probably shouldn't be here but it provides
436 # a reasonable way to catch # docs for all of the 440 # a reasonable way to catch # docs for all of the
437 # old ebuilds. 441 # old ebuilds.
438 java-pkg_recordjavadoc 442 java-pkg_recordjavadoc
439} 443}
440 444
441# TODO document 445# ------------------------------------------------------------------------------
446# @ebuild-function java-pkg_dojavadoc
447#
448# Installs javadoc documentation. This should be controlled by the doc use flag.
449#
450# @param $1: - The javadoc root directory.
451#
452# @example:
453# java-pkg_dojavadoc docs/api
454#
455# ------------------------------------------------------------------------------
442java-pkg_dojavadoc() { 456java-pkg_dojavadoc() {
443 local dir="$1" 457 local dir="$1"
444 458
445 java-pkg_check-phase install 459 java-pkg_check-phase install
446 460
518# @ebuild-function java-pkg_dolauncher 532# @ebuild-function java-pkg_dolauncher
519# 533#
520# Make a wrapper script to lauch/start this package 534# Make a wrapper script to lauch/start this package
521# If necessary, the wrapper will switch to the appropriate VM. 535# If necessary, the wrapper will switch to the appropriate VM.
522# 536#
537# Can be called without parameters if the package installs only one jar
538# that has the Main-class attribute set. The wrapper will be named ${PN}.
539#
523# @param $1 - filename of launcher to create 540# @param $1 - filename of launcher to create
524# @param $2 - options, as follows: 541# @param $2 - options, as follows:
525# --main the.main.class.too.start 542# --main the.main.class.too.start
526# --jar /the/jar/too/launch.jar 543# --jar /the/jar/too/launch.jar or just <name>.jar
527# --java_args 'Extra arguments to pass to java' 544# --java_args 'Extra arguments to pass to java'
528# --pkg_args 'Extra arguments too pass to the package' 545# --pkg_args 'Extra arguments too pass to the package'
529# --pwd 546# --pwd
530# -into 547# -into
531# -pre 548# -pre
532# ------------------------------------------------------------------------------ 549# ------------------------------------------------------------------------------
533java-pkg_dolauncher() { 550java-pkg_dolauncher() {
534 debug-print-function ${FUNCNAME} $* 551 debug-print-function ${FUNCNAME} $*
535 552
536 java-pkg_check-phase install 553 java-pkg_check-phase install
537
538 [[ ${#} -lt 1 ]] && die "Need at least one argument"
539
540 java-pkg_init_paths_ 554 java-pkg_init_paths_
541 555
556 if [[ ${#} = 0 ]]; then
557 local name="${PN}"
558 else
542 local name="${1}" 559 local name="${1}"
560 shift
561 fi
562
543 # TODO rename to launcher 563 # TODO rename to launcher
544 local target="${T}/${name}" 564 local target="${T}/${name}"
545 local var_tmp="${T}/launcher_variables_tmp" 565 local var_tmp="${T}/launcher_variables_tmp"
546 local target_dir pre 566 local target_dir pre
547 shift
548 567
549 # Process the other the rest of the arguments 568 # Process the other the rest of the arguments
550 while [[ -n "${1}" && -n "${2}" ]]; do 569 while [[ -n "${1}" && -n "${2}" ]]; do
551 local var=${1} value=${2} 570 local var=${1} value=${2}
552 if [[ "${var:0:2}" == "--" ]]; then 571 if [[ "${var:0:2}" == "--" ]]; then
572 local var=${var:2}
553 echo "gjl_${var:2}=\"${value}\"" >> "${var_tmp}" 573 echo "gjl_${var}=\"${value}\"" >> "${var_tmp}"
574 local gjl_${var}="${value}"
554 elif [[ "${var}" == "-into" ]]; then 575 elif [[ "${var}" == "-into" ]]; then
555 target_dir="${value}" 576 target_dir="${value}"
556 elif [[ "${var}" == "-pre" ]]; then 577 elif [[ "${var}" == "-pre" ]]; then
557 pre="${value}" 578 pre="${value}"
558 fi 579 fi
559 shift 2 580 shift 2
560 done 581 done
582
583 # Test if no --jar and --main arguments were given and
584 # in that case check if the package only installs one jar
585 # and use that jar.
586 if [[ -z "${gjl_jar}" && -z "${gjl_main}" ]]; then
587 local cp="${JAVA_PKG_CLASSPATH}"
588 if [[ "${cp/:}" = "${cp}" && "${cp%.jar}" != "${cp}" ]]; then
589 echo "gjl_jar=\"${JAVA_PKG_CLASSPATH}\"" >> "${var_tmp}"
590 else
591 local msg="Not enough information to create a launcher given."
592 msg="${msg} Please give --jar or --main argument to ${FUNCNAME}."
593 die "${msg}"
594 fi
595 fi
561 596
562 # Write the actual script 597 # Write the actual script
563 echo "#!/bin/bash" > "${target}" 598 echo "#!/bin/bash" > "${target}"
564 [[ -n "${pre}" ]] && [[ -f "${pre}" ]] && cat "${pre}" >> "${target}" 599 [[ -n "${pre}" ]] && [[ -f "${pre}" ]] && cat "${pre}" >> "${target}"
565 echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}" 600 echo "gjl_package=${JAVA_PKG_NAME}" >> "${target}"
566 cat "${var_tmp}" >> "${target}" 601 cat "${var_tmp}" >> "${target}"
602 rm -f "${var_tmp}"
567 echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}" 603 echo "source /usr/share/java-config-2/launcher/launcher.bash" >> "${target}"
568 604
569 if [[ -n "${target_dir}" ]]; then 605 if [[ -n "${target_dir}" ]]; then
570 DESTTREE="${target_dir}" dobin "${target}" 606 DESTTREE="${target_dir}" dobin "${target}"
571 local ret=$? 607 local ret=$?
740# The providing packages are recorded as dependencies into package.env DEPEND 776# The providing packages are recorded as dependencies into package.env DEPEND
741# line, unless "--build-only" is passed as the very first argument, for jars 777# line, unless "--build-only" is passed as the very first argument, for jars
742# that have to be present only at build time and are not needed on runtime 778# that have to be present only at build time and are not needed on runtime
743# (junit testing etc). 779# (junit testing etc).
744# 780#
745# Example: Get the classpath for xerces-2, 781# Example: Get the classpath for xerces-2 and xalan,
746# java-pkg_getjars xerces-2 xalan 782# java-pkg_getjars xerces-2,xalan
747# Example Return: 783# Example Return:
748# /usr/share/xerces-2/lib/xml-apis.jar:/usr/share/xerces-2/lib/xmlParserAPIs.jar:/usr/share/xalan/lib/xalan.jar 784# /usr/share/xerces-2/lib/xml-apis.jar:/usr/share/xerces-2/lib/xmlParserAPIs.jar:/usr/share/xalan/lib/xalan.jar
749# 785#
750# @param $1 - (optional) "--build-only" makes the jar(s) not added into 786# @param $1 - (optional) "--build-only" makes the jar(s) not added into
751# package.env DEPEND line. 787# package.env DEPEND line.
752# @param $@ - list of packages to get jars from 788# @param $2 - list of packages to get jars from
789# (passed to java-config --classpath)
753# ------------------------------------------------------------------------------ 790# ------------------------------------------------------------------------------
754java-pkg_getjars() { 791java-pkg_getjars() {
755 debug-print-function ${FUNCNAME} $* 792 debug-print-function ${FUNCNAME} $*
756 793
757 local build_only="" 794 [[ ${#} -lt 1 || ${#} -gt 2 ]] && die "${FUNCNAME} takes only one or two arguments"
758 795
759 if [[ "${1}" = "--build-only" ]]; then 796 if [[ "${1}" = "--build-only" ]]; then
760 build_only="true" 797 local build_only="true"
761 shift 798 shift
762 fi 799 fi
763 800
764 [[ ${#} -lt 1 ]] && die "At least one argument needed"
765
766 # NOTE could probably just pass $@ to java-config --classpath. and return it
767 local classpath pkg 801 local classpath pkgs="${1}"
768 for pkg in ${@//,/ }; do
769 #for pkg in $(echo "$@" | tr ',' ' '); do
770 jars="$(java-config --classpath=${pkg})" 802 jars="$(java-config --classpath=${pkgs})"
771 [[ -z "${jars}" ]] && die "java-config --classpath=${pkg} failed" 803 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
772 debug-print "${pkg}:${jars}" 804 debug-print "${pkgs}:${jars}"
773 805
774 if [[ -z "${classpath}" ]]; then 806 if [[ -z "${classpath}" ]]; then
775 classpath="${jars}" 807 classpath="${jars}"
776 else 808 else
777 classpath="${classpath}:${jars}" 809 classpath="${classpath}:${jars}"
778 fi 810 fi
811
779 # Only record jars that aren't build-only 812 # Only record jars that aren't build-only
780 [[ -z "${build_only}" ]] && java-pkg_record-jar_ "${pkg}" 813 if [[ -z "${build_only}" ]]; then
814 oldifs="${IFS}"
815 IFS=","
816 for pkg in ${pkgs}; do
817 java-pkg_record-jar_ "${pkg}"
781 done 818 done
819 IFS="${oldifs}"
820 fi
821
782 echo "${classpath}" 822 echo "${classpath}"
783} 823}
784 824
785# ------------------------------------------------------------------------------ 825# ------------------------------------------------------------------------------
786# @ebuild-function java-pkg_getjar 826# @ebuild-function java-pkg_getjar
1159} 1199}
1160 1200
1161java-pkg_get-javac() { 1201java-pkg_get-javac() {
1162 debug-print-function ${FUNCNAME} $* 1202 debug-print-function ${FUNCNAME} $*
1163 1203
1164 java-pkg_init-compiler_ 1204
1165 local compiler="${GENTOO_COMPILER}" 1205 local compiler="${GENTOO_COMPILER}"
1166 1206
1167 local compiler_executable 1207 local compiler_executable
1168 if [[ "${compiler}" = "javac" ]]; then 1208 if [[ "${compiler}" = "javac" ]]; then
1169 # nothing fancy needs to be done for javac 1209 # nothing fancy needs to be done for javac
1177 unset JAVAC 1217 unset JAVAC
1178 # try to get value of JAVAC 1218 # try to get value of JAVAC
1179 compiler_executable="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${JAVAC})" 1219 compiler_executable="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${JAVAC})"
1180 export JAVAC=${old_javac} 1220 export JAVAC=${old_javac}
1181 1221
1182 [[ -z ${compiler_executable} ]] && die "JAVAC is empty or undefined in ${compiler_env}" 1222 if [[ -z ${compiler_executable} ]]; then
1223 echo "JAVAC is empty or undefined in ${compiler_env}"
1224 return 1
1225 fi
1183 1226
1184 # check that it's executable 1227 # check that it's executable
1185 if [[ ! -x ${compiler_executable} ]]; then 1228 if [[ ! -x ${compiler_executable} ]]; then
1186 eerror "Could not find ${compiler_executable}!"
1187 die "${compiler_executable} doesn't exist, or isn't executable" 1229 echo "${compiler_executable} doesn't exist, or isn't executable"
1230 return 1
1188 fi 1231 fi
1189 else 1232 else
1190 eerror "Could not find environment file for ${compiler}" 1233 echo "Could not find environment file for ${compiler}"
1191 die "Could not find ${compiler_env}" 1234 return 1
1192 fi 1235 fi
1193 fi 1236 fi
1194 echo ${compiler_executable} 1237 echo ${compiler_executable}
1195} 1238}
1196 1239
1213 1256
1214 debug-print "want source: ${want_source}" 1257 debug-print "want source: ${want_source}"
1215 debug-print "want target: ${want_target}" 1258 debug-print "want target: ${want_target}"
1216 1259
1217 if [[ -z "${want_source}" || -z "${want_target}" ]]; then 1260 if [[ -z "${want_source}" || -z "${want_target}" ]]; then
1218 debug-print "could not find valid -source/-target values" 1261 debug-print "could not find valid -source/-target values for javac"
1219 die "Could not find valid -source/-target values" 1262 echo "Could not find valid -source/-target values for javac"
1263 return 1
1220 else 1264 else
1221 if java-pkg_is-vm-version-ge "1.4"; then 1265 if java-pkg_is-vm-version-ge "1.4"; then
1222 echo "${source_str} ${target_str}" 1266 echo "${source_str} ${target_str}"
1223 else 1267 else
1224 echo "${target_str}" 1268 echo "${target_str}"
1228 1272
1229# TODO document 1273# TODO document
1230java-pkg_get-jni-cflags() { 1274java-pkg_get-jni-cflags() {
1231 local flags="-I${JAVA_HOME}/include" 1275 local flags="-I${JAVA_HOME}/include"
1232 1276
1277 local platform="linux"
1278 use elibc_FreeBSD && platform="freebsd"
1279
1233 # TODO do a check that the directories are valid 1280 # TODO do a check that the directories are valid
1234 # TODO figure out how to cope with other things than linux...
1235 flags="${flags} -I${JAVA_HOME}/include/linux" 1281 flags="${flags} -I${JAVA_HOME}/include/${platform}"
1236 1282
1237 echo ${flags} 1283 echo ${flags}
1238} 1284}
1239 1285
1240java-pkg_ensure-gcj() { 1286java-pkg_ensure-gcj() {
1329# @param $@ - Arguments to be passed to the compiler 1375# @param $@ - Arguments to be passed to the compiler
1330# ------------------------------------------------------------------------------ 1376# ------------------------------------------------------------------------------
1331ejavac() { 1377ejavac() {
1332 debug-print-function ${FUNCNAME} $* 1378 debug-print-function ${FUNCNAME} $*
1333 1379
1334 # FIXME using get-javac ends up printing stuff with einfo 1380 java-pkg_init-compiler_
1381
1382 local compiler_executable
1335# local compiler_executable=$(java-pkg_get-javac) 1383 compiler_executable=$(java-pkg_get-javac)
1336 local compiler_executable="javac" 1384 if [[ ${?} != 0 ]]; then
1385 eerror "There was a problem determining compiler: ${compiler_executable}"
1386 die "get-javac failed"
1387 fi
1337 1388
1389 local javac_args
1390 javac_args="$(java-pkg_javac-args)"
1391 if [[ ${?} != 0 ]]; then
1392 eerror "There was a problem determining JAVACFLAGS: ${javac_args}"
1393 die "java-pkg_javac-args failed"
1394 fi
1395
1338 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} $(java-pkg_javac-args) "${@}" 1396 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}"
1339 ${compiler_executable} $(java-pkg_javac-args) "${@}" || die "ejavac failed" 1397 ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed"
1340} 1398}
1341 1399
1342# ------------------------------------------------------------------------------ 1400# ------------------------------------------------------------------------------
1343# @ebuild-function java-pkg_filter-compiler 1401# @ebuild-function java-pkg_filter-compiler
1344# 1402#
1576# Writes the package.env out to disk. 1634# Writes the package.env out to disk.
1577# 1635#
1578# ------------------------------------------------------------------------------ 1636# ------------------------------------------------------------------------------
1579# TODO change to do-write, to match everything else 1637# TODO change to do-write, to match everything else
1580java-pkg_do_write_() { 1638java-pkg_do_write_() {
1639 java-pkg_init_paths_
1581 # Create directory for package.env 1640 # Create directory for package.env
1582 dodir "${JAVA_PKG_SHAREPATH}" 1641 dodir "${JAVA_PKG_SHAREPATH}"
1583 if [[ -n "${JAVA_PKG_CLASSPATH}" || -n "${JAVA_PKG_LIBRARY}" || -f "${JAVA_PKG_DEPEND}" ]]; then 1642 if [[ -n "${JAVA_PKG_CLASSPATH}" || -n "${JAVA_PKG_LIBRARY}" || -f "${JAVA_PKG_DEPEND}" ]]; then
1584 # Create package.env 1643 # Create package.env
1585 ( 1644 (
1613 # Strip unnecessary leading and trailing colons 1672 # Strip unnecessary leading and trailing colons
1614 # TODO try to cleanup if possible 1673 # TODO try to cleanup if possible
1615 sed -e "s/=\":/=\"/" -e "s/:\"$/\"/" -i "${JAVA_PKG_ENV}" || die "Did you forget to call java_init ?" 1674 sed -e "s/=\":/=\"/" -e "s/:\"$/\"/" -i "${JAVA_PKG_ENV}" || die "Did you forget to call java_init ?"
1616 fi 1675 fi
1617} 1676}
1618
1619 1677
1620# ------------------------------------------------------------------------------ 1678# ------------------------------------------------------------------------------
1621# @internal-function java-pkg_record-jar_ 1679# @internal-function java-pkg_record-jar_
1622# 1680#
1623# Record a dependency to the package.env 1681# Record a dependency to the package.env
1704# ------------------------------------------------------------------------------ 1762# ------------------------------------------------------------------------------
1705java-pkg_setup-vm() { 1763java-pkg_setup-vm() {
1706 debug-print-function ${FUNCNAME} $* 1764 debug-print-function ${FUNCNAME} $*
1707 1765
1708 local vendor="$(java-pkg_get-vm-vendor)" 1766 local vendor="$(java-pkg_get-vm-vendor)"
1709 if [[ "${vendor}" == "sun" ]] && java-pkg_is-vm-version-ge 1 5; then 1767 if [[ "${vendor}" == "sun" ]] && java-pkg_is-vm-version-ge "1.5" ; then
1710 addpredict "/dev/random" 1768 addpredict "/dev/random"
1711 elif [[ "${vendor}" == "ibm" ]]; then 1769 elif [[ "${vendor}" == "ibm" ]]; then
1712 addpredict "/proc/self/maps" 1770 addpredict "/proc/self/maps"
1713 addpredict "/proc/cpuinfo" 1771 addpredict "/proc/cpuinfo"
1714 export LANG="C" LC_ALL="C" 1772 export LANG="C" LC_ALL="C"
1763# @return - The version of the current VM 1821# @return - The version of the current VM
1764# ------------------------------------------------------------------------------ 1822# ------------------------------------------------------------------------------
1765java-pkg_get-vm-version() { 1823java-pkg_get-vm-version() {
1766 debug-print-function ${FUNCNAME} $* 1824 debug-print-function ${FUNCNAME} $*
1767 1825
1768 java-pkg_get-current-vm | sed -e "s/.*-\([0-9.]\+\).*/\1/" 1826 java-config -g PROVIDES_VERSION
1769} 1827}
1770 1828
1771# ------------------------------------------------------------------------------ 1829# ------------------------------------------------------------------------------
1772# @internal-function java-pkg_switch-vm 1830# @internal-function java-pkg_switch-vm
1773# 1831#
1783 export GENTOO_VM="${JAVA_PKG_FORCE_VM}" 1841 export GENTOO_VM="${JAVA_PKG_FORCE_VM}"
1784 # if we're allowed to switch the vm... 1842 # if we're allowed to switch the vm...
1785 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then 1843 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then
1786 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}" 1844 debug-print "depend-java-query: NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}} VNEED: ${JAVA_PKG_VNEED}"
1787 if [[ -n ${JAVA_PKG_VNEED} ]]; then 1845 if [[ -n ${JAVA_PKG_VNEED} ]]; then
1788 export GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" 1846 GENTOO_VM="$(depend-java-query --need-virtual "${JAVA_PKG_VNEED}" --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
1789 else 1847 else
1790 export GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")" 1848 GENTOO_VM="$(depend-java-query --get-vm "${JAVA_PKG_NV_DEPEND:-${DEPEND}}")"
1849 fi
1850 if [[ -z "${GENTOO_VM}" || "${GENTOO_VM}" == "None" ]]; then
1851 eerror "Unable to determine VM for building from dependencies:"
1852 echo "NV_DEPEND: ${JAVA_PKG_NV_DEPEND:-${DEPEND}}"
1853 echo "VNEED: ${JAVA_PKG_VNEED}"
1854 die "Failed to determine VM for building."
1855 else
1856 export GENTOO_VM
1791 fi 1857 fi
1792 # otherwise just make sure the current VM is sufficient 1858 # otherwise just make sure the current VM is sufficient
1793 else 1859 else
1794 java-pkg_ensure-vm-version-sufficient 1860 java-pkg_ensure-vm-version-sufficient
1795 fi 1861 fi
1797 1863
1798 java-pkg_setup-vm 1864 java-pkg_setup-vm
1799 1865
1800 export JAVA=$(java-config --java) 1866 export JAVA=$(java-config --java)
1801 export JAVAC=$(java-config --javac) 1867 export JAVAC=$(java-config --javac)
1802 export JAVACFLAGS="$(java-pkg_javac-args)" 1868 JAVACFLAGS="$(java-pkg_javac-args)"
1869 if [[ ${?} != 0 ]]; then
1870 eerror "There was a problem determining JAVACFLAGS: ${JAVACFLAGS}"
1871 die "java-pkg_javac-args failed"
1872 fi
1803 [[ -n ${JAVACFLAGS_EXTRA} ]] && export JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}" 1873 [[ -n ${JAVACFLAGS_EXTRA} ]] && JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}"
1874 export JAVACFLAGS
1804 1875
1805 export JAVA_HOME="$(java-config -g JAVA_HOME)" 1876 export JAVA_HOME="$(java-config -g JAVA_HOME)"
1806 export JDK_HOME=${JAVA_HOME} 1877 export JDK_HOME=${JAVA_HOME}
1807 1878
1808 #TODO If you know a better solution let us know. 1879 #TODO If you know a better solution let us know.
1870 ewarn "Possible problem" 1941 ewarn "Possible problem"
1871 die "Bad class files found" 1942 die "Bad class files found"
1872 fi 1943 fi
1873} 1944}
1874 1945
1875
1876# ------------------------------------------------------------------------------ 1946# ------------------------------------------------------------------------------
1877# @section-end internal 1947# @section-end internal
1878# ------------------------------------------------------------------------------ 1948# ------------------------------------------------------------------------------
1879 1949
1880java-pkg_check-phase() { 1950java-pkg_check-phase() {

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.20