archrelease: copy trunk to community-any
[ArchLinux/community.git] / haskell-hiedb / trunk / PKGBUILD
blob159a6d0b5fef5f6f86630f1053eeb7bb95c3222e
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
3 _hkgname=hiedb
4 pkgname=haskell-hiedb
5 pkgver=0.4.2.0
6 pkgrel=18
7 pkgdesc="Generates a references DB from .hie files"
8 url="https://github.com/wz1000/HieDb"
9 license=("BSD")
10 arch=('x86_64')
11 depends=('ghc-libs' 'haskell-algebraic-graphs' 'haskell-ansi-terminal' 'haskell-extra' 'haskell-ghc'
12          'haskell-ghc-paths' 'haskell-hie-compat' 'haskell-lucid' 'haskell-optparse-applicative'
13          'haskell-sqlite-simple' 'haskell-terminal-size')
14 makedepends=('ghc' 'uusi' 'haskell-hspec' 'haskell-temporary')
15 source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz")
16 sha512sums=('77b7b45ed63e72c8e93a7945f76449e3350f3bf4f6e6c5e6e526e44d852c9fcc20019fc0ac734e367722cf212ba99518ee7a1f6fa28decb4f236c93ad3f7dde8')
18 prepare() {
19   cd hiedb-$pkgver
20   sed -i 's/callProcess hc args/callProcess hc (["-dynamic"] ++ args)/' test/Main.hs
22   # algebraic-graphs 0.7
23   sed -i 's/dfs vs m/dfs m vs/' src/HieDb/Query.hs
25   uusi -u algebraic-graphs $_hkgname.cabal
28 build() {
29   cd hiedb-$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 hiedb-$pkgver
46   PATH="$PWD/dist/build/hiedb:$PATH" LD_LIBRARY_PATH="$PWD/dist/build" runhaskell Setup test --show-details=direct
49 package() {
50   cd hiedb-$pkgver
52   install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
53   install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
54   runhaskell Setup copy --destdir="$pkgdir"
55   install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
56   rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE