archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / haskell-doctest / trunk / PKGBUILD
blobecf56a0695f1feac2ad41daf47a176c2f4935eac
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Arch Haskell Team <arch-haskell@haskell.org>
4 _hkgname=doctest
5 pkgname=haskell-doctest
6 pkgver=0.20.1
7 pkgrel=30
8 pkgdesc="Test interactive Haskell examples"
9 url="https://github.com/sol/doctest"
10 license=("MIT")
11 arch=('x86_64')
12 depends=('ghc-libs' 'haskell-base-compat' 'haskell-ghc' 'haskell-syb'
13          'haskell-code-page' 'haskell-ghc-paths')
14 makedepends=('ghc')
15 checkdepends=('haskell-hunit' 'haskell-hspec' 'haskell-hspec-core' 'haskell-hspec-discover'
16               'haskell-quickcheck' 'haskell-stringbuilder' 'haskell-silently' 'haskell-setenv'
17               'haskell-mockery')
18 source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
19 sha512sums=('4fd669d291751726c48b884106817aea0c03e537744fc91a28c4f909ef0db983d41d06d47c757e66b973b8e8beaee76d677385b115e8ebf949dfd3f1908bf7ee')
21 prepare() {
22     # Add -dynamic flag
23     sed -i 's/\+\+ packageDBArgs/++ packageDBArgs ++ ["-dynamic"]/' $_hkgname-$pkgver/src/Extract.hs
24     sed -i 's/\+\+ expandedArgs)/++ expandedArgs ++ ["-dynamic"])/' $_hkgname-$pkgver/src/Run.hs
27 build() {
28     cd $_hkgname-$pkgver
30     if (( CHECKFUNC )); then
31         _opts=('--enable-tests')
32     else
33         _opts=('--disable-tests')
34     fi
36     runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
37         --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname "${_opts[@]}" \
38         --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm
39     runhaskell Setup build $MAKEFLAGS
40     runhaskell Setup register --gen-script
41     runhaskell Setup unregister --gen-script
42     sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
43     sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
46 check() {
47     cd $_hkgname-$pkgver
48     runhaskell Setup test --show-details=direct
51 package() {
52     cd $_hkgname-$pkgver
54     install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
55     install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
56     runhaskell Setup copy --destdir="$pkgdir"
57     install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
58     rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE