[arch-commits] Commit in cryptol/repos (3 files)
Felix Yan
felixonmars at archlinux.org
Sat Dec 26 05:20:11 UTC 2020
Date: Saturday, December 26, 2020 @ 05:20:11
Author: felixonmars
Revision: 791982
archrelease: copy trunk to community-staging-x86_64
Added:
cryptol/repos/community-staging-x86_64/
cryptol/repos/community-staging-x86_64/PKGBUILD
(from rev 791981, cryptol/trunk/PKGBUILD)
cryptol/repos/community-staging-x86_64/sbv-8.8.patch
(from rev 791981, cryptol/trunk/sbv-8.8.patch)
---------------+
PKGBUILD | 48 ++++++++++++++++++++++++++
sbv-8.8.patch | 101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 149 insertions(+)
Copied: cryptol/repos/community-staging-x86_64/PKGBUILD (from rev 791981, cryptol/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD (rev 0)
+++ community-staging-x86_64/PKGBUILD 2020-12-26 05:20:11 UTC (rev 791982)
@@ -0,0 +1,48 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+pkgname=cryptol
+pkgver=2.10.0
+pkgrel=23
+pkgdesc="The Language of Cryptography"
+url="https://www.cryptol.net"
+license=("BSD")
+arch=('x86_64')
+depends=('ghc-libs' 'z3' 'haskell-async' 'haskell-base-compat' 'haskell-bv-sized'
+ 'haskell-cryptohash-sha1' 'haskell-exceptions' 'haskell-gitrev' 'haskell-graphscc'
+ 'haskell-heredoc' 'haskell-libbf' 'haskell-memotrie' 'haskell-monad-control'
+ 'haskell-monadlib' 'haskell-parameterized-utils' 'haskell-panic' 'haskell-random'
+ 'haskell-sbv' 'haskell-simple-smt' 'haskell-strict' 'haskell-tf-random'
+ 'haskell-transformers-base' 'haskell-what4' 'haskell-ansi-terminal' 'haskell-blaze-html')
+makedepends=('ghc' 'alex' 'happy')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/GaloisInc/cryptol/archive/$pkgver.tar.gz"
+ sbv-8.8.patch)
+sha512sums=('efb5f048a23de2040716d210b3d59071744d97989920266206590320585850a84de989851ed94687995874d74a3e6986d2e735e636aaa9f70f8949604ab62904'
+ 'da4ac99c538a935eed9efd98dd6c57f24ad12d8effe328a814661ed02395445d28c8b4f43b48492171dc0bd65c6568fe7641de94e32765d51ab208a38f09d2d2')
+
+prepare() {
+ patch -d $pkgname-$pkgver -p1 < sbv-8.8.patch
+}
+
+build() {
+ cd "${srcdir}/${pkgname}-${pkgver}"
+
+ runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+ --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --datasubdir="$pkgname" \
+ --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
+ -f-static -f-relocatable --ghc-option='-pie'
+ 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 "${srcdir}/${pkgname}-${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: cryptol/repos/community-staging-x86_64/sbv-8.8.patch (from rev 791981, cryptol/trunk/sbv-8.8.patch)
===================================================================
--- community-staging-x86_64/sbv-8.8.patch (rev 0)
+++ community-staging-x86_64/sbv-8.8.patch 2020-12-26 05:20:11 UTC (rev 791982)
@@ -0,0 +1,101 @@
+diff --git a/cryptol.cabal b/cryptol.cabal
+index 24eb2929..e65d3ed7 100644
+--- a/cryptol.cabal
++++ b/cryptol.cabal
+@@ -65,7 +65,7 @@ library
+ pretty >= 1.1,
+ process >= 1.2,
+ random >= 1.0.1,
+- sbv >= 8.6 && < 8.8,
++ sbv >= 8.6 && < 8.10,
+ simple-smt >= 0.7.1,
+ stm >= 2.4,
+ strict,
+diff --git a/src/Cryptol/Backend/SBV.hs b/src/Cryptol/Backend/SBV.hs
+index 6a4d8b00..50e4e087 100644
+--- a/src/Cryptol/Backend/SBV.hs
++++ b/src/Cryptol/Backend/SBV.hs
+@@ -6,6 +6,7 @@
+ -- Stability : provisional
+ -- Portability : portable
+
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE DeriveFunctor #-}
+ {-# LANGUAGE FlexibleInstances #-}
+ {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+@@ -73,17 +74,24 @@ unpackSBV x = [ svTestBit x i | i <- reverse [0 .. intSizeOf x - 1] ]
+ literalSWord :: Int -> Integer -> SWord SBV
+ literalSWord w i = svInteger (KBounded False w) i
+
++svMkSymVar_ :: Maybe Quantifier -> Kind -> Maybe String -> SBV.State -> IO SVal
++#if MIN_VERSION_sbv(8,8,0)
++svMkSymVar_ a b c = svMkSymVar (SBV.NonQueryVar a) b c
++#else
++svMkSymVar_ a b c = svMkSymVar a b c
++#endif
++
+ freshBV_ :: SBV -> Int -> IO (SWord SBV)
+ freshBV_ (SBV stateVar _) w =
+- withMVar stateVar (svMkSymVar Nothing (KBounded False w) Nothing)
++ withMVar stateVar (svMkSymVar_ Nothing (KBounded False w) Nothing)
+
+ freshSBool_ :: SBV -> IO (SBit SBV)
+ freshSBool_ (SBV stateVar _) =
+- withMVar stateVar (svMkSymVar Nothing KBool Nothing)
++ withMVar stateVar (svMkSymVar_ Nothing KBool Nothing)
+
+ freshSInteger_ :: SBV -> IO (SInteger SBV)
+ freshSInteger_ (SBV stateVar _) =
+- withMVar stateVar (svMkSymVar Nothing KUnbounded Nothing)
++ withMVar stateVar (svMkSymVar_ Nothing KUnbounded Nothing)
+
+
+ -- SBV Evaluation monad -------------------------------------------------------
+diff --git a/src/Cryptol/Symbolic/SBV.hs b/src/Cryptol/Symbolic/SBV.hs
+index 2f97100e..7421db91 100644
+--- a/src/Cryptol/Symbolic/SBV.hs
++++ b/src/Cryptol/Symbolic/SBV.hs
+@@ -6,6 +6,7 @@
+ -- Stability : provisional
+ -- Portability : portable
+
++{-# LANGUAGE CPP #-}
+ {-# LANGUAGE FlexibleContexts #-}
+ {-# LANGUAGE ImplicitParams #-}
+ {-# LANGUAGE LambdaCase #-}
+@@ -124,7 +125,11 @@ proverNames = map fst proverConfigs
+ setupProver :: String -> IO (Either String ([String], SBVProverConfig))
+ setupProver nm
+ | nm `elem` ["any","sbv-any"] =
++#if MIN_VERSION_sbv(8,9,0)
++ do ps <- SBV.getAvailableSolvers
++#else
+ do ps <- SBV.sbvAvailableSolvers
++#endif
+ case ps of
+ [] -> pure (Left "SBV could not find any provers")
+ _ -> let msg = "SBV found the following solvers: " ++ show (map (SBV.name . SBV.solver) ps) in
+@@ -155,7 +160,11 @@ satSMTResults :: SBV.SatResult -> [SBV.SMTResult]
+ satSMTResults (SBV.SatResult r) = [r]
+
+ allSatSMTResults :: SBV.AllSatResult -> [SBV.SMTResult]
++#if MIN_VERSION_sbv(8,8,0)
++allSatSMTResults (SBV.AllSatResult {allSatResults = rs}) = rs
++#else
+ allSatSMTResults (SBV.AllSatResult (_, _, _, rs)) = rs
++#endif
+
+ thmSMTResults :: SBV.ThmResult -> [SBV.SMTResult]
+ thmSMTResults (SBV.ThmResult r) = [r]
+@@ -389,7 +398,11 @@ processResults ProverCommand{..} ts results =
+
+ -- otherwise something is wrong
+ _ -> return $ ProverError (rshow results)
++#if MIN_VERSION_sbv(8,8,0)
++ where rshow | isSat = show . (SBV.AllSatResult False False False False)
++#else
+ where rshow | isSat = show . SBV.AllSatResult . (False,False,False,)
++#endif
+ | otherwise = show . SBV.ThmResult . head
+
+ where
More information about the arch-commits
mailing list