[arch-commits] Commit in haskell-parameterized-utils/repos (3 files)

Felix Yan felixonmars at gemini.archlinux.org
Wed May 18 14:20:25 UTC 2022


    Date: Wednesday, May 18, 2022 @ 14:20:25
  Author: felixonmars
Revision: 1208390

archrelease: copy trunk to community-staging-x86_64

Added:
  haskell-parameterized-utils/repos/community-staging-x86_64/
  haskell-parameterized-utils/repos/community-staging-x86_64/PKGBUILD
    (from rev 1208389, haskell-parameterized-utils/trunk/PKGBUILD)
  haskell-parameterized-utils/repos/community-staging-x86_64/hashable-1.4.patch
    (from rev 1208389, haskell-parameterized-utils/trunk/hashable-1.4.patch)

--------------------+
 PKGBUILD           |   53 +++++++++++++++++++++++
 hashable-1.4.patch |  114 +++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 167 insertions(+)

Copied: haskell-parameterized-utils/repos/community-staging-x86_64/PKGBUILD (from rev 1208389, haskell-parameterized-utils/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2022-05-18 14:20:25 UTC (rev 1208390)
@@ -0,0 +1,53 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+_hkgname=parameterized-utils
+pkgname=haskell-parameterized-utils
+pkgver=2.1.5.0
+pkgrel=29
+pkgdesc="Classes and data structures for working with data-kind indexed types"
+url="https://github.com/GaloisInc/parameterized-utils"
+license=('BSD')
+arch=('x86_64')
+depends=('ghc-libs' 'haskell-base-orphans' 'haskell-constraints' 'haskell-hashable'
+         'haskell-hashtables' 'haskell-indexed-traversable' 'haskell-lens' 'haskell-profunctors'
+         'haskell-th-abstraction' 'haskell-vector')
+makedepends=('ghc' 'uusi' 'haskell-hedgehog' 'haskell-hedgehog-classes' 'haskell-tasty'
+             'haskell-tasty-ant-xml' 'haskell-tasty-hunit' 'haskell-tasty-hedgehog')
+source=(https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz
+        hashable-1.4.patch)
+sha512sums=('f3cf077c50e18d426b63e86c90a719709db30ed5c85ee3ec6e2ab263fc5be3c939a27069bc83f09bb97176236a186e599051099c7653db8f7a5e33b98b8b88ed'
+            '84b1888a89adc682d56e7889e45d69075831442828777ce6be487930e76d9dda2f7adf0cc6b0631694b753b7e09ade34e3a4c1ca5444a6e9ceaab58cbf477274')
+
+prepare() {
+    cd $_hkgname-$pkgver
+    patch -p1 -i ../hashable-1.4.patch
+    gen-setup
+}
+
+build() {
+    cd $_hkgname-$pkgver    
+    
+    runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+        --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
+        --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm
+    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-parameterized-utils/repos/community-staging-x86_64/hashable-1.4.patch (from rev 1208389, haskell-parameterized-utils/trunk/hashable-1.4.patch)
===================================================================
--- community-staging-x86_64/hashable-1.4.patch	                        (rev 0)
+++ community-staging-x86_64/hashable-1.4.patch	2022-05-18 14:20:25 UTC (rev 1208390)
@@ -0,0 +1,114 @@
+From 73ad4b0bb044decda71091a9f0e72d57de7d457c Mon Sep 17 00:00:00 2001
+From: Ryan Scott <rscott at galois.com>
+Date: Wed, 5 Jan 2022 10:14:47 -0600
+Subject: [PATCH] Allow building with hashable-1.4.*
+
+Because `hashable-1.4.0.0` adds an `Eq` superclass to `Hashable`, several
+`Hashable` instances in `parameterized-utils` now must add additional
+constraints to satisfy the corresponding `Eq` instances. For instance,
+several `Eq` instances have `TestEquality` constraints, so the `Hashable`
+instances must have corresponding `TestEquality` constraints as well.
+
+Fixes #126.
+---
+ Changelog.md                             | 8 ++++++++
+ parameterized-utils.cabal                | 6 +++---
+ src/Data/Parameterized/Classes.hs        | 2 +-
+ src/Data/Parameterized/Context/Safe.hs   | 4 ++--
+ src/Data/Parameterized/Context/Unsafe.hs | 4 ++--
+ src/Data/Parameterized/Some.hs           | 2 +-
+ 6 files changed, 17 insertions(+), 9 deletions(-)
+
+diff --git a/Changelog.md b/Changelog.md
+index a04a089..177130b 100644
+--- a/Changelog.md
++++ b/Changelog.md
+@@ -1,5 +1,13 @@
+ # Changelog for the `parameterized-utils` package
+ 
++## next -- *TBA*
++
++  * Allow building with `hashable-1.4.*`. Because `hashable-1.4.0.0` adds an
++    `Eq` superclass to `Hashable`, some instances of `Hashable` in
++    `parameterized-utils` now require additional `TestEquality` constraints, as
++    the corresponding `Eq` instances for these data types also require
++    `TestEquality` constraints.
++
+ ## 2.1.4.0 -- *2021 Oct 1*
+ 
+   * Added the `ifoldLM` and `fromSomeList`, `fromListWith`, and
+diff --git a/parameterized-utils.cabal b/parameterized-utils.cabal
+index 6df2300..aa86ded 100644
+--- a/parameterized-utils.cabal
++++ b/parameterized-utils.cabal
+@@ -56,8 +56,8 @@ library
+                , containers
+                , deepseq
+                , ghc-prim
+-               , hashable       >=1.2  && <1.4
+-               , hashtables     ==1.2.*
++               , hashable       >=1.2  && <1.5
++               , hashtables     >=1.2  && <1.4
+                , indexed-traversable
+                , lens           >=4.16 && <5.1
+                , mtl
+diff --git a/src/Data/Parameterized/Classes.hs b/src/Data/Parameterized/Classes.hs
+index b90754d..df1072a 100644
+--- a/src/Data/Parameterized/Classes.hs
++++ b/src/Data/Parameterized/Classes.hs
+@@ -351,7 +351,7 @@ instance OrdF f => Ord (TypeAp f tp) where
+ instance ShowF f => Show (TypeAp f tp) where
+   showsPrec p (TypeAp x) = showsPrecF p x
+ 
+-instance HashableF f => Hashable (TypeAp f tp) where
++instance (HashableF f, TestEquality f) => Hashable (TypeAp f tp) where
+   hashWithSalt s (TypeAp x) = hashWithSaltF s x
+ 
+ ------------------------------------------------------------------------
+diff --git a/src/Data/Parameterized/Context/Safe.hs b/src/Data/Parameterized/Context/Safe.hs
+index 96da3c0..5bdd196 100644
+--- a/src/Data/Parameterized/Context/Safe.hs
++++ b/src/Data/Parameterized/Context/Safe.hs
+@@ -595,10 +595,10 @@ instance Hashable (Index ctx tp) where
+ instance HashableF (Index ctx) where
+   hashWithSaltF s i = hashWithSalt s (indexVal i)
+ 
+-instance HashableF f => HashableF (Assignment f) where
++instance (HashableF f, TestEquality f) => HashableF (Assignment f) where
+   hashWithSaltF = hashWithSalt
+ 
+-instance HashableF f => Hashable (Assignment f ctx) where
++instance (HashableF f, TestEquality f) => Hashable (Assignment f ctx) where
+   hashWithSalt s AssignmentEmpty = s
+   hashWithSalt s (AssignmentExtend asgn x) = (s `hashWithSalt` asgn) `hashWithSaltF` x
+ 
+diff --git a/src/Data/Parameterized/Context/Unsafe.hs b/src/Data/Parameterized/Context/Unsafe.hs
+index 43e9def..e3f5845 100644
+--- a/src/Data/Parameterized/Context/Unsafe.hs
++++ b/src/Data/Parameterized/Context/Unsafe.hs
+@@ -850,10 +850,10 @@ instance HashableF (Index ctx) where
+ instance Hashable (Index ctx tp) where
+   hashWithSalt = hashWithSaltF
+ 
+-instance HashableF f => Hashable (Assignment f ctx) where
++instance (HashableF f, TestEquality f) => Hashable (Assignment f ctx) where
+   hashWithSalt s (Assignment a) = hashWithSaltF s a
+ 
+-instance HashableF f => HashableF (Assignment f) where
++instance (HashableF f, TestEquality f) => HashableF (Assignment f) where
+   hashWithSaltF = hashWithSalt
+ 
+ instance ShowF f => Show (Assignment f ctx) where
+diff --git a/src/Data/Parameterized/Some.hs b/src/Data/Parameterized/Some.hs
+index 3df9359..75e9c55 100644
+--- a/src/Data/Parameterized/Some.hs
++++ b/src/Data/Parameterized/Some.hs
+@@ -33,7 +33,7 @@ instance TestEquality f => Eq (Some f) where
+ instance OrdF f => Ord (Some f) where
+   compare (Some x) (Some y) = toOrdering (compareF x y)
+ 
+-instance HashableF f => Hashable (Some f) where
++instance (HashableF f, TestEquality f) => Hashable (Some f) where
+   hashWithSalt s (Some x) = hashWithSaltF s x
+   hash (Some x) = hashF x
+ 



More information about the arch-commits mailing list