summaryrefslogtreecommitdiff
path: root/dev-java/javacc/javacc-7.0.13-r1.ebuild
blob: b0f3f7faeb7ad8c2ad9c05e072d5db070f686e11 (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

JAVA_PKG_IUSE="doc examples source test"
MAVEN_ID="net.java.dev.javacc:javacc:${PV}"

inherit java-pkg-2

DESCRIPTION="Java Compiler Compiler - The Java Parser Generator"
HOMEPAGE="https://javacc.github.io/javacc/"
SRC_URI="https://github.com/javacc/javacc/archive/${P}.tar.gz"
S="${WORKDIR}/${PN}-${P}"

LICENSE="BSD-2"
SLOT="7.0.13"
KEYWORDS="amd64 arm64 ppc64"

BDEPEND=">=dev-java/ant-1.10.14:0[junit]"
DEPEND=">=virtual/jdk-1.8:*"
RDEPEND=">=virtual/jre-1.8:*"

DOCS=(
	README.md
	docs/faq.md
	docs/release-notes.md
)

PATCHES=(
	"${FILESDIR}/javacc-7.0.13-javadoc.patch"
	"${FILESDIR}/javacc-7.0.13-source8.patch"
)

src_prepare() {
	default #780585
	java-pkg-2_src_prepare
	java-pkg_clean ! -path "./bootstrap/*"
}

src_compile() {
	eant -Dant.build.javac.source="8" -Dant.build.javac.target="8"
	use doc && eant javadoc -Dant.build.javac.source="8" -Dant.build.javac.target="8"
}

src_test() {
	eant test -Dant.build.javac.source="8" -Dant.build.javac.target="8"
}

src_install() {
	java-pkg_dojar "target/${PN}.jar"

	use doc && java-pkg_dojavadoc target/javadoc

	use examples && java-pkg_doexamples examples
	use source && java-pkg_dosrc src/*

	echo "JAVACC_HOME=${EPREFIX}/usr/share/javacc/" > "${T}"/22javacc-${SLOT} || die
	doenvd "${T}"/22javacc-${SLOT}

	echo "export VERSION=${PV}" > "${T}"/pre || die

	local launcher
	for launcher in javacc jjdoc jjtree; do
		java-pkg_dolauncher ${launcher}-${SLOT} -pre "${T}"/pre --main ${launcher}
	done

	einstalldocs
}