upgpkg: wordpress 6.2.1-1
[ArchLinux/community.git] / haskell-postgresql-binary / trunk / PKGBUILD
blob1ed7559880ef4464592e6979705781d38513c066
1 # Maintainer: Felix Yan <felixonmars@archlinux.org>
2 # Contributor: Arch Haskell Team <arch-haskell@haskell.org>
4 _hkgname=postgresql-binary
5 pkgname=haskell-postgresql-binary
6 pkgver=0.12.5
7 pkgrel=41
8 pkgdesc="Encoders and decoders for the PostgreSQL's binary format"
9 url="https://github.com/nikita-volkov/postgresql-binary"
10 license=("MIT")
11 arch=('x86_64')
12 depends=('ghc-libs' 'haskell-aeson' 'haskell-binary-parser' 'haskell-bytestring-strict-builder'
13          'haskell-network-ip' 'haskell-scientific' 'haskell-unordered-containers'
14          'haskell-uuid' 'haskell-vector')
15 makedepends=('ghc' 'uusi' 'haskell-postgresql-libpq' 'haskell-tasty' 'haskell-tasty-quickcheck'
16              'haskell-tasty-hunit' 'haskell-quickcheck' 'haskell-quickcheck-instances'
17              'haskell-rerebase' 'pifpaf' 'postgresql')
18 source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
19 sha512sums=('471bd8c9fb97ef891fde094f616f246d6228f8eccc1c17a711e84604b1ea1f157f37ada4cfeb670d71afc83df11158cc16227d254bd8c00024dbf4351b6ac7ad')
21 prepare() {
22     cd $_hkgname-$pkgver
23     gen-setup
24     # Do not use default postgres port
25     sed -i 's/5432/9824/' tasty/Main/DB.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     runhaskell Setup build $MAKEFLAGS
35     runhaskell Setup register --gen-script
36     runhaskell Setup unregister --gen-script
37     sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
38     sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
41 check() {
42     cd $_hkgname-$pkgver
44     eval $(pifpaf run postgresql --host 127.0.0.1)
45     createuser -s postgres
46     runhaskell Setup test --show-details=direct
47     pifpaf_stop
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 "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
57     rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE