Date: Sunday, October 14, 2018 @ 20:04:36 Author: felixonmars Revision: 393790
upgpkg: haskell-presburger 1.3.1-6 rebuild with ghc 8.6.1 Added: haskell-presburger/trunk/containers-0.6.patch haskell-presburger/trunk/ghc-8.4.patch Modified: haskell-presburger/trunk/PKGBUILD ----------------------+ PKGBUILD | 12 ++++-- containers-0.6.patch | 38 ++++++++++++++++++++ ghc-8.4.patch | 91 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 137 insertions(+), 4 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2018-10-14 19:33:32 UTC (rev 393789) +++ PKGBUILD 2018-10-14 20:04:36 UTC (rev 393790) @@ -4,7 +4,7 @@ _hkgname=presburger pkgname=haskell-presburger pkgver=1.3.1 -pkgrel=5 +pkgrel=6 pkgdesc="A decision procedure for quantifier-free linear arithmetic" url="https://github.com/yav/presburger" license=("custom:BSD3") @@ -11,12 +11,16 @@ arch=('x86_64') depends=('ghc-libs') makedepends=('ghc') -source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz") -sha512sums=('37659133b05452119b5bcb52111ceef41d4f54effe95f2c19164b807c3fcfb027aaf1c7f47d295ce9a2f57d1b8a5814a17e91f8814b3e963364bdcfb7aa5c1c0') +source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz" + ghc-8.4.patch containers-0.6.patch) +sha512sums=('37659133b05452119b5bcb52111ceef41d4f54effe95f2c19164b807c3fcfb027aaf1c7f47d295ce9a2f57d1b8a5814a17e91f8814b3e963364bdcfb7aa5c1c0' + 'a063da967d7af8f339062188ef761d5df4b94937cc3a964263f8a174f6de4e0925e4f16225be0737bb9e1ab5f938e2f73867ec5b47c4e6c5117625b4c03788fa' + '140390477480e951ccebd0d0e3d8cfb4b8cf08dad0f23bf26ca75e0bae8ca347f8e063a8ee63e770e2611ad831226767eed54963d43ed8c773c73d1fc72b56cc') prepare() { cd $_hkgname-$pkgver - sed -i '/import Data.Map (Map)/i import Prelude hiding ((<>))' src/Data/Integer/SAT.hs + patch -p1 -i ../ghc-8.4.patch + patch -p1 -i ../containers-0.6.patch } build() { Added: containers-0.6.patch =================================================================== --- containers-0.6.patch (rev 0) +++ containers-0.6.patch 2018-10-14 20:04:36 UTC (rev 393790) @@ -0,0 +1,38 @@ +commit 9d73e3d55fb44c81ce22a2d60bf7ad38ad1910a7 +Author: Felix Yan <[email protected]> +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) Added: ghc-8.4.patch =================================================================== --- ghc-8.4.patch (rev 0) +++ ghc-8.4.patch 2018-10-14 20:04:36 UTC (rev 393790) @@ -0,0 +1,91 @@ +commit fd7746dbc63d427ab5670341cd0fd13cb2c087b6 +Author: Hiromi ISHII <[email protected]> +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
