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

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

  ViewVC Help
Powered by ViewVC 1.1.20