summaryrefslogtreecommitdiff
blob: c4b5aaa7a88b784c6b1b6da0a1edd99c42da6383 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Copyright 1999-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

JAVA_PKG_IUSE="doc source"
MAVEN_ID="pull-parser:pull-parser:2"

inherit java-pkg-2 java-ant-2

MY_PN="PullParser"
MY_P="${MY_PN}${PV}"

DESCRIPTION="A streaming pull XML parser used to quickly process input elements"
HOMEPAGE="https://web.archive.org/web/20130904163229/http://www.extreme.indiana.edu/xgws/xsoap/xpp/xpp2/"
SRC_URI="https://web.archive.org/web/20130904173708/http://www.extreme.indiana.edu/xgws/xsoap/xpp/download/PullParser2/${MY_P}.tgz"

LICENSE="Apache-1.1 IBM"
SLOT="0"
KEYWORDS="amd64 ~arm arm64 ppc64 x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="test"

# Some failures, partly because we haven't patched Xerces but probably
# also because this software is ancient. :(
RESTRICT="test"

CDEPEND="dev-java/xerces:2"
DEPEND=">=virtual/jdk-1.8:*
	test? ( dev-java/junit:4 )
	${CDEPEND}"
RDEPEND=">=virtual/jre-1.8:*
	${CDEPEND}"

S="${WORKDIR}/${MY_P}"

PATCHES=(
	"${FILESDIR}/${P}-fix-java5+.patch"
)

EANT_GENTOO_CLASSPATH="xerces-2"
EANT_EXTRA_ARGS="-Dx2_present=true -Djunit.present=true"
EANT_BUILD_TARGET="intf intf_jar impl x2impl"
EANT_DOC_TARGET="api"
EANT_TEST_TARGET="junit"

src_prepare() {
	default

	rm -r build/ lib/ || die

	# Our usual rewriting stomps over the existing classpath, which
	# isn't helpful here.
	sed -i -r \
		-e 's/\bclasspath="/\0${gentoo.classpath}:/g' \
		-e 's/\$\{java\.class\.path\}/${gentoo.classpath}/g' \
		build.xml || die
}

src_install() {
	local suffix

	for suffix in "" -intf -standard -x2; do
		java-pkg_newjar build/lib/${MY_PN}${suffix}-${PV}.jar ${MY_PN}${suffix}.jar
	done

	dodoc README.html
	use doc && java-pkg_dojavadoc doc/api
	use source && java-pkg_dosrc $(find src/java -name org -o -name javax)
}

src_test() {
	java-pkg-2_src_test
}