summary refs log tree commit diff
diff options
context:
space:
mode:
authorPeter Simons <simons@cryp.to>2012-03-05 23:32:24 +0000
committerPeter Simons <simons@cryp.to>2012-03-05 23:32:24 +0000
commit1f847aa4c5b6703304c5407b8c29407ff2254483 (patch)
tree7ffe5b4965c79e162fe6aa3e85a27880543dbac5
parentdbe98be6a1922a44c0e4457408eb3363a22dfa4b (diff)
downloadnixlib-1f847aa4c5b6703304c5407b8c29407ff2254483.tar
nixlib-1f847aa4c5b6703304c5407b8c29407ff2254483.tar.gz
nixlib-1f847aa4c5b6703304c5407b8c29407ff2254483.tar.bz2
nixlib-1f847aa4c5b6703304c5407b8c29407ff2254483.tar.lz
nixlib-1f847aa4c5b6703304c5407b8c29407ff2254483.tar.xz
nixlib-1f847aa4c5b6703304c5407b8c29407ff2254483.tar.zst
nixlib-1f847aa4c5b6703304c5407b8c29407ff2254483.zip
haskell-Crypto: fix build on GHC 7.4.1
http://anonscm.debian.org/cgi-bin/darcsweb.cgi?r=pkg-haskell/haskell-crypto;a=filediff;h=20120213034652-b2814-0019a3f92e453e9be86166d6c1f1bc0dad6e4d12.gz;f=patches/class-constraints.diff

svn path=/nixpkgs/trunk/; revision=32808
-rw-r--r--pkgs/development/libraries/haskell/Crypto/class-constraints.diff27
-rw-r--r--pkgs/development/libraries/haskell/Crypto/default.nix1
2 files changed, 28 insertions, 0 deletions
diff --git a/pkgs/development/libraries/haskell/Crypto/class-constraints.diff b/pkgs/development/libraries/haskell/Crypto/class-constraints.diff
new file mode 100644
index 000000000000..77035322678a
--- /dev/null
+++ b/pkgs/development/libraries/haskell/Crypto/class-constraints.diff
@@ -0,0 +1,27 @@
+--- a/Data/Digest/SHA2.hs
++++ b/Data/Digest/SHA2.hs
+@@ -106,7 +106,7 @@
+ data Hash384 = Hash384 !Word64 !Word64 !Word64 !Word64 !Word64 !Word64 deriving (Eq, Ord)
+ data Hash224 = Hash224 !Word32 !Word32 !Word32 !Word32 !Word32 !Word32 !Word32 deriving (Eq, Ord)
+ 
+-instance (Integral a) => Show (Hash8 a) where
++instance (Integral a, Show a) => Show (Hash8 a) where
+  showsPrec _ (Hash8 a b c d e f g h) =
+   (showHex a) . (' ':) .
+   (showHex b) . (' ':) .
+@@ -146,7 +146,7 @@
+      where
+       bs = bitSize (head r)
+ 
+-instance (Integral h, Bits h) => Hash (Hash8 h) where
++instance (Integral h, Bits h, Show h) => Hash (Hash8 h) where
+   toOctets (Hash8 x0 x1 x2 x3 x4 x5 x6 x7) = bitsToOctets =<< [x0, x1, x2, x3, x4, x5, x6, x7]
+ 
+ instance Hash Hash384 where
+@@ -282,4 +282,4 @@
+ 
+ -- Test with:
+ -- ghc -no-recomp -O --make Data/Digest/SHA2.hs -main-is Data.Digest.SHA2.moduleTest -o moduleTest && ./moduleTest && rm moduleTest
+-moduleTest = runTestTT test_sha2
+\ No newline at end of file
++moduleTest = runTestTT test_sha2
diff --git a/pkgs/development/libraries/haskell/Crypto/default.nix b/pkgs/development/libraries/haskell/Crypto/default.nix
index 0adb00ccc862..01bc1a1a0126 100644
--- a/pkgs/development/libraries/haskell/Crypto/default.nix
+++ b/pkgs/development/libraries/haskell/Crypto/default.nix
@@ -7,6 +7,7 @@ cabal.mkDerivation (self: {
   isLibrary = true;
   isExecutable = true;
   buildDepends = [ HUnit QuickCheck random ];
+  patches = [ ./class-constraints.diff ];
   meta = {
     description = "Collects together existing Haskell cryptographic functions into a package";
     license = "unknown";