Revert "dev-java/java-config: Python 3.8 compatibility"
[gentoo.git] / dev-java / xpp2 / xpp2-2.1.10-r2.ebuild
1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=5
5 JAVA_PKG_IUSE="doc source"
6
7 inherit java-pkg-2 java-ant-2
8
9 MY_PN="PullParser"
10 MY_P="${MY_PN}${PV}"
11
12 DESCRIPTION="A streaming pull XML parser used to quickly process input elements"
13 HOMEPAGE="http://www.extreme.indiana.edu/xgws/xsoap/xpp/mxp1/index.html"
14 SRC_URI="http://www.extreme.indiana.edu/xgws/xsoap/xpp/download/${MY_PN}2/${MY_P}.tgz"
15
16 LICENSE="Apache-1.1 IBM"
17 SLOT="0"
18 KEYWORDS="amd64 ~arm arm64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
19 IUSE="test"
20
21 # Some failures, partly because we haven't patched Xerces but probably
22 # also because this software is ancient. :(
23 RESTRICT="test"
24
25 CDEPEND="dev-java/xerces:2"
26 DEPEND=">=virtual/jdk-1.3
27         test? ( dev-java/junit:4 )
28         ${CDEPEND}"
29 RDEPEND=">=virtual/jre-1.3
30         ${CDEPEND}"
31
32 S="${WORKDIR}/${MY_P}"
33
34 EANT_GENTOO_CLASSPATH="xerces-2"
35 EANT_EXTRA_ARGS="-Dx2_present=true -Djunit.present=true"
36 EANT_BUILD_TARGET="intf intf_jar impl x2impl"
37 EANT_DOC_TARGET="api"
38 EANT_TEST_TARGET="junit"
39
40 java_prepare() {
41         rm -r build/ lib/ || die
42
43         # Our usual rewriting stomps over the existing classpath, which
44         # isn't helpful here.
45         sed -i -r \
46                 -e 's/\bclasspath="/\0${gentoo.classpath}:/g' \
47                 -e 's/\$\{java\.class\.path\}/${gentoo.classpath}/g' \
48                 build.xml || die
49 }
50
51 src_install() {
52         local suffix
53
54         for suffix in "" -intf -standard -x2; do
55                 java-pkg_newjar build/lib/${MY_PN}${suffix}-${PV}.jar ${MY_PN}${suffix}.jar
56         done
57
58         dodoc README.html
59         use doc && java-pkg_dojavadoc doc/api
60         use source && java-pkg_dosrc $(find src/java -name org -o -name javax)
61 }
62
63 src_test() {
64         java-pkg-2_src_test
65 }