archrelease: copy trunk to community-any
[ArchLinux/community.git] / haskell-mmark / trunk / PKGBUILD
blob98a8f02791d89b1f6a68a717b4c2ec8213174df4
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 _hkgname=mmark
4 pkgname=haskell-mmark
5 pkgver=0.0.7.6
6 pkgrel=106
7 pkgdesc="Strict markdown processor for writers"
8 url="https://github.com/mmark-md/mmark"
9 license=("BSD")
10 arch=('x86_64')
11 depends=('ghc-libs' 'haskell-aeson' 'haskell-case-insensitive' 'haskell-dlist'
12          'haskell-email-validate' 'haskell-foldl' 'haskell-hashable' 'haskell-html-entity-map'
13          'haskell-lucid' 'haskell-megaparsec' 'haskell-microlens' 'haskell-microlens-th'
14          'haskell-modern-uri' 'haskell-parser-combinators' 'haskell-text-metrics'
15          'haskell-unordered-containers' 'haskell-yaml')
16 makedepends=('ghc' 'haskell-quickcheck' 'haskell-hspec' 'haskell-hspec-megaparsec')
17 source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz")
18 sha256sums=('8c78a5aa7a1806c315bf8c0aa68321f04f508d72e4cac412ea401371fc7c50fd')
20 build() {
21   cd $_hkgname-$pkgver
23   runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
24     --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
25     --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
26     --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
27     --ghc-option='-pie'
29   runhaskell Setup build $MAKEFLAGS
30   runhaskell Setup register --gen-script
31   runhaskell Setup unregister --gen-script
32   sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
33   sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
36 check() {
37   cd $_hkgname-$pkgver
38   runhaskell Setup test --show-details=direct || echo "Tests failed with new hashable"
41 package() {
42   cd $_hkgname-$pkgver
44   install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
45   install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
46   runhaskell Setup copy --destdir="$pkgdir"
47   install -D -m644 LICENSE.md -t "$pkgdir"/usr/share/licenses/$pkgname/
48   rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE.md