/[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.84 Revision 1.85
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.84 2007/05/06 09:47:36 betelgeuse Exp $ 9# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.85 2007/05/25 10:27:57 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
1118 die "${FUNCNAME} called with both package list and jar name" 1118 die "${FUNCNAME} called with both package list and jar name"
1119 java-pkg_ensure-dep runtime "${pkgs}" 1119 java-pkg_ensure-dep runtime "${pkgs}"
1120 java-pkg_record-jar_ "${pkgs}" "${jar}" 1120 java-pkg_record-jar_ "${pkgs}" "${jar}"
1121 fi 1121 fi
1122 1122
1123 java-pkg_do_write_ 1123 java-pkg_do_write_
1124}
1125
1126# ------------------------------------------------------------------------------
1127# @ebuild-function java-pkg_register-environment-variable
1128#
1129# Register an arbitrary environment variable into package.env. The gjl launcher
1130# for this package or any package depending on this will export it into
1131# environement before executing java command.
1132# Must only be called in src_install phase.
1133#
1134# @param $1 - variable name
1135# @param $2 - variable value
1136# ------------------------------------------------------------------------------
1137JAVA_PKG_EXTRA_ENV="${T}/java-pkg-extra-env"
1138JAVA_PKG_EXTRA_ENV_VARS=""
1139java-pkg_register-environment-variable() {
1140 debug-print-function ${FUNCNAME} $*
1141
1142 java-pkg_check-phase install
1143
1144 [[ ${#} != 2 ]] && die "${FUNCNAME} takes two arguments"
1145
1146 echo "${1}=\"${2}\"" >> ${JAVA_PKG_EXTRA_ENV}
1147 JAVA_PKG_EXTRA_ENV_VARS="${JAVA_PKG_EXTRA_ENV_VARS} ${1}"
1148
1149 java-pkg_do_write_
1124} 1150}
1125 1151
1126# This function reads stdin, and based on that input, figures out how to 1152# This function reads stdin, and based on that input, figures out how to
1127# populate jars from the filesystem. 1153# populate jars from the filesystem.
1128# Need to figure out a good way of making use of this, ie be able to use a 1154# Need to figure out a good way of making use of this, ie be able to use a
2141 2167
2142 2168
2143 echo "MERGE_VM=\"${GENTOO_VM}\"" >> "${JAVA_PKG_ENV}" 2169 echo "MERGE_VM=\"${GENTOO_VM}\"" >> "${JAVA_PKG_ENV}"
2144 [[ -n ${GENTOO_COMPILER} ]] && echo "MERGE_COMPILER=\"${GENTOO_COMPILER}\"" >> "${JAVA_PKG_ENV}" 2170 [[ -n ${GENTOO_COMPILER} ]] && echo "MERGE_COMPILER=\"${GENTOO_COMPILER}\"" >> "${JAVA_PKG_ENV}"
2145 2171
2172 # extra env variables
2173 if [[ -n "${JAVA_PKG_EXTRA_ENV_VARS}" ]]; then
2174 cat "${JAVA_PKG_EXTRA_ENV}" >> "${JAVA_PKG_ENV}" || die
2175 # nested echo to remove leading/trailing spaces
2176 echo "ENV_VARS=\"$(echo ${JAVA_PKG_EXTRA_ENV_VARS})\"" \
2177 >> "${JAVA_PKG_ENV}" || die
2178 fi
2179
2146 # Strip unnecessary leading and trailing colons 2180 # Strip unnecessary leading and trailing colons
2147 # TODO try to cleanup if possible 2181 # TODO try to cleanup if possible
2148 sed -e "s/=\":/=\"/" -e "s/:\"$/\"/" -i "${JAVA_PKG_ENV}" || die "Did you forget to call java_init ?" 2182 sed -e "s/=\":/=\"/" -e "s/:\"$/\"/" -i "${JAVA_PKG_ENV}" || die "Did you forget to call java_init ?"
2149 fi 2183 fi
2150} 2184}

Legend:
Removed from v.1.84  
changed lines
  Added in v.1.85

  ViewVC Help
Powered by ViewVC 1.1.20