# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DESCRIPTION="Stack is a program for developing Haskell projects"
HOMEPAGE="https://haskellstack.org/
	https://github.com/commercialhaskell/stack/"

SRC_BASE="https://github.com/commercialhaskell/${PN}/releases/download/v${PV}"
SRC_URI="
	arm64? ( ${SRC_BASE}/${P}-linux-aarch64.tar.gz )
	amd64? ( ${SRC_BASE}/${P}-linux-x86_64.tar.gz  )
"
S="${WORKDIR}"

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

QA_PREBUILT="*"
DOCS=( ChangeLog.md README.md )

src_unpack() {
	default
	mv ./stack-*/* . || die
}

src_install() {
	dobin "${PN}"
	einstalldocs
}