/[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.22 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}"
741# The providing packages are recorded as dependencies into package.env DEPEND 775# The providing packages are recorded as dependencies into package.env DEPEND
742# 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
743# 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
744# (junit testing etc). 778# (junit testing etc).
745# 779#
746# Example: Get the classpath for xerces-2, 780# Example: Get the classpath for xerces-2 and xalan,
747# java-pkg_getjars xerces-2 xalan 781# java-pkg_getjars xerces-2,xalan
748# Example Return: 782# Example Return:
749# /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
750# 784#
751# @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
752# package.env DEPEND line. 786# package.env DEPEND line.
753# @param $@ - list of packages to get jars from 787# @param $2 - list of packages to get jars from
788# (passed to java-config --classpath)
754# ------------------------------------------------------------------------------ 789# ------------------------------------------------------------------------------
755java-pkg_getjars() { 790java-pkg_getjars() {
756 debug-print-function ${FUNCNAME} $* 791 debug-print-function ${FUNCNAME} $*
757 792
758 local build_only="" 793 [[ ${#} -lt 1 || ${#} -gt 2 ]] && die "${FUNCNAME} takes only one or two arguments"
759 794
760 if [[ "${1}" = "--build-only" ]]; then 795 if [[ "${1}" = "--build-only" ]]; then
761 build_only="true" 796 local build_only="true"
762 shift 797 shift
763 fi 798 fi
764 799
765 [[ ${#} -lt 1 ]] && die "At least one argument needed"
766
767 # NOTE could probably just pass $@ to java-config --classpath. and return it
768 local classpath pkg 800 local classpath pkgs="${1}"
769 for pkg in ${@//,/ }; do
770 #for pkg in $(echo "$@" | tr ',' ' '); do
771 jars="$(java-config --classpath=${pkg})" 801 jars="$(java-config --classpath=${pkgs})"
772 [[ -z "${jars}" ]] && die "java-config --classpath=${pkg} failed" 802 [[ -z "${jars}" ]] && die "java-config --classpath=${pkgs} failed"
773 debug-print "${pkg}:${jars}" 803 debug-print "${pkgs}:${jars}"
774 804
775 if [[ -z "${classpath}" ]]; then 805 if [[ -z "${classpath}" ]]; then
776 classpath="${jars}" 806 classpath="${jars}"
777 else 807 else
778 classpath="${classpath}:${jars}" 808 classpath="${classpath}:${jars}"
779 fi 809 fi
810
780 # Only record jars that aren't build-only 811 # Only record jars that aren't build-only
781 [[ -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}"
782 done 817 done
818 IFS="${oldifs}"
819 fi
820
783 echo "${classpath}" 821 echo "${classpath}"
784} 822}
785 823
786# ------------------------------------------------------------------------------ 824# ------------------------------------------------------------------------------
787# @ebuild-function java-pkg_getjar 825# @ebuild-function java-pkg_getjar
1160} 1198}
1161 1199
1162java-pkg_get-javac() { 1200java-pkg_get-javac() {
1163 debug-print-function ${FUNCNAME} $* 1201 debug-print-function ${FUNCNAME} $*
1164 1202
1165 java-pkg_init-compiler_ 1203
1166 local compiler="${GENTOO_COMPILER}" 1204 local compiler="${GENTOO_COMPILER}"
1167 1205
1168 local compiler_executable 1206 local compiler_executable
1169 if [[ "${compiler}" = "javac" ]]; then 1207 if [[ "${compiler}" = "javac" ]]; then
1170 # nothing fancy needs to be done for javac 1208 # nothing fancy needs to be done for javac
1178 unset JAVAC 1216 unset JAVAC
1179 # try to get value of JAVAC 1217 # try to get value of JAVAC
1180 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})"
1181 export JAVAC=${old_javac} 1219 export JAVAC=${old_javac}
1182 1220
1183 [[ -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
1184 1225
1185 # check that it's executable 1226 # check that it's executable
1186 if [[ ! -x ${compiler_executable} ]]; then 1227 if [[ ! -x ${compiler_executable} ]]; then
1187 eerror "Could not find ${compiler_executable}!"
1188 die "${compiler_executable} doesn't exist, or isn't executable" 1228 echo "${compiler_executable} doesn't exist, or isn't executable"
1229 return 1
1189 fi 1230 fi
1190 else 1231 else
1191 eerror "Could not find environment file for ${compiler}" 1232 echo "Could not find environment file for ${compiler}"
1192 die "Could not find ${compiler_env}" 1233 return 1
1193 fi 1234 fi
1194 fi 1235 fi
1195 echo ${compiler_executable} 1236 echo ${compiler_executable}
1196} 1237}
1197 1238
1214 1255
1215 debug-print "want source: ${want_source}" 1256 debug-print "want source: ${want_source}"
1216 debug-print "want target: ${want_target}" 1257 debug-print "want target: ${want_target}"
1217 1258
1218 if [[ -z "${want_source}" || -z "${want_target}" ]]; then 1259 if [[ -z "${want_source}" || -z "${want_target}" ]]; then
1219 debug-print "could not find valid -source/-target values" 1260 debug-print "could not find valid -source/-target values for javac"
1220 die "Could not find valid -source/-target values" 1261 echo "Could not find valid -source/-target values for javac"
1262 return 1
1221 else 1263 else
1222 if java-pkg_is-vm-version-ge "1.4"; then 1264 if java-pkg_is-vm-version-ge "1.4"; then
1223 echo "${source_str} ${target_str}" 1265 echo "${source_str} ${target_str}"
1224 else 1266 else
1225 echo "${target_str}" 1267 echo "${target_str}"
1229 1271
1230# TODO document 1272# TODO document
1231java-pkg_get-jni-cflags() { 1273java-pkg_get-jni-cflags() {
1232 local flags="-I${JAVA_HOME}/include" 1274 local flags="-I${JAVA_HOME}/include"
1233 1275
1276 local platform="linux"
1277 use elibc_FreeBSD && platform="freebsd"
1278
1234 # TODO do a check that the directories are valid 1279 # TODO do a check that the directories are valid
1235 # TODO figure out how to cope with other things than linux...
1236 flags="${flags} -I${JAVA_HOME}/include/linux" 1280 flags="${flags} -I${JAVA_HOME}/include/${platform}"
1237 1281
1238 echo ${flags} 1282 echo ${flags}
1239} 1283}
1240 1284
1241java-pkg_ensure-gcj() { 1285java-pkg_ensure-gcj() {
1247 die "No GCJ support found!" 1291 die "No GCJ support found!"
1248 fi 1292 fi
1249} 1293}
1250 1294
1251java-pkg_ensure-test() { 1295java-pkg_ensure-test() {
1252 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
1253 eerror "You specified FEATURES=test, but USE=test is needed" 1299 eerror "You specified FEATURES=test, but USE=test is needed"
1254 eerror "to pull in the additional dependencies for testing" 1300 eerror "to pull in the additional dependencies for testing"
1255 die "Need USE=test enabled" 1301 die "Need USE=test enabled"
1256 fi 1302 fi
1257} 1303}
1330# @param $@ - Arguments to be passed to the compiler 1376# @param $@ - Arguments to be passed to the compiler
1331# ------------------------------------------------------------------------------ 1377# ------------------------------------------------------------------------------
1332ejavac() { 1378ejavac() {
1333 debug-print-function ${FUNCNAME} $* 1379 debug-print-function ${FUNCNAME} $*
1334 1380
1335 # FIXME using get-javac ends up printing stuff with einfo 1381 java-pkg_init-compiler_
1382
1383 local compiler_executable
1336# local compiler_executable=$(java-pkg_get-javac) 1384 compiler_executable=$(java-pkg_get-javac)
1337 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
1338 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
1339 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} $(java-pkg_javac-args) "${@}" 1397 [[ -n ${JAVA_PKG_DEBUG} ]] && echo ${compiler_executable} ${javac_args} "${@}"
1340 ${compiler_executable} $(java-pkg_javac-args) "${@}" || die "ejavac failed" 1398 ${compiler_executable} ${javac_args} "${@}" || die "ejavac failed"
1341} 1399}
1342 1400
1343# ------------------------------------------------------------------------------ 1401# ------------------------------------------------------------------------------
1344# @ebuild-function java-pkg_filter-compiler 1402# @ebuild-function java-pkg_filter-compiler
1345# 1403#
1577# Writes the package.env out to disk. 1635# Writes the package.env out to disk.
1578# 1636#
1579# ------------------------------------------------------------------------------ 1637# ------------------------------------------------------------------------------
1580# TODO change to do-write, to match everything else 1638# TODO change to do-write, to match everything else
1581java-pkg_do_write_() { 1639java-pkg_do_write_() {
1640 java-pkg_init_paths_
1582 # Create directory for package.env 1641 # Create directory for package.env
1583 dodir "${JAVA_PKG_SHAREPATH}" 1642 dodir "${JAVA_PKG_SHAREPATH}"
1584 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
1585 # Create package.env 1644 # Create package.env
1586 ( 1645 (
1614 # Strip unnecessary leading and trailing colons 1673 # Strip unnecessary leading and trailing colons
1615 # TODO try to cleanup if possible 1674 # TODO try to cleanup if possible
1616 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 ?"
1617 fi 1676 fi
1618} 1677}
1619
1620 1678
1621# ------------------------------------------------------------------------------ 1679# ------------------------------------------------------------------------------
1622# @internal-function java-pkg_record-jar_ 1680# @internal-function java-pkg_record-jar_
1623# 1681#
1624# Record a dependency to the package.env 1682# Record a dependency to the package.env
1705# ------------------------------------------------------------------------------ 1763# ------------------------------------------------------------------------------
1706java-pkg_setup-vm() { 1764java-pkg_setup-vm() {
1707 debug-print-function ${FUNCNAME} $* 1765 debug-print-function ${FUNCNAME} $*
1708 1766
1709 local vendor="$(java-pkg_get-vm-vendor)" 1767 local vendor="$(java-pkg_get-vm-vendor)"
1710 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
1711 addpredict "/dev/random" 1769 addpredict "/dev/random"
1712 elif [[ "${vendor}" == "ibm" ]]; then 1770 elif [[ "${vendor}" == "ibm" ]]; then
1713 addpredict "/proc/self/maps" 1771 addpredict "/proc/self/maps"
1714 addpredict "/proc/cpuinfo" 1772 addpredict "/proc/cpuinfo"
1715 export LANG="C" LC_ALL="C" 1773 export LANG="C" LC_ALL="C"
1784 export GENTOO_VM="${JAVA_PKG_FORCE_VM}" 1842 export GENTOO_VM="${JAVA_PKG_FORCE_VM}"
1785 # if we're allowed to switch the vm... 1843 # if we're allowed to switch the vm...
1786 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then 1844 elif [[ "${JAVA_PKG_ALLOW_VM_CHANGE}" == "yes" ]]; then
1787 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}"
1788 if [[ -n ${JAVA_PKG_VNEED} ]]; then 1846 if [[ -n ${JAVA_PKG_VNEED} ]]; then
1789 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}}")"
1790 else 1848 else
1791 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
1792 fi 1858 fi
1793 # otherwise just make sure the current VM is sufficient 1859 # otherwise just make sure the current VM is sufficient
1794 else 1860 else
1795 java-pkg_ensure-vm-version-sufficient 1861 java-pkg_ensure-vm-version-sufficient
1796 fi 1862 fi
1798 1864
1799 java-pkg_setup-vm 1865 java-pkg_setup-vm
1800 1866
1801 export JAVA=$(java-config --java) 1867 export JAVA=$(java-config --java)
1802 export JAVAC=$(java-config --javac) 1868 export JAVAC=$(java-config --javac)
1803 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
1804 [[ -n ${JAVACFLAGS_EXTRA} ]] && export JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}" 1874 [[ -n ${JAVACFLAGS_EXTRA} ]] && JAVACFLAGS="${JAVACFLAGS_EXTRA} ${JAVACFLAGS}"
1875 export JAVACFLAGS
1805 1876
1806 export JAVA_HOME="$(java-config -g JAVA_HOME)" 1877 export JAVA_HOME="$(java-config -g JAVA_HOME)"
1807 export JDK_HOME=${JAVA_HOME} 1878 export JDK_HOME=${JAVA_HOME}
1808 1879
1809 #TODO If you know a better solution let us know. 1880 #TODO If you know a better solution let us know.
1871 ewarn "Possible problem" 1942 ewarn "Possible problem"
1872 die "Bad class files found" 1943 die "Bad class files found"
1873 fi 1944 fi
1874} 1945}
1875 1946
1876
1877# ------------------------------------------------------------------------------ 1947# ------------------------------------------------------------------------------
1878# @section-end internal 1948# @section-end internal
1879# ------------------------------------------------------------------------------ 1949# ------------------------------------------------------------------------------
1880 1950
1881java-pkg_check-phase() { 1951java-pkg_check-phase() {

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

  ViewVC Help
Powered by ViewVC 1.1.20