archrelease: copy trunk to community-x86_64
[ArchLinux/community.git] / arch-hs / repos / community-x86_64 / PKGBUILD
blobd7f53c65c3442b1c20cc2cfffd4cd5e6f7b71bdd
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: berberman <hatsue@typed.icu>
4 pkgname=arch-hs
5 pkgver=0.11.0.0
6 pkgrel=42
7 pkgdesc="Distribute hackage packages to archlinux"
8 arch=('x86_64')
9 url="https://github.com/berberman/arch-hs"
10 license=('MIT')
11 depends=('ghc-libs' 'pacman' 'haskell-diff' 'haskell-aeson' 'haskell-algebraic-graphs'
12          'haskell-arch-web' 'haskell-conduit' 'haskell-conduit-extra' 'haskell-hackage-db'
13          'haskell-http-client' 'haskell-http-client-tls' 'haskell-megaparsec' 'haskell-microlens'
14          'haskell-microlens-th' 'haskell-neat-interpolation' 'haskell-optparse-simple'
15          'haskell-polysemy' 'haskell-prettyprinter' 'haskell-prettyprinter-ansi-terminal'
16          'haskell-servant-client' 'haskell-split' 'haskell-tar-conduit')
17 makedepends=('ghc' 'uusi')
18 source=("https://hackage.haskell.org/packages/archive/$pkgname/$pkgver/$pkgname-$pkgver.tar.gz")
19 sha512sums=('a0713c8db730072e77865bd6e80efb024d70bceb93914a58a9a11fed3d8112afeac8ad2a587bb7c2affb85db52467f83efc76ea0b08bd3cf5fc0b4ced9364915')
21 _gen_comp(){
22   LD_LIBRARY_PATH="$PWD/dist/build" dist/build/arch-hs${1}/arch-hs${1} --bash-completion-script "/usr/bin/arch-hs${1}" > bash${1}
23   LD_LIBRARY_PATH="$PWD/dist/build" dist/build/arch-hs${1}/arch-hs${1} --zsh-completion-script  "/usr/bin/arch-hs${1}" > zsh${1}
24   LD_LIBRARY_PATH="$PWD/dist/build" dist/build/arch-hs${1}/arch-hs${1} --fish-completion-script "/usr/bin/arch-hs${1}" > fish${1}
27 _install_comp(){
28   install -D -m644 bash${1} "$pkgdir/usr/share/bash-completion/completions/arch-hs${1}"
29   install -D -m644 zsh${1}  "$pkgdir/usr/share/zsh/site-functions/_arch-hs${1}"
30   install -D -m644 fish${1} "$pkgdir/usr/share/fish/vendor_completions.d/arch-hs${1}.fish"
33 prepare() {
34   cd $pkgname-$pkgver
35   uusi -u polysemy $pkgname.cabal
38 build() {
39   cd $pkgname-$pkgver
40   runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
41     --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname \
42     --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
43     --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
44     --ghc-option='-pie' -falpm
46   runhaskell Setup build $MAKEFLAGS
47   runhaskell Setup register --gen-script
48   runhaskell Setup unregister --gen-script
49   sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
50   sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
51   
52   _gen_comp
53   _gen_comp "-diff"
54   _gen_comp "-sync"
57 package() {
58   cd $pkgname-$pkgver
59   install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
60   install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
61   runhaskell Setup copy --destdir="$pkgdir"
62   install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
63   rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
64   
65   _install_comp
66   _install_comp "-diff"
67   _install_comp "-sync"
68