archrelease: copy trunk to community-any
[ArchLinux/community.git] / haskell-bytestring-handle / trunk / PKGBUILD
blobafa764c34131af304162e510f99e5afe21c35164
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 _hkgname=bytestring-handle
4 pkgname=haskell-bytestring-handle
5 pkgver=0.1.0.6
6 pkgrel=143
7 pkgdesc="ByteString-backed Handles"
8 url="http://hub.darcs.net/ganesh/bytestring-handle"
9 license=("BSD")
10 arch=('x86_64')
11 depends=('ghc-libs')
12 makedepends=('ghc' 'uusi' 'haskell-hunit' 'haskell-quickcheck' 'haskell-test-framework'
13              'haskell-test-framework-hunit' 'haskell-test-framework-quickcheck2')
14 source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz"
15         ghc9.patch)
16 sha256sums=('fe681cdf7e2238389b6d2090e264b10d0e5085658c89e7ffc870c7a0a43ac1a1'
17             '574a5813bbd92a195521c90d4c7e30f883b9b901af8d50cf3d8d53170d402902')
19 prepare() {
20   uusi -u QuickCheck -u base $_hkgname-$pkgver/$_hkgname.cabal
21   patch -d $_hkgname-$pkgver -p2 < ghc9.patch
24 build() {
25   cd $_hkgname-$pkgver
27   runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
28     --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
29     --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
30     --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
31     --ghc-option='-pie'
33   runhaskell Setup build $MAKEFLAGS
34   runhaskell Setup register --gen-script
35   runhaskell Setup unregister --gen-script
36   sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
37   sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
40 check() {
41   cd $_hkgname-$pkgver
42   runhaskell Setup test --show-details=direct
45 package() {
46   cd $_hkgname-$pkgver
48   install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
49   install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
50   runhaskell Setup copy --destdir="$pkgdir"
51   install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
52   rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE