# Template file for 'hledger'
pkgname=hledger
version=1.52
revision=1
build_style=haskell-stack
makedepends="zlib-devel ncurses-devel"
short_desc="Simple, precise, plain text accounting"
maintainer="Orphaned <orphan@voidlinux.org>"
license="GPL-3.0-or-later"
homepage="https://hledger.org/"
changelog="https://hackage.haskell.org/package/hledger-${version}/changelog"
distfiles="https://github.com/simonmichael/hledger/archive/${version}.tar.gz
 https://hackage.haskell.org/package/basement-0.0.16/basement-0.0.16.tar.gz
 https://hackage.haskell.org/package/memory-0.18.0/memory-0.18.0.tar.gz
 https://hackage.haskell.org/package/cborg-0.2.10.0/cborg-0.2.10.0.tar.gz"
checksum="5da2baa4cdb8a391961c66ad2b9d502898f0d7cb534c07703ea05696475ea42b
 7fb77e249aef76ba5aed3059d556800ce02b614597c488ba01f0a16449146300
 fd4eb6f638e24b81b4e6cdd68772a531726f2f67686c8969d3407d82f7862e3e
 17fe070c38fc498cab49bcb9d6215b7747d53bedf96502e9bcce9cad73b9c797"
nopie_files="/usr/bin/hledger"
nocross=yes # Can't yet cross compile Haskell
skip_extraction="basement-0.0.16.tar.gz memory-0.18.0.tar.gz cborg-0.2.10.0.tar.gz"

export STACK_YAML=stack98.yaml

post_extract() {
	vsrcextract -C basement basement-0.0.16.tar.gz
	vsrcextract -C memory memory-0.18.0.tar.gz
	vsrcextract -C cborg cborg-0.2.10.0.tar.gz
}

post_install() {
	vman hledger/hledger.1
}

hledger-ui_package() {
	nopie_files="/usr/bin/hledger-ui"
	depends="${sourcepkg}>=${version}_${revision}"
	pkg_install() {
		vmove usr/bin/hledger-ui
		vman hledger-ui/hledger-ui.1
	}
}

hledger-web_package() {
	nopie_files="/usr/bin/hledger-web"
	depends="${sourcepkg}>=${version}_${revision}"
	pkg_install() {
		vmove usr/bin/hledger-web
		vman hledger-web/hledger-web.1
	}
}
