[arch-commits] Commit in haskell-rank2classes/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Fri Jul 2 10:57:24 UTC 2021
Date: Friday, July 2, 2021 @ 10:57:24
Author: felixonmars
Revision: 970663
archrelease: copy trunk to community-staging-x86_64
Added:
haskell-rank2classes/repos/community-staging-x86_64/
haskell-rank2classes/repos/community-staging-x86_64/PKGBUILD
(from rev 970662, haskell-rank2classes/trunk/PKGBUILD)
haskell-rank2classes/repos/community-staging-x86_64/ghc9.patch
(from rev 970662, haskell-rank2classes/trunk/ghc9.patch)
------------+
PKGBUILD | 49 +++++++++++++++++++++++++++++++++++++++
ghc9.patch | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 123 insertions(+)
Copied: haskell-rank2classes/repos/community-staging-x86_64/PKGBUILD (from rev 970662, haskell-rank2classes/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2021-07-02 10:57:24 UTC (rev 970663)
@@ -0,0 +1,49 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+_hkgname=rank2classes
+pkgname=haskell-rank2classes
+pkgver=1.4.1
+pkgrel=64
+pkgdesc="Standard type constructor class hierarchy, only with methods of rank 2 types"
+url="https://github.com/blamario/grampa/tree/master/rank2classes"
+license=('BSD')
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-distributive')
+makedepends=('ghc' 'haskell-cabal-doctest' 'haskell-doctest' 'haskell-markdown-unlit'
+ 'haskell-tasty' 'haskell-tasty-hunit')
+source=(https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz
+ ghc9.patch)
+sha512sums=('5c1c271809d98105c9d0bfa0a453871b4ac322d954ac9a1048d8846081782f5080c7051d3f3d58d8620c8221f3ea5b4761311677ff1968daabc4e5a6dfbc8d5e'
+ '0b80333b0f463ae5b07c90d453526943448e2e5898936fd9cf308e8c2c0864cd77f534e1579dd53ee40dbeeec47ca41b0c8ac982f6fc0ad1fd2d2c85501924ff')
+
+prepare() {
+ patch -d $_hkgname-$pkgver -p2 < ghc9.patch
+}
+
+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 $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 --show-details=direct
+}
+
+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-rank2classes/repos/community-staging-x86_64/ghc9.patch (from rev 970662, haskell-rank2classes/trunk/ghc9.patch)
===================================================================
--- community-staging-x86_64/ghc9.patch (rev 0)
+++ community-staging-x86_64/ghc9.patch 2021-07-02 10:57:24 UTC (rev 970663)
@@ -0,0 +1,74 @@
+commit 69c30b213fc734ac4b89290e9354dc1304296155
+Author: Felix Yan <felixonmars at archlinux.org>
+Date: Mon Jun 21 09:21:42 2021 +0800
+
+ Fix compatibility with GHC 9
+
+diff --git a/rank2classes/rank2classes.cabal b/rank2classes/rank2classes.cabal
+index 334ceac..33dbfca 100644
+--- a/rank2classes/rank2classes.cabal
++++ b/rank2classes/rank2classes.cabal
+@@ -43,7 +43,7 @@ library
+ distributive < 0.7
+
+ if flag(use-template-haskell)
+- build-depends: template-haskell >= 2.11 && < 2.17
++ build-depends: template-haskell >= 2.11 && < 2.18
+ exposed-modules: Rank2.TH
+
+ test-suite doctests
+diff --git a/rank2classes/src/Rank2.hs b/rank2classes/src/Rank2.hs
+index 26933eb..75a30f9 100644
+--- a/rank2classes/src/Rank2.hs
++++ b/rank2classes/src/Rank2.hs
+@@ -415,16 +415,16 @@ instance (Apply f, Apply g) => Apply ((Generics.:*:) f g) where
+ (x1 Generics.:*: y1) <*> (x2 Generics.:*: y2) = (x1 <*> x2) Generics.:*: (y1 <*> y2)
+
+ instance Applicative Empty where
+- pure = const Empty
++ pure _ = Empty
+
+ instance Applicative Proxy where
+- pure = const Proxy
++ pure _ = Proxy
+
+ instance (Semigroup x, Monoid x) => Applicative (Const x) where
+- pure = const (Const mempty)
++ pure _ = Const mempty
+
+ instance Applicative (Only x) where
+- pure = Only
++ pure f = Only f
+
+ instance Applicative g => Applicative (Identity g) where
+ pure f = Identity (pure f)
+diff --git a/rank2classes/src/Rank2/TH.hs b/rank2classes/src/Rank2/TH.hs
+index b05d3d4..5f85015 100644
+--- a/rank2classes/src/Rank2/TH.hs
++++ b/rank2classes/src/Rank2/TH.hs
+@@ -7,6 +7,7 @@
+ --
+ -- or, if you're picky, you can invoke only 'deriveFunctor' and whichever other instances you need instead.
+
++{-# Language CPP #-}
+ {-# Language TemplateHaskell #-}
+ -- Adapted from https://wiki.haskell.org/A_practical_Template_Haskell_Tutorial
+
+@@ -98,10 +99,17 @@ reifyConstructors cls ty = do
+ NewtypeD _ nm tyVars kind c _ -> return (nm, tyVars, kind, [c])
+ _ -> fail "deriveApply: tyCon may not be a type synonym."
+
++#if MIN_VERSION_template_haskell(2,17,0)
++ let (KindedTV tyVar () (AppT (AppT ArrowT StarT) StarT)) = last tyVars
++ instanceType = conT cls `appT` foldl apply (conT tyConName) (init tyVars)
++ apply t (PlainTV name _) = appT t (varT name)
++ apply t (KindedTV name _ _) = appT t (varT name)
++#else
+ let (KindedTV tyVar (AppT (AppT ArrowT StarT) StarT)) = last tyVars
+ instanceType = conT cls `appT` foldl apply (conT tyConName) (init tyVars)
+ apply t (PlainTV name) = appT t (varT name)
+ apply t (KindedTV name _) = appT t (varT name)
++#endif
+
+ putQ (Deriving tyConName tyVar)
+ return (instanceType, cs)
More information about the arch-commits
mailing list