[arch-commits] Commit in haskell-esqueleto/trunk (PKGBUILD)

Felix Yan felixonmars at gemini.archlinux.org
Tue Jul 13 19:10:49 UTC 2021


    Date: Tuesday, July 13, 2021 @ 19:10:48
  Author: felixonmars
Revision: 976875

upgpkg: haskell-esqueleto 3.5.1.0-1

Modified:
  haskell-esqueleto/trunk/PKGBUILD

----------+
 PKGBUILD |   40 +++++++++++++++++++++++++++++++++++-----
 1 file changed, 35 insertions(+), 5 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-07-13 18:49:42 UTC (rev 976874)
+++ PKGBUILD	2021-07-13 19:10:48 UTC (rev 976875)
@@ -3,8 +3,8 @@
 
 _hkgname=esqueleto
 pkgname=haskell-esqueleto
-pkgver=3.5.0.0
-pkgrel=12
+pkgver=3.5.1.0
+pkgrel=1
 pkgdesc="Type-safe EDSL for SQL queries on persistent backends."
 url="https://github.com/bitemyapp/esqueleto"
 license=("BSD")
@@ -12,15 +12,23 @@
 depends=('ghc-libs' 'haskell-aeson' 'haskell-attoparsec' 'haskell-blaze-html' 'haskell-conduit'
          'haskell-monad-logger' 'haskell-persistent' 'haskell-resourcet' 'haskell-tagged'
          'haskell-unliftio' 'haskell-unordered-containers')
-makedepends=('ghc')  # 'haskell-vector')  # Not enabled yet
+makedepends=('ghc' 'haskell-hspec' 'haskell-hspec-core' 'haskell-mysql' 'haskell-mysql-simple'
+             'haskell-persistent-mysql' 'haskell-persistent-postgresql' 'haskell-persistent-sqlite'
+             'haskell-postgresql-simple')
+checkdepends=('mariadb' 'pifpaf' 'postgresql')
 source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
-sha512sums=('9a5702a7bc80cc8d76d521faf66096e75603d9d4faa86e134e7e972e253fb88b5f1908a07456c8eb6b0b9247d34633b03a3a4e1f6ef3f090582c76b7f07ad310')
+sha512sums=('8d6bdfcd095c36800b568581121a7cf226aff4af00dee6d675ffa29f73b09e68b84806d631826140b8d0d2afbb4352c9c65fc83002cca6e3def2e3ef7535f42b')
 
+prepare() {
+    cd $_hkgname-$pkgver
+    sed -i 's/port=5432/port=9824/' test/PostgreSQL/Test.hs
+}
+
 build() {
     cd $_hkgname-$pkgver
     
     runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
-        --prefix=/usr --docdir=/usr/share/doc/$pkgname \
+        --prefix=/usr --docdir=/usr/share/doc/$pkgname --enable-tests \
         --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
             -f-mysql -f-postgresql
     runhaskell Setup build $MAKEFLAGS
@@ -30,6 +38,28 @@
     sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
 }
 
+check() {
+    cd $_hkgname-$pkgver
+    # Copied from haskell-persistent-mysql
+    mkdir -p /tmp/mysql_test
+    mysql_install_db --datadir=/tmp/mysql_test
+    mysqld --datadir=/tmp/mysql_test --socket=/tmp/socket.mysql --port 33306 --skip-grant-tables &
+    MYSQL_PID=$!
+    sleep 5
+    mysql -h 127.0.0.1 -P 33306 -u root -e "create database IF NOT EXISTS esqutest;"
+
+    # Copied from haskell-persistent-postgresql
+    eval $(pifpaf run postgresql --host 127.0.0.1)
+    createuser -s esqutest
+    createdb -O esqutest esqutest
+    
+    # mysql tests fail the same way as haskell-persistent-mysql, due to incompatibility with mariadb
+    TRAVIS=true runhaskell Setup test --show-details=direct || echo "Tests failed"
+
+    kill $MYSQL_PID
+    pifpaf_stop
+}
+
 package() {
     cd $_hkgname-$pkgver
     




More information about the arch-commits mailing list