[arch-commits] Commit in (4 files)

Felix Yan felixonmars at archlinux.org
Wed Nov 11 22:23:42 UTC 2020


    Date: Wednesday, November 11, 2020 @ 22:23:41
  Author: felixonmars
Revision: 751268

addpkg: haskell-mysql 0.1.7.2-1

Added:
  haskell-mysql/
  haskell-mysql/repos/
  haskell-mysql/trunk/
  haskell-mysql/trunk/PKGBUILD

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

Added: haskell-mysql/trunk/PKGBUILD
===================================================================
--- haskell-mysql/trunk/PKGBUILD	                        (rev 0)
+++ haskell-mysql/trunk/PKGBUILD	2020-11-11 22:23:41 UTC (rev 751268)
@@ -0,0 +1,55 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+_hkgname=mysql
+pkgname=haskell-mysql
+pkgver=0.1.7.2
+pkgrel=1
+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")
+sha256sums=('164cf43e8c9fbe709cfdba0282922358c9b5d46400550ce7e31896d2611a6c6e')
+
+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
+  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
+
+  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
+}



More information about the arch-commits mailing list