Date: Wednesday, November 17, 2021 @ 18:04:10 Author: felixonmars Revision: 1050324
archrelease: copy trunk to community-staging-x86_64 Added: postgrest/repos/community-staging-x86_64/ postgrest/repos/community-staging-x86_64/PKGBUILD (from rev 1050323, postgrest/trunk/PKGBUILD) ----------+ PKGBUILD | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) Copied: postgrest/repos/community-staging-x86_64/PKGBUILD (from rev 1050323, postgrest/trunk/PKGBUILD) =================================================================== --- community-staging-x86_64/PKGBUILD (rev 0) +++ community-staging-x86_64/PKGBUILD 2021-11-17 18:04:10 UTC (rev 1050324) @@ -0,0 +1,69 @@ +# Maintainer: Felix Yan <felixonm...@archlinux.org> +# Contributor: Arch Haskell Team <arch-hask...@haskell.org> + +pkgname=postgrest +pkgver=8.0.0 +pkgrel=48 +pkgdesc="REST API for any Postgres database" +url="https://github.com/begriffs/postgrest" +license=("MIT") +arch=('x86_64') +depends=('ghc-libs' 'haskell-http' 'haskell-ranged-sets' 'haskell-aeson' 'haskell-ansi-wl-pprint' + 'haskell-base64-bytestring' 'haskell-case-insensitive' 'haskell-cassava' + 'haskell-configurator-pg' 'haskell-contravariant' 'haskell-contravariant-extras' + 'haskell-cookie' 'haskell-either' 'haskell-fast-logger' 'haskell-gitrev' 'haskell-hasql' + 'haskell-hasql-dynamic-statements' 'haskell-hasql-notifications' 'haskell-hasql-pool' + 'haskell-hasql-transaction' 'haskell-heredoc' 'haskell-http-types' + 'haskell-insert-ordered-containers' 'haskell-interpolatedstring-perl6' 'haskell-jose' + 'haskell-lens' 'haskell-lens-aeson' 'haskell-network-uri' 'haskell-optparse-applicative' + 'haskell-parsec' 'haskell-protolude' 'haskell-regex-tdfa' 'haskell-scientific' + 'haskell-swagger2' 'haskell-unordered-containers' 'haskell-vector' 'haskell-wai' + 'haskell-wai-cors' 'haskell-wai-extra' 'haskell-wai-logger' 'haskell-wai-middleware-static' + 'haskell-auto-update' 'haskell-retry' 'haskell-warp') +makedepends=('ghc' 'uusi' 'haskell-aeson-qq' 'haskell-async' 'haskell-hspec' 'haskell-hspec-wai' + 'haskell-hspec-wai-json' 'haskell-monad-control' 'haskell-transformers-base') +checkdepends=('pifpaf' 'postgresql' 'procps-ng') +source=("https://github.com/begriffs/postgrest/archive/v$pkgver/$pkgname-$pkgver.tar.gz") +sha512sums=('ae3f004d3042e236ffd3870c980cdfbb615a3de5433bd917816e8c0e719edb0bfcba763bb3c920dad64461410374231a6ab7710d48b310cdc30d5dd6f1f58337') + +prepare() { + cd $pkgname-$pkgver + uusi -u base -u hspec -u retry $pkgname.cabal +} + +build() { + cd $pkgname-$pkgver + + runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \ + --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --enable-tests \ + --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \ + -f-CI --ghc-option='-pie' + runhaskell Setup build $MAKEFLAGS + runhaskell Setup register --gen-script + runhaskell Setup unregister --gen-script + sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh + sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh +} + +check() { + cd $pkgname-$pkgver + + eval $(pifpaf run postgresql --host 127.0.0.1) + createuser -s postgrest_test + POSTGREST_TEST_CONNECTION=$(test/create_test_db "postgres://$USER@localhost" postgrest_test) runhaskell Setup test --show-details=direct + + # Disabled: uses stack + # test/io-tests.sh + + pifpaf_stop +} + +package() { + cd $pkgname-$pkgver + + install -D -m744 register.sh "${pkgdir}/usr/share/haskell/register/${pkgname}.sh" + install -D -m744 unregister.sh "${pkgdir}/usr/share/haskell/unregister/${pkgname}.sh" + runhaskell Setup copy --destdir="${pkgdir}" + install -D -m644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE + rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE +}