1 |
ali_bush 07/10/04 09:59:29 |
2 |
|
3 |
Modified: java-utils-2.eclass |
4 |
Added: java-virtuals-2.eclass |
5 |
Log: |
6 |
Adding java-virtuals-2.eclass and updating java-utils-2.eclass to add support for java virtuals. |
7 |
|
8 |
Revision Changes Path |
9 |
1.94 eclass/java-utils-2.eclass |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/java-utils-2.eclass?rev=1.94&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/java-utils-2.eclass?rev=1.94&content-type=text/plain |
13 |
diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/java-utils-2.eclass?r1=1.93&r2=1.94 |
14 |
|
15 |
Index: java-utils-2.eclass |
16 |
=================================================================== |
17 |
RCS file: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v |
18 |
retrieving revision 1.93 |
19 |
retrieving revision 1.94 |
20 |
diff -u -r1.93 -r1.94 |
21 |
--- java-utils-2.eclass 27 Sep 2007 19:47:08 -0000 1.93 |
22 |
+++ java-utils-2.eclass 4 Oct 2007 09:59:29 -0000 1.94 |
23 |
@@ -6,7 +6,7 @@ |
24 |
# |
25 |
# Licensed under the GNU General Public License, v2 |
26 |
# |
27 |
-# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.93 2007/09/27 19:47:08 betelgeuse Exp $ |
28 |
+# $Header: /var/cvsroot/gentoo-x86/eclass/java-utils-2.eclass,v 1.94 2007/10/04 09:59:29 ali_bush Exp $ |
29 |
|
30 |
# ----------------------------------------------------------------------------- |
31 |
# @eclass-begin |
32 |
@@ -840,6 +840,8 @@ |
33 |
# (assumed automatically when called inside src_test) |
34 |
# --with-dependencies - get jars also from requested package's dependencies |
35 |
# transitively. |
36 |
+# --virtual - Packages passed to this function are to be handled as virtuals |
37 |
+# and will not have individual jar dependencies recorded. |
38 |
# --into $dir - symlink jar(s) into $dir (must exist) instead of . |
39 |
# @param $1 - Package to get jars from, or comma-separated list of packages in |
40 |
# case other parameters are not used. |
41 |
@@ -854,6 +856,7 @@ |
42 |
local build_only="" |
43 |
local destdir="." |
44 |
local deep="" |
45 |
+ local virtual="" |
46 |
|
47 |
[[ "${EBUILD_PHASE}" == "test" ]] && build_only="build" |
48 |
|
49 |
@@ -862,6 +865,8 @@ |
50 |
build_only="build" |
51 |
elif [[ "${1}" = "--with-dependencies" ]]; then |
52 |
deep="--with-dependencies" |
53 |
+ elif [[ "${1}" = "--virtual" ]]; then |
54 |
+ virtual="true" |
55 |
elif [[ "${1}" = "--into" ]]; then |
56 |
destdir="${2}" |
57 |
shift |
58 |
@@ -897,6 +902,14 @@ |
59 |
java-pkg_ensure-dep "${build_only}" "${target_pkg}" |
60 |
fi |
61 |
|
62 |
+ # Record the entire virtual as a dependency so that |
63 |
+ # no jars are missed. |
64 |
+ if [[ -z "${build_only}" && -n "${virtual}" ]]; then |
65 |
+ java-pkg_record-jar_ "${target_pkg}" |
66 |
+ # setting this disables further record-jars_ calls later |
67 |
+ build_only="build" |
68 |
+ fi |
69 |
+ |
70 |
pushd ${destdir} > /dev/null \ |
71 |
|| die "failed to change directory to ${destdir}" |
72 |
|
73 |
@@ -1028,6 +1041,8 @@ |
74 |
# |
75 |
# @param $opt |
76 |
# --build-only - makes the jar not added into package.env DEPEND line. |
77 |
+# --virtual - Packages passed to this function are to be handled as virtuals |
78 |
+# and will not have individual jar dependencies recorded. |
79 |
# @param $1 - package to use |
80 |
# @param $2 - jar to get |
81 |
# ------------------------------------------------------------------------------ |
82 |
@@ -1035,12 +1050,15 @@ |
83 |
debug-print-function ${FUNCNAME} $* |
84 |
|
85 |
local build_only="" |
86 |
+ local virtual="" |
87 |
|
88 |
[[ "${EBUILD_PHASE}" == "test" ]] && build_only="build" |
89 |
|
90 |
while [[ "${1}" == --* ]]; do |
91 |
if [[ "${1}" = "--build-only" ]]; then |
92 |
build_only="build" |
93 |
+ elif [[ "${1}" == --* ]]; then |
94 |
+ virtual="true" |
95 |
else |
96 |
die "java-pkg_jar-from called with unknown parameter: ${1}" |
97 |
fi |
98 |
@@ -1060,6 +1078,13 @@ |
99 |
|
100 |
java-pkg_ensure-dep "${build_only}" "${pkg}" |
101 |
|
102 |
+ # Record the package(Virtual) as a dependency and then set build_only |
103 |
+ # So that individual jars are not recorded. |
104 |
+ if [[ -n "${virtual}" ]]; then |
105 |
+ java-pkg_record-jar_ "${pkg}" |
106 |
+ build_only="true" |
107 |
+ fi |
108 |
+ |
109 |
for jar in ${classpath//:/ }; do |
110 |
if [[ ! -f "${jar}" ]] ; then |
111 |
die "Installation problem with jar ${jar} in ${pkg} - is it installed?" |
112 |
@@ -2203,6 +2228,8 @@ |
113 |
JAVA_PKG_SHAREPATH="${DESTTREE}/share/${JAVA_PKG_NAME}" |
114 |
JAVA_PKG_SOURCESPATH="${JAVA_PKG_SHAREPATH}/sources/" |
115 |
JAVA_PKG_ENV="${D}${JAVA_PKG_SHAREPATH}/package.env" |
116 |
+ JAVA_PKG_VIRTUALS_PATH="${DESTTREE}/share/java-config-2/virtuals" |
117 |
+ JAVA_PKG_VIRTUAL_PROVIDER="${D}/${JAVA_PKG_VIRTUALS_PATH}/${JAVA_PKG_NAME}" |
118 |
|
119 |
[[ -z "${JAVA_PKG_JARDEST}" ]] && JAVA_PKG_JARDEST="${JAVA_PKG_SHAREPATH}/lib" |
120 |
[[ -z "${JAVA_PKG_LIBDEST}" ]] && JAVA_PKG_LIBDEST="${DESTTREE}/$(get_libdir)/${JAVA_PKG_NAME}" |
121 |
|
122 |
|
123 |
|
124 |
1.1 eclass/java-virtuals-2.eclass |
125 |
|
126 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/java-virtuals-2.eclass?rev=1.1&view=markup |
127 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/eclass/java-virtuals-2.eclass?rev=1.1&content-type=text/plain |
128 |
|
129 |
Index: java-virtuals-2.eclass |
130 |
=================================================================== |
131 |
# Copyright 1999-2007 Gentoo Foundation |
132 |
# Distributed under the terms of the GNU General Public License v2 |
133 |
# $Header: /var/cvsroot/gentoo-x86/eclass/java-virtuals-2.eclass,v 1.1 2007/10/04 09:59:29 ali_bush Exp $ |
134 |
|
135 |
# Original Author: Alistair John Bush <ali_bush@g.o> |
136 |
# Purpose: To provide a default (and only) src_install function |
137 |
# for ebuilds in the java-virtuals category. |
138 |
|
139 |
inherit java-utils-2 |
140 |
|
141 |
EXPORT_FUNCTIONS src_install |
142 |
|
143 |
java-virtuals-2_src_install() { |
144 |
java-virtuals-2_do_write |
145 |
} |
146 |
|
147 |
# ------------------------------------------------------------------------------ |
148 |
# @internal-function java-pkg_do_virtuals_write |
149 |
# |
150 |
# Writes the virtual env file out to disk. |
151 |
# |
152 |
# ------------------------------------------------------------------------------ |
153 |
java-virtuals-2_do_write() { |
154 |
java-pkg_init_paths_ |
155 |
|
156 |
dodir "${JAVA_PKG_VIRTUALS_PATH}" |
157 |
if [[ -n "${JAVA_VIRTUAL_PROVIDES}" ]]; then |
158 |
echo "PROVIDERS=\"${JAVA_VIRTUAL_PROVIDES}\"" \ |
159 |
>> ${JAVA_PKG_VIRTUAL_PROVIDER} |
160 |
fi |
161 |
|
162 |
if [[ -n "${JAVA_VIRTUAL_VM}" ]]; then |
163 |
echo "VM=\"${JAVA_VIRTUAL_VM}\"" \ |
164 |
>> ${JAVA_PKG_VIRTUAL_PROVIDER} |
165 |
fi |
166 |
|
167 |
if [[ -n "${JAVA_VIRTUAL_VM_CLASSPATH}" ]]; then |
168 |
echo "VM_CLASSPATH=\"${JAVA_VIRTUAL_VM_CLASSPATH}\"" \ |
169 |
>> ${JAVA_PKG_VIRTUAL_PROVIDER} |
170 |
fi |
171 |
} |
172 |
|
173 |
|
174 |
|
175 |
-- |
176 |
gentoo-commits@g.o mailing list |