/[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.91 Revision 1.92
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.91 2007/07/20 18:36:02 betelgeuse Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.92 2007/08/05 08:17:05 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
57#WANT_ANT_TASKS 57#WANT_ANT_TASKS
58 58
59# ----------------------------------------------------------------------------- 59# -----------------------------------------------------------------------------
60# @variable-internal JAVA_PKG_PORTAGE_DEP 60# @variable-internal JAVA_PKG_PORTAGE_DEP
61# 61#
62# The version of portage we need to function properly. At this moment it's 62# The version of portage we need to function properly. Previously it was
63# portage with phase hooks support. 63# portage with phase hooks support but now we use a version with proper env
64# saving.
64# ----------------------------------------------------------------------------- 65# -----------------------------------------------------------------------------
65JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1_pre1" 66JAVA_PKG_PORTAGE_DEP=">=sys-apps/portage-2.1.2.7"
66 67
67# ----------------------------------------------------------------------------- 68# -----------------------------------------------------------------------------
68# @variable-internal JAVA_PKG_E_DEPEND 69# @variable-internal JAVA_PKG_E_DEPEND
69# 70#
70# This is a convience variable to be used from the other java eclasses. This is 71# This is a convience variable to be used from the other java eclasses. This is
1779# compiler. Will also set proper ANT_TASKS from the variable ANT_TASKS, 1780# compiler. Will also set proper ANT_TASKS from the variable ANT_TASKS,
1780# variables: 1781# variables:
1781# EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the 1782# EANT_GENTOO_CLASSPATH - calls java-pkg_getjars for the value and adds to the
1782# gentoo.classpath property. Be sure to call 1783# gentoo.classpath property. Be sure to call
1783# java-ant_rewrite-classpath in src_unpack. 1784# java-ant_rewrite-classpath in src_unpack.
1785# JAVA_PKG_NO_BUNDLED_SEARCH - Don't search for bundled jars or class files
1784# *ANT_TASKS - used to determine ANT_TASKS before calling Ant. 1786# *ANT_TASKS - used to determine ANT_TASKS before calling Ant.
1785# ------------------------------------------------------------------------------ 1787# ------------------------------------------------------------------------------
1786eant() { 1788eant() {
1787 debug-print-function ${FUNCNAME} $* 1789 debug-print-function ${FUNCNAME} $*
1790
1791 if [[ ${EBUILD_PHASE} = compile ]]; then
1792 # Used to be done in hooks in java-ant-2.eclass but moved here so that we can
1793 # finally get rid of the hooks without breaking stuff
1794
1795 [[ "${JAVA_ANT_IGNORE_SYSTEM_CLASSES}" && "${JAVA_PKG_BSFIX}" ]] \
1796 && java-ant_ignore-system-classes "${S}/build.xml"
1797
1798 if hasq java-ant-2 ${INHERITED}; then
1799 java-ant_bsfix
1800 fi
1801
1802 # eant can be called multiple times
1803 JAVA_PKG_BSFIX="off"
1804
1805 if [[ -z ${JAVA_PKG_NO_BUNDLED_SEARCH} ]] && is-java-strict; then
1806 echo "Searching for bundled jars:"
1807 java-pkg_find-normal-jars || echo "None found."
1808 echo "Searching for bundled classes (no output if none found):"
1809 find "${WORKDIR}" -name "*.class"
1810 echo "Search done."
1811 JAVA_PKG_NO_BUNDLED_SEARCH=true # eant can be called many times
1812 fi
1813 fi
1788 1814
1789 if ! hasq java-ant-2 ${INHERITED}; then 1815 if ! hasq java-ant-2 ${INHERITED}; then
1790 local msg="You should inherit java-ant-2 when using eant" 1816 local msg="You should inherit java-ant-2 when using eant"
1791 java-pkg_announce-qa-violation "${msg}" 1817 java-pkg_announce-qa-violation "${msg}"
1792 fi 1818 fi
1795 1821
1796 java-pkg_init-compiler_ 1822 java-pkg_init-compiler_
1797 local compiler="${GENTOO_COMPILER}" 1823 local compiler="${GENTOO_COMPILER}"
1798 1824
1799 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" 1825 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1800
1801 local build_compiler="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER})" 1826 local build_compiler="$(source ${compiler_env} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER})"
1802 if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then 1827 if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then
1803 die "ANT_BUILD_COMPILER undefined in ${compiler_env}" 1828 die "ANT_BUILD_COMPILER undefined in ${compiler_env}"
1804 fi 1829 fi
1805 1830
2014 2039
2015 if [[ -z ${accept} ]]; then 2040 if [[ -z ${accept} ]]; then
2016 unset _JAVA_OPTIONS 2041 unset _JAVA_OPTIONS
2017 # phase hooks make this run many times without this 2042 # phase hooks make this run many times without this
2018 I_WANT_GLOBAL_JAVA_OPTIONS="true" 2043 I_WANT_GLOBAL_JAVA_OPTIONS="true"
2044 fi
2045
2046 if java-pkg_func-exists ant_src_unpack; then
2047 java-pkg_announce-qa-violation "Using old ant_src_unpack. Should be src_unpack"
2019 fi 2048 fi
2020 2049
2021 java-pkg_init_paths_ 2050 java-pkg_init_paths_
2022 java-pkg_switch-vm 2051 java-pkg_switch-vm
2023 PATH=${JAVA_HOME}/bin:${PATH} 2052 PATH=${JAVA_HOME}/bin:${PATH}
2462 2491
2463 #TODO If you know a better solution let us know. 2492 #TODO If you know a better solution let us know.
2464 java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)" 2493 java-pkg_append_ LD_LIBRARY_PATH "$(java-config -g LDPATH)"
2465 2494
2466 local tann="${T}/announced-vm" 2495 local tann="${T}/announced-vm"
2496 # With the hooks we should only get here once from pkg_setup but better safe than sorry
2497 # if people have for example modified eclasses some where
2467 if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then 2498 if [[ -n "${JAVA_PKG_DEBUG}" ]] || [[ ! -f "${tann}" ]] ; then
2468 # Add a check for setup/preinst phase... to avoid duplicate outputs
2469 # for when FEATURES=buildpkg
2470 if [[ ${EBUILD_PHASE} != "setup" && ${EBUILD_PHASE} != "preinst" && ${EBUILD_PHASE} != "postinst" ]];
2471 then
2472 einfo "Using: $(java-config -f)" 2499 einfo "Using: $(java-config -f)"
2473 [[ ! -f "${tann}" ]] && touch "${tann}" 2500 [[ ! -f "${tann}" ]] && touch "${tann}"
2474 fi
2475 fi 2501 fi
2476 2502
2477 else 2503 else
2478 [[ -n "${JAVA_PKG_DEBUG}" ]] && ewarn "!!! This package inherits java-pkg but doesn't depend on a JDK. -bin or broken dependency!!!" 2504 [[ -n "${JAVA_PKG_DEBUG}" ]] && ewarn "!!! This package inherits java-pkg but doesn't depend on a JDK. -bin or broken dependency!!!"
2479 fi 2505 fi

Legend:
Removed from v.1.91  
changed lines
  Added in v.1.92

  ViewVC Help
Powered by ViewVC 1.1.20