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

EAPI=7

DESCRIPTION="The Haskell Tool Stack (Binary)"
HOMEPAGE="https://github.com/commercialhaskell/stack"

uri() {
	echo "https://github.com/commercialhaskell/stack/releases/download/v${PV}/stack-${PV}-linux-$1.tar.gz"
}

SRC_URI="
	arm? ( $(uri arm) )
	arm64? ( $(uri aarch64) )
	x86? ( $(uri i386) )
	amd64? ( $(uri x86_64) )
"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="symlink"

DEPEND=""
RDEPEND="${DEPEND}
	sys-libs/zlib
	dev-libs/gmp:0
"
RDEPEND+=" symlink? ( !dev-haskell/stack )"

S=${WORKDIR}

QA_PREBUILT="/usr/bin/stack-bin"
QA_PRESTRIPPED="/usr/bin/stack-bin"

src_prepare() {
	default

	mv stack-${PV}-*/doc doc || die
	mv stack-${PV}-*/stack stack-bin || die
}

src_install() {
	dodoc -r doc/*
	dobin stack-bin
	use symlink && dosym stack-bin /usr/bin/stack
}