summaryrefslogtreecommitdiff
blob: a86cdb15be167682fec7137df61ff4ebac1bca95 (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
90
91
92
93
94
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

JAVA_PKG_IUSE="source"

inherit java-pkg-2 java-ant-2

GWT_TOOLS_COMMIT="194772ed94078802d8030136796de344eb1fdbe1"
GWT_TOOLS_PN="tools"

DESCRIPTION="Google Web Toolkit library"
HOMEPAGE="https://www.gwtproject.org/"
SRC_URI="https://github.com/gwtproject/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
		https://github.com/gwtproject/${GWT_TOOLS_PN}/archive/${GWT_TOOLS_COMMIT}.tar.gz -> ${PN}-${GWT_TOOLS_PN}-${GWT_TOOLS_COMMIT}.tar.gz"
# While the test suite does compile and does execute with an exit status of 0,
# there are many tests that end with FAILED status. It is unclear if this is
# expected from upstream or not, but in order to keep things honest, the test
# suite is being restricted
RESTRICT="mirror test"
SLOT="2.8"
LICENSE="Apache-2.0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"

CDEPEND="
	dev-java/guava:0
	dev-java/rhino:1.6
	dev-java/asm:9
	dev-java/eclipse-ecj:4.15
	dev-java/validation-api:1.0
"

RDEPEND="
	${CDEPEND}
	>=virtual/jre-1.8:*"
DEPEND="
	${CDEPEND}
	virtual/jdk:1.8
"

JAVA_ANT_REWRITE_CLASSPATH="yes"
EANT_BUILD_TARGET="build"
EANT_GENTOO_CLASSPATH="
		asm-9
		guava
		rhino-1.6
		eclipse-ecj-4.15
		validation-api-1.0
"

PATCHES=(
	"${FILESDIR}/${PN}-2.9.0-jsinterop-classpath.patch"
	"${FILESDIR}/${PN}-2.9.0-remove-git-usage.patch"
)

src_prepare() {
	default

	java-pkg-2_src_prepare
}

src_compile() {
	# the default setup assumes that you've placed these in ${S}/tools. We put
	# it in ${WORKDIR} though
	export GWT_TOOLS="${WORKDIR}/${GWT_TOOLS_PN}-${GWT_TOOLS_COMMIT}"
	export GWT_VERSION="${PV}"

	java-pkg-2_src_compile
}

src_test() {
	local -x ANT_OPTS=-Dfile.encoding=UTF-8
	local -x TZ=America/Los_Angeles

	java-pkg-2_src_test
}

src_install() {
	local i18nCreater_launcher_args=(
		i18nCreater
		--main com.google.gwt.i18n.tools.I18NCreater
		--jar gwt-dev.jar
		)
	local webAppCreator_launcher_args=(
		webAppCreator
		--main com.google.gwt.user.tools.WebAppCreator
		--jar gwt-dev.jar
	)

	java-pkg_dojar build/lib/*.jar
	java-pkg_dolauncher ${i18nCreater_launcher_args[@]}
	java-pkg_dolauncher ${webAppCreator_launcher_args[@]}
}