[arch-commits] Commit in haskell-tamarin-prover-theory/trunk (PKGBUILD ghc9.patch)
Felix Yan
felixonmars at archlinux.org
Wed Jun 30 15:35:14 UTC 2021
Date: Wednesday, June 30, 2021 @ 15:35:14
Author: felixonmars
Revision: 967990
upgpkg: haskell-tamarin-prover-theory 1.6.0-104: rebuild with ghc 9.0.1
Added:
haskell-tamarin-prover-theory/trunk/ghc9.patch
Modified:
haskell-tamarin-prover-theory/trunk/PKGBUILD
------------+
PKGBUILD | 12 ++++++--
ghc9.patch | 87 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-06-30 15:17:15 UTC (rev 967989)
+++ PKGBUILD 2021-06-30 15:35:14 UTC (rev 967990)
@@ -4,7 +4,7 @@
_hkgname=tamarin-prover-theory
pkgname=haskell-tamarin-prover-theory
pkgver=1.6.0
-pkgrel=103
+pkgrel=104
pkgdesc="Security protocol types and constraint solver library for the tamarin prover"
url="http://www.infsec.ethz.ch/research/software/tamarin"
license=("GPL")
@@ -13,9 +13,15 @@
'haskell-parallel' 'haskell-safe' 'haskell-uniplate' 'haskell-tamarin-prover-utils'
'haskell-tamarin-prover-term')
makedepends=('ghc')
-source=("tamarin-prover-$pkgver.tar.gz::https://github.com/tamarin-prover/tamarin-prover/archive/$pkgver.tar.gz")
-sha512sums=('7f3569f740d63d715b92a8f073eaecb8b32efe59b910b246977d36bb9e873765440e72feb6e76c7cbafab0495b88cfc666bb1dd12f685627c60d5cbd97b2973e')
+source=("tamarin-prover-$pkgver.tar.gz::https://github.com/tamarin-prover/tamarin-prover/archive/$pkgver.tar.gz"
+ ghc9.patch)
+sha512sums=('7f3569f740d63d715b92a8f073eaecb8b32efe59b910b246977d36bb9e873765440e72feb6e76c7cbafab0495b88cfc666bb1dd12f685627c60d5cbd97b2973e'
+ '6248791aea411e04de0f2227aeaac85d7ce5519808998b01751db5ede18cb6056dd216dac91e17d5867a24fb3101dd5d1d4c90abc83c68d26f144ae187313361')
+prepare() {
+ patch -d tamarin-prover-$pkgver -p1 < ghc9.patch
+}
+
build() {
cd tamarin-prover-$pkgver/lib/theory
Added: ghc9.patch
===================================================================
--- ghc9.patch (rev 0)
+++ ghc9.patch 2021-06-30 15:35:14 UTC (rev 967990)
@@ -0,0 +1,87 @@
+diff --git a/lib/theory/src/Theory/Constraint/System.hs b/lib/theory/src/Theory/Constraint/System.hs
+index 30b1589e..b7c5d56a 100644
+--- a/lib/theory/src/Theory/Constraint/System.hs
++++ b/lib/theory/src/Theory/Constraint/System.hs
+@@ -415,16 +415,6 @@ eitherProofContext ctxt s = if s==LHS then L.get dpcPCLeft ctxt else L.get dpcPC
+ -- Instances
+ ------------
+
+-instance HasFrees Source where
+- foldFrees f th =
+- foldFrees f (L.get cdGoal th) `mappend`
+- foldFrees f (L.get cdCases th)
+-
+- foldFreesOcc _ _ = const mempty
+-
+- mapFrees f th = Source <$> mapFrees f (L.get cdGoal th)
+- <*> mapFrees f (L.get cdCases th)
+-
+ data DiffProofType = RuleEquivalence | None
+ deriving( Eq, Ord, Show, Generic, NFData, Binary )
+
+@@ -1483,6 +1473,15 @@ instance HasFrees System where
+ <*> mapFrees fun k
+ <*> mapFrees fun l
+
++instance HasFrees Source where
++ foldFrees f th =
++ foldFrees f (L.get cdGoal th) `mappend`
++ foldFrees f (L.get cdCases th)
++
++ foldFreesOcc _ _ = const mempty
++
++ mapFrees f th = Source <$> mapFrees f (L.get cdGoal th)
++ <*> mapFrees f (L.get cdCases th)
+
+ -- Special comparison functions to ignore new var instantiations
+ ----------------------------------------------------------------
+diff --git a/lib/theory/src/Theory/Constraint/System/JSON.hs b/lib/theory/src/Theory/Constraint/System/JSON.hs
+index 57ff7501..62a0b379 100644
+--- a/lib/theory/src/Theory/Constraint/System/JSON.hs
++++ b/lib/theory/src/Theory/Constraint/System/JSON.hs
+@@ -101,22 +101,6 @@ data JSONGraphNode = JSONGraphNode
+ , jgnMetadata :: Maybe JSONGraphNodeMetadata
+ } deriving (Show)
+
+--- | Optional fields are not handled correctly with automatically derived instances
+--- hence, we have our own here.
+-instance FromJSON JSONGraphNode where
+- parseJSON = withObject "JSONGraphNode" $ \o -> JSONGraphNode
+- <$> o .: "jgnId"
+- <*> o .: "jgnType"
+- <*> o .: "jgnLabel"
+- <*> o .:? "jgnMetadata"
+-
+-instance ToJSON JSONGraphNode where
+- toJSON (JSONGraphNode jgnId' jgnType' jgnLabel' jgnMetadata') = object $ catMaybes
+- [ ("jgnId" .=) <$> pure jgnId'
+- , ("jgnType" .=) <$> pure jgnType'
+- , ("jgnLabel" .=) <$> pure jgnLabel'
+- , ("jgnMetadata" .=) <$> jgnMetadata' ]
+-
+ -- | Representation of an edge of a JSON graph.
+ data JSONGraphEdge = JSONGraphEdge
+ {
+@@ -147,6 +131,22 @@ data JSONGraphs = JSONGraphs
+ -- | Derive ToJSON and FromJSON.
+ concat <$> mapM (deriveJSON defaultOptions) [''JSONGraphNodeFact, ''JSONGraphNodeMetadata, ''JSONGraphEdge, ''JSONGraph, ''JSONGraphs]
+
++-- | Optional fields are not handled correctly with automatically derived instances
++-- hence, we have our own here.
++instance FromJSON JSONGraphNode where
++ parseJSON = withObject "JSONGraphNode" $ \o -> JSONGraphNode
++ <$> o .: "jgnId"
++ <*> o .: "jgnType"
++ <*> o .: "jgnLabel"
++ <*> o .:? "jgnMetadata"
++
++instance ToJSON JSONGraphNode where
++ toJSON (JSONGraphNode jgnId' jgnType' jgnLabel' jgnMetadata') = object $ catMaybes
++ [ ("jgnId" .=) <$> pure jgnId'
++ , ("jgnType" .=) <$> pure jgnType'
++ , ("jgnLabel" .=) <$> pure jgnLabel'
++ , ("jgnMetadata" .=) <$> jgnMetadata' ]
++
+ -- | Generation of JSON text from JSON graphs.
+
+ -- | Flatten out pretty printed facts from prettyLNFact etc.
More information about the arch-commits
mailing list