Gentoo Archives: gentoo-commits

From: "Miroslav Šulc" <fordfrog@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-java/ant-core/
Date: Sat, 19 Feb 2022 09:25:17
Message-Id: 1645262702.e61498c775c4925d46c06c5f2384d48d24c7d3ac.fordfrog@gentoo
1 commit: e61498c775c4925d46c06c5f2384d48d24c7d3ac
2 Author: Yuan Liao <liaoyuan <AT> gmail <DOT> com>
3 AuthorDate: Thu Feb 17 18:22:28 2022 +0000
4 Commit: Miroslav Šulc <fordfrog <AT> gentoo <DOT> org>
5 CommitDate: Sat Feb 19 09:25:02 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e61498c7
7
8 dev-java/ant-core: Switch to log4j-12-api:2
9
10 Closes: https://bugs.gentoo.org/831715
11 Signed-off-by: Yuan Liao <liaoyuan <AT> gmail.com>
12 Closes: https://github.com/gentoo/gentoo/pull/24261/commits/26f95069c6aefc34dfa5e8cadcc944f6635d38f7
13 Signed-off-by: Miroslav Šulc <fordfrog <AT> gentoo.org>
14
15 dev-java/ant-core/ant-core-1.10.9-r3.ebuild | 158 ++++++++++++++++++++++++++++
16 1 file changed, 158 insertions(+)
17
18 diff --git a/dev-java/ant-core/ant-core-1.10.9-r3.ebuild b/dev-java/ant-core/ant-core-1.10.9-r3.ebuild
19 new file mode 100644
20 index 000000000000..5e02bb8b0df4
21 --- /dev/null
22 +++ b/dev-java/ant-core/ant-core-1.10.9-r3.ebuild
23 @@ -0,0 +1,158 @@
24 +# Copyright 1999-2022 Gentoo Authors
25 +# Distributed under the terms of the GNU General Public License v2
26 +
27 +EAPI=8
28 +
29 +# Don't depend on itself.
30 +JAVA_ANT_DISABLE_ANT_CORE_DEP="true"
31 +
32 +# Rewriting build.xml files for the testcases has no use at the moment.
33 +JAVA_PKG_BSFIX_ALL="no"
34 +JAVA_PKG_IUSE="doc source"
35 +
36 +inherit java-pkg-2 java-ant-2 prefix
37 +
38 +MY_P="apache-ant-${PV}"
39 +
40 +DESCRIPTION="Java-based build tool similar to 'make' that uses XML configuration files"
41 +HOMEPAGE="https://ant.apache.org/"
42 +SRC_URI="https://archive.apache.org/dist/ant/source/${MY_P}-src.tar.bz2
43 + https://dev.gentoo.org/~fordfrog/distfiles/ant-${PV}-gentoo.tar.bz2"
44 +
45 +LICENSE="Apache-2.0"
46 +SLOT="0"
47 +KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
48 +
49 +CDEPEND=">=virtual/jdk-1.8:*"
50 +DEPEND="${CDEPEND}
51 + doc? (
52 + dev-java/bcel:0
53 + dev-java/bsf:2.3
54 + dev-java/commons-logging:0
55 + dev-java/commons-net:0
56 + dev-java/jakarta-activation-api:1
57 + dev-java/jakarta-regexp:1.4
58 + dev-java/jakarta-oro:2.0
59 + dev-java/jdepend:0
60 + dev-java/jsch:0
61 + dev-java/log4j-12-api:2
62 + dev-java/javax-mail:0
63 + dev-java/sun-jai-bin:0
64 + dev-java/xalan:0
65 + dev-java/xml-commons-resolver:0
66 + dev-java/xz-java:0
67 + )"
68 +RDEPEND="${CDEPEND}"
69 +
70 +S="${WORKDIR}/${MY_P}"
71 +
72 +RESTRICT="test"
73 +
74 +PATCHES=(
75 + "${WORKDIR}/${PV}-build.patch"
76 + "${WORKDIR}/${PV}-launch.patch"
77 +)
78 +
79 +src_prepare() {
80 + default
81 +
82 + eprefixify "${S}/src/script/ant"
83 +
84 + # Fixes bug 556008.
85 + java-ant_xml-rewrite -f build.xml \
86 + -c -e javadoc \
87 + -a failonerror \
88 + -v "false"
89 +
90 + # See bug #196080 for more details.
91 + java-ant_bsfix_one build.xml
92 + java-pkg-2_src_prepare
93 +
94 + # Remove JDK9+ stuff
95 + einfo "Removing JDK9+ classes (Jmod and Link)"
96 + rm "${S}"/src/main/org/apache/tools/ant/taskdefs/modules/{Jmod,Link}.java
97 +}
98 +
99 +src_compile() {
100 + export ANT_HOME=""
101 + # Avoid error message that package ant-core was not found
102 + export ANT_TASKS="none"
103 +
104 + local bsyscp
105 +
106 + # This ensures that when building ant with bootstrapped ant,
107 + # only the source is used for resolving references, and not
108 + # the classes in bootstrapped ant but jikes in kaffe has issues with this...
109 + if ! java-pkg_current-vm-matches kaffe; then
110 + bsyscp="-Dbuild.sysclasspath=ignore"
111 + fi
112 +
113 + CLASSPATH="$(java-config -t)" ./build.sh ${bsyscp} jars dist-internal ||
114 + die "build failed"
115 +
116 + if use doc; then
117 + # All Java packages imported by the source files need to present in
118 + # the classpath, otherwise it would be https://bugs.gentoo.org/780531
119 + local doc_deps=(
120 + bcel
121 + bsf-2.3
122 + commons-logging
123 + commons-net
124 + jakarta-activation-api-1
125 + jakarta-oro-2.0
126 + jakarta-regexp-1.4
127 + jdepend
128 + jsch
129 + log4j-12-api-2
130 + javax-mail
131 + sun-jai-bin
132 + xalan
133 + xml-commons-resolver
134 + xz-java
135 + )
136 + for dep in "${doc_deps[@]}"; do
137 + java-pkg_jar-from --build-only --into lib/optional/ "${dep}"
138 + done
139 + # This file imports netrexx.lang.Rexx, which is not available
140 + # from ::gentoo. Fortunately, there is not a dev-java/ant-*
141 + # package for it, so even if we could generate documentation
142 + # for it, it would be irrelevant
143 + rm src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java ||
144 + die "Failed to remove Java source file blocking Javadoc generation"
145 + ./build.sh ${bsyscp} javadocs || die "Javadoc build failed"
146 + fi
147 +}
148 +
149 +src_install() {
150 + dodir /usr/share/ant/lib
151 +
152 + for jar in ant.jar ant-bootstrap.jar ant-launcher.jar ; do
153 + java-pkg_dojar build/lib/${jar}
154 + dosym ../../${PN}/lib/${jar} /usr/share/ant/lib/${jar}
155 + done
156 +
157 + dobin src/script/ant
158 +
159 + dodir /usr/share/${PN}/bin
160 + for each in antRun antRun.pl runant.pl runant.py ; do
161 + dobin "${S}/src/script/${each}"
162 + dosym ../../../bin/${each} /usr/share/${PN}/bin/${each}
163 + done
164 + dosym ../${PN}/bin /usr/share/ant/bin
165 +
166 + insinto /usr/share/${PN}
167 + doins -r dist/etc
168 + dosym ../${PN}/etc /usr/share/ant/etc
169 +
170 + echo "ANT_HOME=\"${EPREFIX}/usr/share/ant\"" > "${T}/20ant"
171 + doenvd "${T}/20ant"
172 +
173 + dodoc NOTICE README WHATSNEW KEYS
174 +
175 + if use doc; then
176 + dodoc -r manual/*
177 + java-pkg_dojavadoc --symlink manual/api build/javadocs
178 + fi
179 +
180 + use source && java-pkg_dosrc src/main/*
181 +}