summaryrefslogtreecommitdiff
blob: 4f1069f342112bca5bb9b3f66d4cba0dfd6b5405 (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit java-pkg-2 java-ant-2

PATCHSET_VER="0"

DESCRIPTION="tuProlog is a light-weight Prolog for Internet applications and infrastructures"
HOMEPAGE="http://tuprolog.unibo.it/"
SRC_URI="https://dev.gentoo.org/~keri/distfiles/tuprolog/${P}.tar.gz
	https://dev.gentoo.org/~keri/distfiles/tuprolog/${P}-gentoo-patchset-${PATCHSET_VER}.tar.gz"

LICENSE="LGPL-3 BSD"
SLOT="0"
KEYWORDS="amd64 x86"
IUSE="doc examples test"
RESTRICT="!test? ( test )"

RDEPEND="virtual/jdk:1.8
	dev-java/javassist:3
	dev-java/commons-lang:3.6
	dev-java/gson:0"

DEPEND="${RDEPEND}
	>=dev-java/ant-1.10.14
	test? (
		>=dev-java/ant-1.10.14:0[junit4]
		dev-java/junit:4
		dev-java/hamcrest:0
	)"

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

EANT_GENTOO_CLASSPATH="javassist:3,commons-lang:3.6,gson"

PATCHES=( "${WORKDIR}/${PV}" )

src_prepare() {
	default

	cp "${FILESDIR}"/build-3.x.xml "${S}"/build.xml || die
}

src_compile() {
	eant jar $(use_doc)
}

src_test() {
	cd "${S}"/dist
	java-pkg_jar-from junit:4
	java-pkg_jar-from hamcrest
	cd "${S}"
	eant test || die "eant test failed"
}

src_install() {
	java-pkg_dojar dist/${PN}.jar
	java-pkg_dojar dist/2p.jar

	if use doc ; then
		java-pkg_dohtml -r docs/* || die
		dodoc doc/tuprolog-guide.pdf
	fi

	if use examples ; then
		docinto examples
		dodoc doc/examples/*.pl
	fi
}