1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: berberman <hatsue@typed.icu>
7 pkgdesc="Distribute hackage packages to archlinux"
9 url="https://github.com/berberman/arch-hs"
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')
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}
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"
35 uusi -u polysemy $pkgname.cabal
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
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