52 lines
1.9 KiB
Bash

# POWER Maintainer: Alexander Baldeck <alex.bldck@gmail.com>
# Maintainer: Felix Yan <felixonmars@archlinux.org>
_hkgname=aeson-diff
pkgname=haskell-aeson-diff
pkgver=1.1.0.8
pkgrel=98
pkgdesc="Extract and apply patches to JSON documents"
url="https://github.com/thsutton/aeson-diff"
license=('BSD')
arch=(x86_64 powerpc64le)
depends=('ghc-libs' 'haskell-aeson' 'haskell-edit-distance-vector' 'haskell-hashable'
'haskell-scientific' 'haskell-unordered-containers' 'haskell-vector'
'haskell-optparse-applicative')
makedepends=('ghc' 'haskell-doctest' 'haskell-glob' 'haskell-quickcheck'
'haskell-quickcheck-instances' 'hlint')
source=(https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz)
sha512sums=('5a5f703dec592c0cfd825eb1899006350649c52bf810ff1aaaf4134ebfbc11f5fbe9e7f158a8c3a21dbef4902b1f9e94148bc116e27418b2b786f6d31c7561fb')
prepare() {
cd $_hkgname-$pkgver
sed -i 's/< *4.14/<5/' $_hkgname.cabal
}
build() {
cd $_hkgname-$pkgver
runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
--prefix=/usr --docdir=/usr/share/doc/$pkgname --enable-tests \
--dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid
runhaskell Setup build
runhaskell Setup register --gen-script
runhaskell Setup unregister --gen-script
sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
}
check() {
cd $_hkgname-$pkgver
runhaskell Setup test
}
package() {
cd $_hkgname-$pkgver
install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
runhaskell Setup copy --destdir="$pkgdir"
install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
}