1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
4 pkgname=haskell-brittany
7 pkgdesc="Haskell source code formatter"
8 url="https://github.com/lspitzner/brittany/"
11 depends=('ghc-libs' 'haskell-aeson' 'haskell-butcher' 'haskell-cmdargs' 'haskell-czipwith'
12 'haskell-data-tree-print' 'haskell-extra' 'haskell-ghc' 'haskell-ghc-exactprint'
13 'haskell-monad-memo' 'haskell-multistate' 'haskell-random' 'haskell-safe'
14 'haskell-strict' 'haskell-syb' 'haskell-uniplate' 'haskell-yaml')
15 makedepends=('ghc' 'uusi' 'haskell-hspec')
16 source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz")
17 sha512sums=('966984304e1a156d96d7354030c7d3f62752ea4274d5aff0045e0be975fa7cf91ca02c779208fa6dd5cbf7e4c6f992b3f9efa279400574d5da8baca62b0ff8f3')
21 uusi -r semigroups:Cabal -u aeson -u hspec $_hkgname.cabal
24 # Hack to use Cabal's compatibility layer of semigroups
25 sed -i 's/import Data.Semigroup.Generic/import Distribution.Compat.Semigroup/' source/library/Language/Haskell/Brittany/Internal/Config/Types.hs
31 runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
32 --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
33 --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
34 --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
37 runhaskell Setup build $MAKEFLAGS
38 runhaskell Setup register --gen-script
39 runhaskell Setup unregister --gen-script
40 sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
41 sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
47 runhaskell Setup test --show-details=direct
53 install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
54 install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
55 runhaskell Setup copy --destdir="$pkgdir"
56 install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
57 rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE