Date: Tuesday, June 7, 2022 @ 05:16:58 Author: felixonmars Revision: 1227236
archrelease: copy trunk to community-staging-x86_64 Added: postgrest/repos/community-staging-x86_64/ postgrest/repos/community-staging-x86_64/PKGBUILD (from rev 1227235, postgrest/trunk/PKGBUILD) ----------+ PKGBUILD | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) Copied: postgrest/repos/community-staging-x86_64/PKGBUILD (from rev 1227235, postgrest/trunk/PKGBUILD) =================================================================== --- community-staging-x86_64/PKGBUILD (rev 0) +++ community-staging-x86_64/PKGBUILD 2022-06-07 05:16:58 UTC (rev 1227236) @@ -0,0 +1,73 @@ +# Maintainer: Felix Yan <felixonm...@archlinux.org> +# Contributor: Arch Haskell Team <arch-hask...@haskell.org> + +pkgname=postgrest +pkgver=8.0.0 +pkgrel=208 +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-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 hasql -u hasql-pool -u hspec -u HTTP -u lens -u retry $pkgname.cabal + + # TODO: not a proper fix. probably newly added "column" should be shown too + sed -i 's/H.RowError i/H.RowError i _/' src/PostgREST/Error.hs +} + +build() { + cd $pkgname-$pkgver + + runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \ + --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$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 + # https://github.com/PostgREST/postgrest/issues/1857 + POSTGREST_TEST_CONNECTION=$(test/create_test_db "postgres://$USER@localhost" postgrest_test) runhaskell Setup test --show-details=direct || echo "Tests failed" + + # 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 +}