archrelease: copy trunk to community-any
[arch-community.git] / haskell-xmlgen / trunk / PKGBUILD
blob5e1d6861bafe8eacd25ddcfcc689dd71cc45a6bf
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 _hkgname=xmlgen
4 pkgname=haskell-xmlgen
5 pkgver=0.6.2.2
6 pkgrel=56
7 pkgdesc="Fast XML generation library"
8 url="https://github.com/skogsbaer/xmlgen"
9 license=("BSD")
10 arch=('x86_64')
11 depends=('ghc-libs' 'haskell-blaze-builder')
12 makedepends=('ghc' 'git' 'haskell-hunit' 'haskell-quickcheck' 'haskell-hxt')
13 source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz"
14         "git+https://github.com/skogsbaer/xmlgen.git")
15 sha256sums=('926fa98c77525f5046274758fcebd190e86de3f53a4583179e8ce328f25a34d6'
16             'SKIP')
18 prepare() {
19   cd $_hkgname-$pkgver
20   sed -i 's/Q.Success _ _ _ ->/Q.Success _ _ _ _ _ _ ->/' test/GeneratorTest.hs
22   # testdata missing from hackage tarball
23   cp ../xmlgen/test/*.xml test/
26 build() {
27   cd $_hkgname-$pkgver
29   runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
30     --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
31     --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
32     --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
33     --ghc-option='-pie'
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
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 -t "$pkgdir"/usr/share/licenses/$pkgname/
54   rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE