[arch-commits] Commit in haskell-persistent-qq/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Thu Nov 26 03:04:14 UTC 2020
Date: Thursday, November 26, 2020 @ 03:04:13
Author: felixonmars
Revision: 761344
archrelease: copy trunk to community-staging-x86_64
Added:
haskell-persistent-qq/repos/community-staging-x86_64/
haskell-persistent-qq/repos/community-staging-x86_64/PKGBUILD
(from rev 761343, haskell-persistent-qq/trunk/PKGBUILD)
haskell-persistent-qq/repos/community-staging-x86_64/persistent-2.11.patch
(from rev 761343, haskell-persistent-qq/trunk/persistent-2.11.patch)
-----------------------+
PKGBUILD | 58 ++++++++++++++++++++++++++++++++++++++++++++++++
persistent-2.11.patch | 27 ++++++++++++++++++++++
2 files changed, 85 insertions(+)
Copied: haskell-persistent-qq/repos/community-staging-x86_64/PKGBUILD (from rev 761343, haskell-persistent-qq/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2020-11-26 03:04:13 UTC (rev 761344)
@@ -0,0 +1,58 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+_hkgname=persistent-qq
+pkgname=haskell-persistent-qq
+pkgver=2.9.2
+pkgrel=31
+pkgdesc="Provides a quasi-quoter for raw SQL for persistent"
+url="https://github.com/yesod-web/persistent"
+license=('MIT')
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-src-meta' 'haskell-persistent')
+makedepends=('ghc' 'haskell-aeson' 'haskell-fast-logger' 'haskell-hspec' 'haskell-hunit'
+ 'haskell-monad-logger' 'haskell-persistent-sqlite' 'haskell-persistent-template'
+ 'haskell-resourcet' 'haskell-unliftio')
+source=(https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz
+ persistent-2.11.patch)
+sha512sums=('48d6783abf366b327e68e5a1619585c056836885e552b6596eda056cf7758a8b426c3cf27ac7c67cb772bd482de9afbe7365b7647bbf31c529089810b5d5dd97'
+ '9f628d9119daa4a20fedc7ba8422b019bc7c9eb22fd8854c27dc0e61ea14bbb75bf0ff9d8cd9018d79878571ec6e53f3898d874ed26616e675c4dff421c29fa4')
+
+prepare() {
+ cd $_hkgname-$pkgver
+ patch -p2 -i ../persistent-2.11.patch
+ sed -i '/LANGUAGE FlexibleContexts/a {-# LANGUAGE DataKinds #-}' test/PersistentTestModels.hs
+}
+
+build() {
+ cd $_hkgname-$pkgver
+
+ if (( CHECKFUNC )); then
+ _opts=('--enable-tests')
+ else
+ _opts=('--disable-tests')
+ fi
+
+ runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+ --prefix=/usr --docdir=/usr/share/doc/$pkgname "${_opts[@]}" \
+ --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid
+ 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
+ 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
+}
Copied: haskell-persistent-qq/repos/community-staging-x86_64/persistent-2.11.patch (from rev 761343, haskell-persistent-qq/trunk/persistent-2.11.patch)
===================================================================
--- community-staging-x86_64/persistent-2.11.patch (rev 0)
+++ community-staging-x86_64/persistent-2.11.patch 2020-11-26 03:04:13 UTC (rev 761344)
@@ -0,0 +1,27 @@
+diff --git a/persistent-qq/test/PersistentTestModels.hs b/persistent-qq/test/PersistentTestModels.hs
+index 53256dd5..da333603 100644
+--- a/persistent-qq/test/PersistentTestModels.hs
++++ b/persistent-qq/test/PersistentTestModels.hs
+@@ -15,6 +15,7 @@ module PersistentTestModels where
+ import Control.Monad.Reader
+ import Data.Aeson
+ import Data.Text (Text)
++import Data.Proxy
+
+ import Database.Persist.Sql
+ import Database.Persist.TH
+@@ -140,9 +141,11 @@ instance (PersistEntity a) => PersistEntity (ReverseFieldOrder a) where
+ keyFromValues = fmap RFOKey . fromPersistValue . head
+ keyToValues = (:[]) . toPersistValue . unRFOKey
+
+- entityDef = revFields . entityDef . liftM unRFO
+- where
+- revFields ed = ed { entityFields = reverse (entityFields ed) }
++ entityDef = revFields . entityDef . unRfoProxy
++ where
++ revFields ed = ed { entityFields = reverse (entityFields ed) }
++ unRfoProxy :: proxy (ReverseFieldOrder a) -> Proxy a
++ unRfoProxy _ = Proxy
+
+ toPersistFields = reverse . toPersistFields . unRFO
+ newtype EntityField (ReverseFieldOrder a) b = EFRFO {unEFRFO :: EntityField a b}
More information about the arch-commits
mailing list