[arch-commits] Commit in (4 files)

Felix Yan felixonmars at archlinux.org
Sun Mar 22 12:35:55 UTC 2020


    Date: Sunday, March 22, 2020 @ 12:35:55
  Author: felixonmars
Revision: 603487

addpkg: haskell-optics-th 0.2-1

Added:
  haskell-optics-th/
  haskell-optics-th/repos/
  haskell-optics-th/trunk/
  haskell-optics-th/trunk/PKGBUILD

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

Added: haskell-optics-th/trunk/PKGBUILD
===================================================================
--- haskell-optics-th/trunk/PKGBUILD	                        (rev 0)
+++ haskell-optics-th/trunk/PKGBUILD	2020-03-22 12:35:55 UTC (rev 603487)
@@ -0,0 +1,47 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+_hkgname=optics-th
+pkgname=haskell-optics-th
+pkgver=0.2
+pkgrel=1
+pkgdesc="Optics construction using TemplateHaskell"
+url="https://github.com/well-typed/optics"
+license=('BSD')
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-optics-core' 'haskell-th-abstraction')
+makedepends=('ghc')
+source=(https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz)
+sha512sums=('1898d083597ab2c1a8f8c791c8e96d64248c6a4015fe0752b96b1d7dca6c2ae6c24cd635f4d40264445f44718a2c4b64fdc9e96537a144fb441f14a497236305')
+
+prepare() {
+    cd $_hkgname-$pkgver
+    echo -e "import Distribution.Simple\nmain = defaultMain" > Setup.hs
+}
+
+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
+    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
+    runhaskell Setup test
+}
+
+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 "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
+    rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+}



More information about the arch-commits mailing list