Date: Monday, June 7, 2021 @ 10:02:57
  Author: felixonmars
Revision: 957290

archrelease: copy trunk to community-staging-x86_64

Added:
  haskell-mysql/repos/community-staging-x86_64/
  haskell-mysql/repos/community-staging-x86_64/PKGBUILD
    (from rev 957289, haskell-mysql/trunk/PKGBUILD)

----------+
 PKGBUILD |   55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 55 insertions(+)

Copied: haskell-mysql/repos/community-staging-x86_64/PKGBUILD (from rev 957289, 
haskell-mysql/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD                           (rev 0)
+++ community-staging-x86_64/PKGBUILD   2021-06-07 10:02:57 UTC (rev 957290)
@@ -0,0 +1,55 @@
+# Maintainer: Felix Yan <felixonm...@archlinux.org>
+
+_hkgname=mysql
+pkgname=haskell-mysql
+pkgver=0.2.0.1
+pkgrel=9
+pkgdesc="A low-level MySQL client library"
+url="https://github.com/paul-rouse/mysql";
+license=("BSD")
+arch=('x86_64')
+depends=('ghc-libs' 'mariadb-libs')
+makedepends=('ghc' 'haskell-hspec')
+checkdepends=('mariadb')
+source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz";)
+sha512sums=('472cedd229f51787af48af915ec3af57fbcbcfc316c47445f0355056a4dc83dea083c07ae8839736376ae8381141f1a0434a0bbebd8ca846b038239ee94f7dd1')
+
+build() {
+  cd $_hkgname-$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=-optl-Wl\,-z\,relro\,-z\,now \
+    --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 $_hkgname-$pkgver
+  mkdir -p /tmp/mysql_test
+  mysql_install_db --datadir=/tmp/mysql_test
+  mysqld --datadir=/tmp/mysql_test --socket=/tmp/socket.mysql 
--skip-grant-tables &
+  MYSQL_PID=$!
+  sleep 5
+  mysql -h 127.0.0.1 -u root -e "create database IF NOT EXISTS test;"
+
+  runhaskell Setup test --show-details=direct
+
+  kill $MYSQL_PID
+}
+
+package() {
+  cd $_hkgname-$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 -t "$pkgdir"/usr/share/licenses/$pkgname/
+  rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+}

Reply via email to