# Template file for 'stack'
pkgname=stack
version=2.3.1
revision=1
_stackage="lts-15.4"
hostmakedepends="cabal-install pkg-config unzip"
makedepends="zlib-devel pcre-devel"
depends="git gmp-devel iana-etc"
short_desc="Cross-platform program for developing Haskell projects"
maintainer="Leah Neukirchen <leah@vuxu.org>"
license="BSD-3-Clause"
homepage="https://haskellstack.org"
distfiles="https://github.com/commercialhaskell/${pkgname}/archive/v${version}.tar.gz
 https://www.stackage.org/${_stackage}/cabal.config>cabal.config-${_stackage}"
checksum="6701ddfc6d0be0c2bf0f75c84375e41923c5617f04222c5e582e7011c7f8fb83
 4147e6738cf6ef38cfd48048ef0992fb00e786068592e359fdb804e3d9ed4781"
skip_extraction="cabal.config-${_stackage}"
nocross=yes
nopie_files="/usr/bin/stack"

do_build() {
	cp ${XBPS_SRCDISTDIR}/${pkgname}-${version}/cabal.config-${_stackage} cabal.config
	HOME=$PWD cabal update 'hackage.haskell.org,2020-04-29T20:25:58Z'
	HOME=$PWD cabal new-build ${makejobs} --flag disable-git-info
}

do_install() {
	eval vbin dist-newstyle/build/*/*/*/build/stack/stack
	vlicense LICENSE
}
