summaryrefslogtreecommitdiff
blob: 0e22428166d53f9b48c79003efaa5a01df240801 (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
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit java-pkg-2

DESCRIPTION="sbt, a build tool for Scala."
HOMEPAGE="https://scala-sbt.org"
SRC_URI="https://dl.bintray.com/sbt/native-packages/sbt/${PV}/${PN/-bin}-${PV}.tgz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"

IUSE=""

DEPEND=""
RDEPEND="
	>=virtual/jre-1.7
	!dev-java/sbt"

src_unpack() {
	default
	mv "${WORKDIR}/sbt" "${S}" || die
}

java_prepare() {
	java-pkg_init_paths_
}

src_install() {
	local dest="${JAVA_PKG_SHAREPATH}"

	rm -f bin/sbt.bat || die
	sed -i -e 's#bin/sbt-launch.jar#lib/sbt-launch.jar#g;' \
		bin/sbt-launch-lib.bash || die

	insinto "${dest}/lib"
	doins bin/* || die

	insinto "${dest}"
	doins -r conf || die

	fperms 0755 "${dest}/lib/sbt" || die
	dosym "${dest}/lib/sbt" /usr/bin/sbt || die
}