Gentoo Archives: gentoo-commits

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