/[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.33 Revision 1.37
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# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.37 2006/12/31 01:39:38 caster Exp $
10 10
11 11
12# ----------------------------------------------------------------------------- 12# -----------------------------------------------------------------------------
13# @eclass-begin 13# @eclass-begin
14# @eclass-shortdesc Java Utility eclass 14# @eclass-shortdesc Java Utility eclass
203 203
204 java-pkg_do_write_ 204 java-pkg_do_write_
205} 205}
206 206
207 207
208# ------------------------------------------------------------------------------
209# @internal-function depend-java-query
210#
211# Wrapper for the depend-java-query binary to enable passing USE in env.
212# Using env variables keeps this eclass working with java-config versions that
213# do not handle use flags.
214# ------------------------------------------------------------------------------
215
216depend-java-query() {
217 USE="${USE}" $(which depend-java-query) "${@}"
218}
208 219
209# ------------------------------------------------------------------------------ 220# ------------------------------------------------------------------------------
210# @ebuild-function java-pkg_regjar 221# @ebuild-function java-pkg_regjar
211# 222#
212# Records an already installed jar in the package.env 223# Records an already installed jar in the package.env
261 fi 272 fi
262 done 273 done
263 274
264 java-pkg_do_write_ 275 java-pkg_do_write_
265} 276}
266
267 277
268# ------------------------------------------------------------------------------ 278# ------------------------------------------------------------------------------
269# @ebuild-function java-pkg_newjar 279# @ebuild-function java-pkg_newjar
270# 280#
271# Installs a jar with a new name 281# Installs a jar with a new name
1174# @ebuild-function java-pkg_get-target 1184# @ebuild-function java-pkg_get-target
1175# 1185#
1176# Determines what target version should be used, for passing to -target. 1186# Determines what target version should be used, for passing to -target.
1177# If you don't care about lower versions, you can set _WANT_TARGET to the 1187# If you don't care about lower versions, you can set _WANT_TARGET to the
1178# version of your JDK. 1188# version of your JDK.
1179# Remember doing this will mostly like cause things to break.
1180# Doesn't allow it to be lower then the one in depend.
1181# Doesn't allow it to be higher then the active vm.
1182# 1189#
1183# @return string - Either the lowest possible target, or JAVA_PKG_WANT_TARGET 1190# @return string - Either the lowest possible target, or JAVA_PKG_WANT_TARGET
1184# ------------------------------------------------------------------------------ 1191# ------------------------------------------------------------------------------
1185java-pkg_get-target() { 1192java-pkg_get-target() {
1186 local min=$(depend-java-query --get-lowest "${DEPEND} ${RDEPEND}")
1187 if [[ -n "${JAVA_PKG_WANT_TARGET}" ]]; then
1188 local max="$(java-config --select-vm "${GENTOO_VM}" -g PROVIDES_VERSION)"
1189 if version_is_at_least "${min}" "${JAVA_PKG_WANT_TARGET}" && version_is_at_least "${JAVA_PKG_WANT_TARGET}" "${max}"; then
1190 echo ${JAVA_PKG_WANT_TARGET}
1191 else
1192 echo ${min}
1193 fi
1194 else
1195 echo ${min}
1196 fi
1197
1198 #echo ${JAVA_PKG_WANT_TARGET:-$(depend-java-query --get-lowest "${DEPEND}")} 1193 echo ${JAVA_PKG_WANT_TARGET:-$(depend-java-query --get-lowest "${DEPEND} ${RDEPEND}")}
1199} 1194}
1200 1195
1201java-pkg_get-javac() { 1196java-pkg_get-javac() {
1202 debug-print-function ${FUNCNAME} $* 1197 debug-print-function ${FUNCNAME} $*
1203 1198
1292 die "No GCJ support found!" 1287 die "No GCJ support found!"
1293 fi 1288 fi
1294} 1289}
1295 1290
1296java-pkg_ensure-test() { 1291java-pkg_ensure-test() {
1297 if hasq test ${FEATURES} && ! hasq -test ${FEATURES} && ! use test; then 1292 if hasq test ${FEATURES} && ! hasq -test ${FEATURES} \
1293 && hasq test ${IUSE} && ! use test;
1294 then
1298 eerror "You specified FEATURES=test, but USE=test is needed" 1295 eerror "You specified FEATURES=test, but USE=test is needed"
1299 eerror "to pull in the additional dependencies for testing" 1296 eerror "to pull in the additional dependencies for testing"
1300 die "Need USE=test enabled" 1297 die "Need USE=test enabled"
1301 fi 1298 fi
1302} 1299}
1327# if is-java-strict && [[ ! ${DEPEND} =~ "dev-java/ant" ]]; then 1324# if is-java-strict && [[ ! ${DEPEND} =~ "dev-java/ant" ]]; then
1328# java-pkg_announce-qa-violation \ 1325# java-pkg_announce-qa-violation \
1329# "Using eant, but not depending on dev-java/ant or dev-java/ant-core" 1326# "Using eant, but not depending on dev-java/ant or dev-java/ant-core"
1330# fi 1327# fi
1331 1328
1332 local antflags 1329 local antflags="-Dnoget=true"
1333 java-pkg_init-compiler_ 1330 java-pkg_init-compiler_
1334 local compiler="${GENTOO_COMPILER}" 1331 local compiler="${GENTOO_COMPILER}"
1335 1332
1336 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}" 1333 local compiler_env="${JAVA_PKG_COMPILER_DIR}/${compiler}"
1337 1334
1339 if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then 1336 if [[ "${compiler}" != "javac" && -z "${build_compiler}" ]]; then
1340 die "ANT_BUILD_COMPILER undefined in ${compiler_env}" 1337 die "ANT_BUILD_COMPILER undefined in ${compiler_env}"
1341 fi 1338 fi
1342 1339
1343 if [[ ${compiler} != "javac" ]]; then 1340 if [[ ${compiler} != "javac" ]]; then
1344 antflags="-Dbuild.compiler=${build_compiler}" 1341 antflags="${antflags} -Dbuild.compiler=${build_compiler}"
1345 # Figure out any extra stuff to put on the classpath for compilers aside 1342 # Figure out any extra stuff to put on the classpath for compilers aside
1346 # from javac 1343 # from javac
1347 # ANT_BUILD_COMPILER_DEPS should be something that could be passed to 1344 # ANT_BUILD_COMPILER_DEPS should be something that could be passed to
1348 # java-config -p 1345 # java-config -p
1349 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})" 1346 local build_compiler_deps="$(source ${JAVA_PKG_COMPILER_DIR}/${compiler} 1>/dev/null 2>&1; echo ${ANT_BUILD_COMPILER_DEPS})"

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

  ViewVC Help
Powered by ViewVC 1.1.20