diff options
Diffstat (limited to 'dev-java/jdom/jdom-2.0.6.1.ebuild')
-rw-r--r-- | dev-java/jdom/jdom-2.0.6.1.ebuild | 47 |
1 files changed, 30 insertions, 17 deletions
diff --git a/dev-java/jdom/jdom-2.0.6.1.ebuild b/dev-java/jdom/jdom-2.0.6.1.ebuild index 5cbdaa66520d..774430ba8820 100644 --- a/dev-java/jdom/jdom-2.0.6.1.ebuild +++ b/dev-java/jdom/jdom-2.0.6.1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2022 Gentoo Authors +# Copyright 1999-2023 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 @@ -12,15 +12,12 @@ inherit java-pkg-2 java-pkg-simple DESCRIPTION="Java-based solution for accessing, manipulating, and outputting XML data" HOMEPAGE="http://www.jdom.org" SRC_URI="https://github.com/hunterhacker/jdom/archive/${PN^^}-${PV}.tar.gz" +S="${WORKDIR}/jdom-JDOM-${PV}" LICENSE="Apache-1.1" SLOT="2" KEYWORDS="amd64 ~arm arm64 ppc64 x86" -# FAILURES!!! -# Tests run: 1887, Failures: 23 -RESTRICT="test" - CP_DEPEND=" dev-java/iso-relax:0 dev-java/jaxen:1.2 @@ -40,35 +37,51 @@ RDEPEND=" ${CP_DEPEND} " -S="${WORKDIR}/jdom-JDOM-${PV}" +PATCHES=( "${FILESDIR}/jdom-2.0.6.1-skip-failing-tests.patch" ) -JAVA_TEST_SRC_DIR="test/src/java" -JAVA_TEST_RESOURCE_DIRS="test/src/resources" JAVA_TEST_GENTOO_CLASSPATH="junit-4,xerces-2" +JAVA_TEST_RESOURCE_DIRS="test/src/resources" +JAVA_TEST_SRC_DIR="test/src/java" src_prepare() { - default + java-pkg-2_src_prepare + default # bug #780585 java-pkg_clean + mkdir core/resources || die + cp -r core/{package,resources}/META-INF || die + # Remove Android stuff to avoid junit RDEPEND. rm -vr contrib/src/java/org/jdom2/contrib/android || die - # There are resources in JAVA_TEST_SRC_DIR - cp -r test/src/{java,resources}/org || die - # Remove .java files from JAVA_TEST_RESOURCE_DIRS - find test/src/resources -type f -name '*.java' -exec rm -rf {} + || die "deleting classes failed" + cd test/src/java || die + # java-pkg-simple.eclass expects test resources in JAVA_TEST_RESOURCE_DIRS + find . -type f ! -name '*.java' \ + | xargs cp --parent -t ../resources || die + + # We skip testDocTypeDocument() from 3 test classes due to test failures, + # see bug #901743. This requires changing also the line endings which would + # lead to huge patches. Hence we do this with sed ( 's/\r$//g' ). + sed \ + -e 's/\r$//g' \ + -e '/import org.junit.Test/a import org.junit.Ignore;' \ + -e '/testDocTypeDocument()/i @Ignore' \ + -i org/jdom2/test/cases/input/TestDOMBuilder.java \ + -i org/jdom2/test/cases/input/TestStAXEventBuilder.java \ + -i org/jdom2/test/cases/input/TestStAXStreamBuilder.java || die } src_compile() { - JAVA_SRC_DIR="core/src/java" JAVA_JAR_FILENAME="jdom.jar" + JAVA_RESOURCE_DIRS="core/resources" + JAVA_SRC_DIR="core/src/java" java-pkg-simple_src_compile JAVA_GENTOO_CLASSPATH_EXTRA+=":jdom.jar" rm -rf target || die - JAVA_SRC_DIR="contrib/src/java" - JAVA_RESOURCE_DIRS="contrib/src/resources" JAVA_JAR_FILENAME="jdom-contrib.jar" + JAVA_RESOURCE_DIRS="contrib/src/resources" + JAVA_SRC_DIR="contrib/src/java" java-pkg-simple_src_compile JAVA_GENTOO_CLASSPATH_EXTRA+=":jdom-contrib.jar" rm -rf target || die @@ -85,7 +98,7 @@ src_compile() { } src_install() { - default # https://bugs.gentoo.org/789582 + default # install README java-pkg_dojar "jdom.jar" java-pkg_dojar "jdom-contrib.jar" if use doc; then |