From 7f3a5d83dc93f07f7f56170dc2f4c089d6aa9be8 Mon Sep 17 00:00:00 2001 From: "Wolfgang E. Sanyer" Date: Wed, 6 Jan 2021 20:59:25 -0500 Subject: [PATCH] dev-haskell/saltine: loosen profunctors dep ...and also fix tests. It seems the release tarball was missing a test module, the patch added came directly from the project git history. [An issue][1] has been opened to loosen the profunctors dep. [1]: https://github.com/tel/saltine/issues/57 Signed-off-by: Wolfgang E. Sanyer --- .../saltine-0.1.1.0-missing-test-module.patch | 43 +++++++++++++++++++ dev-haskell/saltine/saltine-0.1.1.0.ebuild | 23 +++++++--- 2 files changed, 59 insertions(+), 7 deletions(-) create mode 100644 dev-haskell/saltine/files/saltine-0.1.1.0-missing-test-module.patch diff --git a/dev-haskell/saltine/files/saltine-0.1.1.0-missing-test-module.patch b/dev-haskell/saltine/files/saltine-0.1.1.0-missing-test-module.patch new file mode 100644 index 00000000000..8bd1a7ecda3 --- /dev/null +++ b/dev-haskell/saltine/files/saltine-0.1.1.0-missing-test-module.patch @@ -0,0 +1,43 @@ +diff --git a/tests/HashProperties.hs b/tests/HashProperties.hs +new file mode 100644 +index 0000000..3f37fb4 +--- /dev/null ++++ b/tests/HashProperties.hs +@@ -0,0 +1,37 @@ ++{-# LANGUAGE OverloadedStrings #-} ++ ++module HashProperties ( ++ testHash ++ ) where ++ ++import Util ++import Crypto.Saltine.Core.Hash ++ ++import qualified Data.ByteString as S ++import Test.Framework.Providers.QuickCheck2 ++import Test.Framework ++import Test.QuickCheck ++ ++testHash :: Test ++testHash = buildTest $ do ++ shKey <- newShorthashKey ++ shKey2 <- newShorthashKey ++ ++ return $ testGroup "...Internal.Hash" [ ++ ++ testProperty "No two hashes are alike" ++ $ \(Message bs1, Message bs2) -> bs1 /= bs2 ==> hash bs1 /= hash bs2, ++ ++ testProperty "Hash of empty ByteString is correct" ++ $ \(Message bs) -> (bs == S.empty) ==> hash bs == (read hashEmptyBS :: S.ByteString), ++ ++ testProperty "No two shorthashes are alike" ++ $ \(Message bs1, Message bs2) -> bs1 /= bs2 ==> shorthash shKey bs1 /= shorthash shKey bs2, ++ ++ testProperty "Different keys produce different shorthashes" ++ $ \(Message bs) -> shorthash shKey bs /= shorthash shKey2 bs ++ ++ ] ++ ++ where ++ hashEmptyBS = "\"\207\131\225\&5~\239\184\189\241T(P\214m\128\a\214 \228\ENQ\vW\NAK\220\131\244\169!\211l\233\206G\208\209<]\133\242\176\255\131\CAN\210\135~\236/c\185\&1\189GAz\129\165\&82z\249'\218>\"" diff --git a/dev-haskell/saltine/saltine-0.1.1.0.ebuild b/dev-haskell/saltine/saltine-0.1.1.0.ebuild index 80d0e707708..3b84511cc21 100644 --- a/dev-haskell/saltine/saltine-0.1.1.0.ebuild +++ b/dev-haskell/saltine/saltine-0.1.1.0.ebuild @@ -5,7 +5,7 @@ EAPI=7 # ebuild generated by hackport 0.6.5.9999 -CABAL_FEATURES="lib profile haddock hoogle hscolour" # test-suite" +CABAL_FEATURES="lib profile haddock hoogle hscolour test-suite" inherit haskell-cabal DESCRIPTION="Cryptography that's easy to digest (NaCl/libsodium bindings)" @@ -17,17 +17,26 @@ SLOT="0/${PV}" KEYWORDS="~amd64 ~x86" IUSE="" -RESTRICT=test # test suite fails to build +PATCHES="${FILESDIR}/${PN}-0.1.1.0-missing-test-module.patch" RDEPEND="dev-haskell/hashable:=[profile?] - >=dev-haskell/profunctors-5.3:=[profile?] =dev-haskell/profunctors-5.3:=[profile?] >=dev-lang/ghc-8.0.1:= >=dev-libs/libsodium-1.0.13 " + DEPEND="${RDEPEND} >=dev-haskell/cabal-1.24.0.0 virtual/pkgconfig -" # test? ( dev-haskell/quickcheck - # dev-haskell/semigroups - # dev-haskell/test-framework - # dev-haskell/test-framework-quickcheck2 ) + test? ( dev-haskell/quickcheck + dev-haskell/semigroups + dev-haskell/test-framework + dev-haskell/test-framework-quickcheck2 ) +" + +src_prepare() { + default + + cabal_chdeps \ + 'profunctors >= 5.3 && < 5.6' 'profunctors >= 5.3' +}