# Maintainer: Felix Yan <felixonmars@archlinux.org>
# Contributor: Arch Haskell Team <arch-haskell@haskell.org>

pkgname=hledger-ui
pkgver=1.21
pkgrel=35
pkgdesc="Curses-style terminal interface for the hledger accounting system"
url="http://hledger.org"
license=("GPL")
arch=('x86_64')
depends=('ghc-libs' 'hledger' 'haskell-hledger-lib' 'haskell-ansi-terminal' 'haskell-async'
         'haskell-base-compat-batteries' 'haskell-cmdargs' 'haskell-data-default' 'haskell-extra'
         'haskell-fsnotify' 'haskell-microlens' 'haskell-microlens-platform' 'haskell-megaparsec'
         'haskell-safe' 'haskell-split' 'haskell-text-zipper'
         'haskell-vector' 'haskell-brick' 'haskell-vty')
makedepends=('ghc')
source=("https://hackage.haskell.org/packages/archive/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('eeb969c0eca213fa0906a0750c17169257524661db7f562264d7e10cbc680270ca035aed235fd3e258215d7d7283c42088c244af061150a104cec37317710e5d')

build() {
    cd $pkgname-$pkgver
    runhaskell Setup configure -O --enable-executable-dynamic --disable-library-vanilla \
        --prefix=/usr --docdir="/usr/share/doc/$pkgname" --datasubdir="$pkgname" \
            -fthreaded
    runhaskell Setup build $MAKEFLAGS
}

package() {
    cd $pkgname-$pkgver
    runhaskell Setup copy --destdir="$pkgdir"
    rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE

    install -Dm644 hledger-ui.1 -t "$pkgdir"/usr/share/man/man1/
}
