1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Arch Haskell Team <arch-haskell@haskell.org>
5 pkgname=haskell-doctest
8 pkgdesc="Test interactive Haskell examples"
9 url="https://github.com/sol/doctest"
12 depends=('ghc-libs' 'haskell-base-compat' 'haskell-ghc' 'haskell-syb'
13 'haskell-code-page' 'haskell-ghc-paths')
15 checkdepends=('haskell-hunit' 'haskell-hspec' 'haskell-hspec-core' 'haskell-hspec-discover'
16 'haskell-quickcheck' 'haskell-stringbuilder' 'haskell-silently' 'haskell-setenv'
18 source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
19 sha512sums=('4fd669d291751726c48b884106817aea0c03e537744fc91a28c4f909ef0db983d41d06d47c757e66b973b8e8beaee76d677385b115e8ebf949dfd3f1908bf7ee')
23 sed -i 's/\+\+ packageDBArgs/++ packageDBArgs ++ ["-dynamic"]/' $_hkgname-$pkgver/src/Extract.hs
24 sed -i 's/\+\+ expandedArgs)/++ expandedArgs ++ ["-dynamic"])/' $_hkgname-$pkgver/src/Run.hs
30 if (( CHECKFUNC )); then
31 _opts=('--enable-tests')
33 _opts=('--disable-tests')
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
48 runhaskell Setup test --show-details=direct
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