1 # Copyright 1999-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
5 JAVA_PKG_IUSE="doc examples source test"
6 inherit java-pkg-2 java-ant-2 versionator
12 MY_PV="$(replace_all_version_separators _ ${PV})"
18 MY_RELEASE="${MY_PN}${MY_PV}_RELEASE"
20 DESCRIPTION="An open-source implementation of JavaScript written in Java"
21 SRC_URI="https://github.com/mozilla/${PN}/archive/${MY_RELEASE}.zip"
22 HOMEPAGE="http://www.mozilla.org/rhino/"
24 LICENSE="MPL-1.1 GPL-2"
26 KEYWORDS="amd64 ~arm arm64 ppc64 x86"
29 # ../rhino-Rhino1_7_7_RELEASE
30 S="${WORKDIR}/${PN}-${MY_RELEASE}"
33 RDEPEND=">=virtual/jre-1.6
35 DEPEND=">=virtual/jdk-1.6
40 dev-java/hamcrest-core:1.3
44 JAVA_ANT_REWRITE_CLASSPATH="yes"
47 "${FILESDIR}"/${P}-testsrc-build.xml.patch
50 EANT_TEST_TARGET="junit"
52 # StackOverFlow errors arise on some tests.
53 # Further, the test suite takes way too much time (> 5 min).
54 # Maybe reduce the numbers of tests?
60 epatch "${PATCHES[@]}"
64 java-pkg_jar-from --build-only emma emma.jar lib/emma.jar
65 java-pkg_jar-from --build-only emma emma_ant.jar lib/emma_ant.jar
66 java-pkg_jar-from --build-only hamcrest-core-1.3 hamcrest-core.jar lib/hamcrest.jar
67 java-pkg_jar-from --build-only junit-4 junit.jar lib/junit.jar
72 java-pkg-2_src_compile
75 EANT_BUILD_TARGET="source-zip" \
76 java-pkg-2_src_compile
85 java-pkg_dojar build/${MY_P}/js.jar
87 java-pkg_dolauncher jsscript-${SLOT} \
88 --main org.mozilla.javascript.tools.shell.Main
90 use doc && java-pkg_dojavadoc "build/${MY_P}/javadoc"
91 use examples && java-pkg_doexamples examples
92 use source && java-pkg_dosrc {src,toolsrc,xmlimplsrc}/org