[arch-commits] Commit in haskell-presburger/repos (5 files)
Felix Yan
felixonmars at gemini.archlinux.org
Mon Jan 10 18:03:58 UTC 2022
Date: Monday, January 10, 2022 @ 18:03:58
Author: felixonmars
Revision: 1099677
archrelease: copy trunk to community-staging-x86_64
Added:
haskell-presburger/repos/community-staging-x86_64/
haskell-presburger/repos/community-staging-x86_64/PKGBUILD
(from rev 1099676, haskell-presburger/trunk/PKGBUILD)
haskell-presburger/repos/community-staging-x86_64/containers-0.6.patch
(from rev 1099676, haskell-presburger/trunk/containers-0.6.patch)
haskell-presburger/repos/community-staging-x86_64/ghc-8.4.patch
(from rev 1099676, haskell-presburger/trunk/ghc-8.4.patch)
haskell-presburger/repos/community-staging-x86_64/ghc-8.8.patch
(from rev 1099676, haskell-presburger/trunk/ghc-8.8.patch)
----------------------+
PKGBUILD | 49 ++++++++++++++++++++++++++
containers-0.6.patch | 38 ++++++++++++++++++++
ghc-8.4.patch | 91 +++++++++++++++++++++++++++++++++++++++++++++++++
ghc-8.8.patch | 17 +++++++++
4 files changed, 195 insertions(+)
Copied: haskell-presburger/repos/community-staging-x86_64/PKGBUILD (from rev 1099676, haskell-presburger/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2022-01-10 18:03:58 UTC (rev 1099677)
@@ -0,0 +1,49 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+_hkgname=presburger
+pkgname=haskell-presburger
+pkgver=1.3.1
+pkgrel=21
+pkgdesc="A decision procedure for quantifier-free linear arithmetic"
+url="https://github.com/yav/presburger"
+license=("BSD")
+arch=('x86_64')
+depends=('ghc-libs')
+makedepends=('ghc')
+source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz"
+ ghc-8.4.patch containers-0.6.patch ghc-8.8.patch)
+sha512sums=('37659133b05452119b5bcb52111ceef41d4f54effe95f2c19164b807c3fcfb027aaf1c7f47d295ce9a2f57d1b8a5814a17e91f8814b3e963364bdcfb7aa5c1c0'
+ 'a063da967d7af8f339062188ef761d5df4b94937cc3a964263f8a174f6de4e0925e4f16225be0737bb9e1ab5f938e2f73867ec5b47c4e6c5117625b4c03788fa'
+ '140390477480e951ccebd0d0e3d8cfb4b8cf08dad0f23bf26ca75e0bae8ca347f8e063a8ee63e770e2611ad831226767eed54963d43ed8c773c73d1fc72b56cc'
+ '8a78409d14b1febfe496c7bb588d4cad6ff04ac41dcf76c2771ec4d6bb7192a5546c1b0f2e2c288d832d59120dba18413e57e17cf9af2fd52315623f06cb8682')
+
+prepare() {
+ cd $_hkgname-$pkgver
+ patch -p1 -i ../ghc-8.4.patch
+ patch -p1 -i ../containers-0.6.patch
+ patch -p1 -i ../ghc-8.8.patch
+}
+
+build() {
+ cd $_hkgname-$pkgver
+
+ runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+ --prefix=/usr --docdir=/usr/share/doc/$pkgname \
+ --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
+}
+
+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-presburger/repos/community-staging-x86_64/containers-0.6.patch (from rev 1099676, haskell-presburger/trunk/containers-0.6.patch)
===================================================================
--- community-staging-x86_64/containers-0.6.patch (rev 0)
+++ community-staging-x86_64/containers-0.6.patch 2022-01-10 18:03:58 UTC (rev 1099677)
@@ -0,0 +1,38 @@
+commit 9d73e3d55fb44c81ce22a2d60bf7ad38ad1910a7
+Author: Felix Yan <felixonmars at archlinux.org>
+Date: Mon Oct 15 04:02:43 2018 +0800
+
+ Fix compatibility with containers 0.6
+
+diff --git a/src/Data/Integer/SAT.hs b/src/Data/Integer/SAT.hs
+index f10aba1..3fbf9a4 100644
+--- a/src/Data/Integer/SAT.hs
++++ b/src/Data/Integer/SAT.hs
+@@ -1,4 +1,4 @@
+-{-# LANGUAGE BangPatterns, PatternGuards, Trustworthy #-}
++{-# LANGUAGE BangPatterns, PatternGuards, Trustworthy, CPP #-}
+ {-|
+ This module implements a decision procedure for quantifier-free linear
+ arithmetic. The algorithm is based on the following paper:
+@@ -48,6 +48,9 @@ import Control.Monad (MonadPlus (..), ap, guard, liftM)
+ import Data.List (partition)
+ import Data.Map (Map)
+ import qualified Data.Map as Map
++#if MIN_VERSION_containers(0,6,0)
++import qualified Data.Map.Strict as MapStrict
++#endif
+ import Data.Maybe (fromMaybe, mapMaybe, maybeToList)
+ import Prelude hiding ((<>))
+ import Text.PrettyPrint
+@@ -955,7 +958,11 @@ tFactor (T c m) =
+
+ -- | Extract a variable with a coefficient whose absolute value is minimal.
+ tLeastAbsCoeff :: Term -> Maybe (Integer, Name, Term)
++#if MIN_VERSION_containers(0,6,0)
++tLeastAbsCoeff (T c m) = do (xc,x,m1) <- MapStrict.foldrWithKey step Nothing m
++#else
+ tLeastAbsCoeff (T c m) = do (xc,x,m1) <- Map.foldWithKey step Nothing m
++#endif
+ return (xc, x, T c m1)
+ where
+ step x xc Nothing = Just (xc, x, Map.delete x m)
Copied: haskell-presburger/repos/community-staging-x86_64/ghc-8.4.patch (from rev 1099676, haskell-presburger/trunk/ghc-8.4.patch)
===================================================================
--- community-staging-x86_64/ghc-8.4.patch (rev 0)
+++ community-staging-x86_64/ghc-8.4.patch 2022-01-10 18:03:58 UTC (rev 1099677)
@@ -0,0 +1,91 @@
+commit fd7746dbc63d427ab5670341cd0fd13cb2c087b6
+Author: Hiromi ISHII <konn.jinro at gmail.com>
+Date: Fri Dec 22 17:03:17 2017 +0900
+
+ Workaround for GHC 8.4 (hides Semigroup.<>)
+
+diff --git a/src/Data/Integer/SAT.hs b/src/Data/Integer/SAT.hs
+index cfe3950..f10aba1 100644
+--- a/src/Data/Integer/SAT.hs
++++ b/src/Data/Integer/SAT.hs
+@@ -1,4 +1,4 @@
+-{-# LANGUAGE Trustworthy, PatternGuards, BangPatterns #-}
++{-# LANGUAGE BangPatterns, PatternGuards, Trustworthy #-}
+ {-|
+ This module implements a decision procedure for quantifier-free linear
+ arithmetic. The algorithm is based on the following paper:
+@@ -43,12 +43,13 @@ module Data.Integer.SAT
+
+ import Debug.Trace
+
+-import Data.Map (Map)
+-import qualified Data.Map as Map
+-import Data.List(partition)
+-import Data.Maybe(maybeToList,fromMaybe,mapMaybe)
+-import Control.Applicative(Applicative(..), Alternative(..), (<$>))
+-import Control.Monad(liftM,ap,MonadPlus(..),guard)
++import Control.Applicative (Alternative (..), Applicative (..), (<$>))
++import Control.Monad (MonadPlus (..), ap, guard, liftM)
++import Data.List (partition)
++import Data.Map (Map)
++import qualified Data.Map as Map
++import Data.Maybe (fromMaybe, mapMaybe, maybeToList)
++import Prelude hiding ((<>))
+ import Text.PrettyPrint
+
+ infixr 2 :||
+@@ -85,9 +86,9 @@ assert p (State rws) = State $ fmap snd $ m =<< rws
+ checkSat :: PropSet -> Maybe [(Int,Integer)]
+ checkSat (State m) = go m
+ where
+- go None = mzero
+- go (One rw) = return [ (x,v) | (UserName x, v) <- iModel (inerts rw) ]
+- go (Choice m1 m2) = mplus (go m1) (go m2)
++ go None = mzero
++ go (One rw) = return [ (x,v) | (UserName x, v) <- iModel (inerts rw) ]
++ go (Choice m1 m2) = mplus (go m1) (go m2)
+
+ allInerts :: PropSet -> [Inerts]
+ allInerts (State m) = map inerts (toList m)
+@@ -432,7 +433,7 @@ slnNextValWith f (TopVar x v lb ub is) =
+ return $ TopVar x v1 lb ub is
+
+ slnNextVar :: Solutions -> Maybe Solutions
+-slnNextVar Done = Nothing
++slnNextVar Done = Nothing
+ slnNextVar (TopVar x v _ _ is) = Just $ FixedVar x v $ startIter $ iLet x v is
+ slnNextVar (FixedVar x v i) = FixedVar x v `fmap` slnNextVar i
+
+@@ -716,9 +717,9 @@ instance Alternative Answer where
+
+ instance MonadPlus Answer where
+ mzero = None
+- mplus None x = x
++ mplus None x = x
+ -- mplus (Choice x y) z = mplus x (mplus y z)
+- mplus x y = Choice x y
++ mplus x y = Choice x y
+
+ instance Functor Answer where
+ fmap _ None = None
+@@ -881,14 +882,14 @@ instance Show Term where
+ ppTerm :: Term -> Doc
+ ppTerm (T k m) =
+ case Map.toList m of
+- [] -> integer k
+- xs | k /= 0 -> hsep (integer k : map ppProd xs)
+- x : xs -> hsep (ppFst x : map ppProd xs)
++ [] -> integer k
++ xs | k /= 0 -> hsep (integer k : map ppProd xs)
++ x : xs -> hsep (ppFst x : map ppProd xs)
+
+ where
+- ppFst (x,1) = ppName x
+- ppFst (x,-1) = text "-" <> ppName x
+- ppFst (x,n) = ppMul n x
++ ppFst (x,1) = ppName x
++ ppFst (x,-1) = text "-" <> ppName x
++ ppFst (x,n) = ppMul n x
+
+ ppProd (x,1) = text "+" <+> ppName x
+ ppProd (x,-1) = text "-" <+> ppName x
Copied: haskell-presburger/repos/community-staging-x86_64/ghc-8.8.patch (from rev 1099676, haskell-presburger/trunk/ghc-8.8.patch)
===================================================================
--- community-staging-x86_64/ghc-8.8.patch (rev 0)
+++ community-staging-x86_64/ghc-8.8.patch 2022-01-10 18:03:58 UTC (rev 1099677)
@@ -0,0 +1,17 @@
+--- presburger-1.3.1/src/Data/Integer/SAT.hs.orig 2020-01-09 05:01:01.093397167 +0800
++++ presburger-1.3.1/src/Data/Integer/SAT.hs 2020-01-09 05:01:53.153355713 +0800
+@@ -709,11 +709,13 @@
+
+ instance Monad Answer where
+ return a = One a
+- fail _ = None
+ None >>= _ = None
+ One a >>= k = k a
+ Choice m1 m2 >>= k = mplus (m1 >>= k) (m2 >>= k)
+
++instance MonadFail Answer where
++ fail _ = None
++
+ instance Alternative Answer where
+ empty = mzero
+ (<|>) = mplus
More information about the arch-commits
mailing list