1 |
commit: f14e39de0e2eaa3d3011918e9febd89bfe98f7ee |
2 |
Author: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jan 21 08:45:29 2019 +0000 |
4 |
Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Jan 21 08:45:29 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f14e39de |
7 |
|
8 |
ant-tasks.eclass: cleanup and improvement |
9 |
|
10 |
1) removed obsolete code |
11 |
2) increased default jdk/jre version to the lowest available version 1.8 |
12 |
3) added support for patching build.xml along with the original build.xml replacement |
13 |
|
14 |
Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org> |
15 |
|
16 |
eclass/ant-tasks.eclass | 80 ++++++++++++++++++++++++------------------------- |
17 |
1 file changed, 39 insertions(+), 41 deletions(-) |
18 |
|
19 |
diff --git a/eclass/ant-tasks.eclass b/eclass/ant-tasks.eclass |
20 |
index 31683e68243..f889a92aa36 100644 |
21 |
--- a/eclass/ant-tasks.eclass |
22 |
+++ b/eclass/ant-tasks.eclass |
23 |
@@ -1,4 +1,4 @@ |
24 |
-# Copyright 1999-2018 Gentoo Foundation |
25 |
+# Copyright 1999-2019 Gentoo Authors |
26 |
# Distributed under the terms of the GNU General Public License, v2 or later |
27 |
|
28 |
# @ECLASS: ant-tasks.eclass |
29 |
@@ -11,27 +11,37 @@ |
30 |
# This eclass provides functionality and default ebuild variables for building |
31 |
# dev-java/ant-* packages easily. |
32 |
|
33 |
+case "${EAPI:-0}" in |
34 |
+ 0|1|2|3|4) |
35 |
+ die "ant-tasks.eclass: EAPI ${EAPI} is too old." |
36 |
+ ;; |
37 |
+ 5|6|7) |
38 |
+ ;; |
39 |
+ *) |
40 |
+ die "ant-tasks.eclass: EAPI ${EAPI} is not supported yet." |
41 |
+ ;; |
42 |
+esac |
43 |
|
44 |
# we set ant-core dep ourselves, restricted |
45 |
JAVA_ANT_DISABLE_ANT_CORE_DEP=true |
46 |
# rewriting build.xml for are the testcases has no reason atm |
47 |
JAVA_PKG_BSFIX_ALL=no |
48 |
inherit java-pkg-2 java-ant-2 |
49 |
-[[ ${EAPI:-0} == [0123456] ]] && inherit eapi7-ver |
50 |
+[[ ${EAPI:-0} == [56] ]] && inherit eapi7-ver |
51 |
|
52 |
EXPORT_FUNCTIONS src_unpack src_compile src_install |
53 |
|
54 |
# @ECLASS-VARIABLE: ANT_TASK_JDKVER |
55 |
# @DESCRIPTION: |
56 |
-# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.5, can |
57 |
+# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.8, can |
58 |
# be overridden from ebuild BEFORE inheriting this eclass. |
59 |
-ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.5} |
60 |
+ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.8} |
61 |
|
62 |
# @ECLASS-VARIABLE: ANT_TASK_JREVER |
63 |
# @DESCRIPTION: |
64 |
-# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.5, can |
65 |
+# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.8, can |
66 |
# be overridden from ebuild BEFORE inheriting this eclass. |
67 |
-ANT_TASK_JREVER=${ANT_TASK_JREVER-1.5} |
68 |
+ANT_TASK_JREVER=${ANT_TASK_JREVER-1.8} |
69 |
|
70 |
# @ECLASS-VARIABLE: ANT_TASK_NAME |
71 |
# @DESCRIPTION: |
72 |
@@ -56,31 +66,18 @@ ANT_TASK_DEPNAME=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}} |
73 |
# Version of ant-core this task is intended to register and thus load with. |
74 |
ANT_TASK_PV="${PV}" |
75 |
|
76 |
-# special care for beta/RC releases |
77 |
-if [[ ${PV} == *beta2* ]]; then |
78 |
- MY_PV=${PV/_beta2/beta} |
79 |
- UPSTREAM_PREFIX="http://people.apache.org/dist/ant/v1.7.1beta2/src" |
80 |
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles" |
81 |
- ANT_TASK_PV=$(ver_cut 1-3) |
82 |
-elif [[ ${PV} == *_rc* ]]; then |
83 |
- MY_PV=${PV/_rc/RC} |
84 |
- UPSTREAM_PREFIX="https://dev.gentoo.org/~caster/distfiles" |
85 |
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles" |
86 |
- ANT_TASK_PV=$(ver_cut 1-3) |
87 |
-else |
88 |
- # default for final releases |
89 |
- MY_PV=${PV} |
90 |
- case ${PV} in |
91 |
- 1.9.*) |
92 |
- UPSTREAM_PREFIX="https://archive.apache.org/dist/ant/source" |
93 |
- GENTOO_PREFIX="https://dev.gentoo.org/~tomwij/files/dist" |
94 |
- ;; |
95 |
- *) |
96 |
- UPSTREAM_PREFIX="mirror://apache/ant/source" |
97 |
- GENTOO_PREFIX="https://dev.gentoo.org/~caster/distfiles" |
98 |
- ;; |
99 |
- esac |
100 |
-fi |
101 |
+# default for final releases |
102 |
+MY_PV=${PV} |
103 |
+case ${PV} in |
104 |
+1.9.2) |
105 |
+ UPSTREAM_PREFIX="https://archive.apache.org/dist/ant/source" |
106 |
+ GENTOO_PREFIX="https://dev.gentoo.org/~tomwij/files/dist" |
107 |
+ ;; |
108 |
+*) |
109 |
+ UPSTREAM_PREFIX="mirror://apache/ant/source" |
110 |
+ GENTOO_PREFIX="https://dev.gentoo.org/~fordfrog/distfiles" |
111 |
+ ;; |
112 |
+esac |
113 |
|
114 |
# source/workdir name |
115 |
MY_P="apache-ant-${MY_PV}" |
116 |
@@ -101,11 +98,6 @@ if [[ -z "${ANT_TASK_DISABLE_VM_DEPS}" ]]; then |
117 |
DEPEND+=" >=virtual/jdk-${ANT_TASK_JDKVER}" |
118 |
fi |
119 |
|
120 |
-# we need direct blockers with old ant-tasks for file collisions - bug #252324 |
121 |
-if ver_test -ge 1.7.1; then |
122 |
- DEPEND+=" !dev-java/ant-tasks" |
123 |
-fi |
124 |
- |
125 |
# Would run the full ant test suite for every ant task |
126 |
RESTRICT="test" |
127 |
|
128 |
@@ -130,7 +122,15 @@ ant-tasks_src_unpack() { |
129 |
cd "${S}" |
130 |
|
131 |
# replace build.xml with our modified for split building |
132 |
- mv -f "${WORKDIR}"/build.xml . |
133 |
+ if [ -e "${WORKDIR}"/${PV}-build.patch ] ; then |
134 |
+ if [ ${EAPI:-0} -eq 5 ]; then |
135 |
+ die "ant-tasks.eclass: build.xml patching not supported for EAPI 5 ebuilds" |
136 |
+ fi |
137 |
+ |
138 |
+ eapply "${WORKDIR}"/${PV}-build.patch |
139 |
+ else |
140 |
+ mv -f "${WORKDIR}"/build.xml . |
141 |
+ fi |
142 |
|
143 |
cd lib |
144 |
# remove bundled xerces |
145 |
@@ -168,8 +168,6 @@ ant-tasks_src_install() { |
146 |
java-pkg_register-ant-task --version "${ANT_TASK_PV}" |
147 |
|
148 |
# create the compatibility symlink |
149 |
- if ver_test -ge 1.7.1_beta2; then |
150 |
- dodir /usr/share/ant/lib |
151 |
- dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar |
152 |
- fi |
153 |
+ dodir /usr/share/ant/lib |
154 |
+ dosym /usr/share/${PN}/lib/${PN}.jar /usr/share/ant/lib/${PN}.jar |
155 |
} |