summaryrefslogtreecommitdiff
blob: 293bbb3edbb18c4b482b2c01e2c4e2663b8fac43 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Skeleton command:
# java-ebuilder --generate-ebuild --workdir . --pom pom.xml --download-uri https://github.com/FasterXML/woodstox/archive/woodstox-core-6.3.1.tar.gz --slot 0 --keywords "~amd64 ~arm ~arm64 ~ppc64 ~x86" --ebuild woodstox-core-6.3.1.ebuild

EAPI=8

JAVA_PKG_IUSE="doc source test"
MAVEN_ID="com.fasterxml.woodstox:woodstox-core:6.3.1"
JAVA_TESTING_FRAMEWORKS="junit-4"

inherit java-pkg-2 java-pkg-simple

DESCRIPTION="An XML processor that implements Stax (JSR-173), SAX2 and Stax2 APIs"
HOMEPAGE="https://github.com/FasterXML/woodstox"
SRC_URI="https://github.com/FasterXML/woodstox/archive/${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"

# Common dependencies
# POM: pom.xml
# net.java.dev.msv:msv-core:2013.6.1 -> >=dev-java/msv-2022.7:0
# net.java.dev.msv:xsdlib:2013.6.1 -> >=dev-java/xsdlib-2022.7:0
# org.codehaus.woodstox:stax2-api:4.2.1 -> >=dev-java/stax2-api-4.2.1:0
# relaxngDatatype:relaxngDatatype:20020414 -> >=dev-java/relaxng-datatype-20020414:0

CP_DEPEND="
	dev-java/msv:0
	dev-java/relaxng-datatype:0
	dev-java/stax2-api:0
	dev-java/xsdlib:0
"

# Compile dependencies
# POM: pom.xml
# biz.aQute.bnd:biz.aQute.bnd.annotation:6.3.1 -> >=dev-java/aqute-bnd-annotation-6.3.1:0
# org.osgi:osgi.core:5.0.0 -> >=dev-java/osgi-core-8.0.0:0
# POM: pom.xml
# test? junit:junit:4.13.2 -> >=dev-java/junit-4.13.2:4

DEPEND="${CP_DEPEND}
	>=virtual/jdk-11:*
	dev-java/aqute-bnd-annotation:0
	dev-java/osgi-core:0"

RDEPEND="${CP_DEPEND}
	>=virtual/jre-1.8:*"

DOCS=( {README,SECURITY}.md release-notes/{CREDITS,VERSION} )

S="${WORKDIR}/woodstox-${P}"

JAVA_CLASSPATH_EXTRA="aqute-bnd-annotation,osgi-core"
JAVA_SRC_DIR=( "src/main/java" "src/moditect" )
JAVA_RESOURCE_DIRS="src/main/resources"

JAVA_TEST_GENTOO_CLASSPATH="junit-4"
JAVA_TEST_SRC_DIR="src/test/java"
JAVA_TEST_RESOURCE_DIRS="src/test/resources"

# https://github.com/FasterXML/woodstox/blob/woodstox-core-6.3.0/pom.xml#L229-L243
src_test() {
	pushd src/test/java > /dev/null || die
		local JAVA_TEST_RUN_ONLY=$(find * \
			\( -wholename "**/Test*.java" \
			-o -wholename "**/*Test.java" \) \
			! -wholename "failing/*.java" \
			! -wholename "**/Abstract*.jav" \
			! -wholename "**/Base*.java" \
			)
	popd > /dev/null
	JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//.java}"
	JAVA_TEST_RUN_ONLY="${JAVA_TEST_RUN_ONLY//\//.}"
	java-pkg-simple_src_test
}

src_prepare() {
	default

	# src/moditect/module-info.java:33: error: cannot find symbol
	#    provides org.codehaus.stax2.validation.XMLValidationSchemaFactory.dtd with com.ctc.wstx.dtd.DTDSchemaFactory;
	# https://bugs.gentoo.org/858302
	sed -e '/com.ctc.wstx.shaded.msv/d' \
		-e '/org.codehaus.stax2.validation/d' \
		-i "src/moditect/module-info.java" || die
}