archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / haskell-brittany / trunk / PKGBUILD
blobe8253b4bc4accbf5647b8f498abee4e0e4e4a701
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 _hkgname=brittany
4 pkgname=haskell-brittany
5 pkgver=0.14.0.2
6 pkgrel=50
7 pkgdesc="Haskell source code formatter"
8 url="https://github.com/lspitzner/brittany/"
9 license=("AGPL")
10 arch=('x86_64')
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')
19 prepare() {
20   cd $_hkgname-$pkgver
21   uusi -r semigroups:Cabal -u aeson -u hspec $_hkgname.cabal
22   gen-setup
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
28 build() {
29   cd $_hkgname-$pkgver
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 \
35     --ghc-option='-pie'
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
44 check() {
45   cd $_hkgname-$pkgver
46   mkdir output
47   runhaskell Setup test --show-details=direct
50 package() {
51   cd $_hkgname-$pkgver
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