archrelease: copy trunk to community-any
[arch-community.git] / haskell-async / trunk / PKGBUILD
blob124c9c808deefa680975e8cf231554c995eb5bef
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Arch Haskell Team <arch-haskell@haskell.org>
4 _hkgname=async
5 pkgname=haskell-async
6 pkgver=2.2.4
7 pkgrel=155
8 pkgdesc="Run IO operations asynchronously and wait for their results"
9 url="https://github.com/simonmar/async"
10 license=("BSD")
11 arch=('x86_64')
12 depends=('ghc-libs' 'haskell-hashable')
13 makedepends=('ghc' 'uusi')
14 checkdepends=('haskell-hunit' 'haskell-test-framework' 'haskell-test-framework-hunit')
15 source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
16 sha512sums=('24f37f974dd7573138475d04c0fccb97fcbd8b3de56f7d06199b8f936fd9a29cd0ba0574212a753a81de8958b3292ecee79d0e8d0d2f51eb91874424e6219569')
18 prepare() {
19     cd $_hkgname-$pkgver
20     uusi -u hashable $_hkgname.cabal
23 build() {
24     cd $_hkgname-$pkgver
26     if (( CHECKFUNC )); then
27         _opts=('--enable-tests')
28     else
29         _opts=('--disable-tests')
30     fi
31     
32     runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
33         --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname "${_opts[@]}" \
34         --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm
35     runhaskell Setup build $MAKEFLAGS
36     runhaskell Setup register --gen-script
37     runhaskell Setup unregister --gen-script
38     sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
39     sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
42 check() {
43     cd $_hkgname-$pkgver
44     runhaskell Setup test --show-details=direct
47 package() {
48     cd $_hkgname-$pkgver
49     
50     install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
51     install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
52     runhaskell Setup copy --destdir="$pkgdir"
53     install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
54     rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE