diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix index ce9f3c09089e..b0b93e2d5300 100644 --- a/pkgs/development/haskell-modules/configuration-common.nix +++ b/pkgs/development/haskell-modules/configuration-common.nix @@ -1013,4 +1013,7 @@ self: super: { # https://github.com/GaloisInc/DSA/issues/1 DSA = dontCheck super.DSA; + # https://github.com/bos/bloomfilter/issues/7 + bloomfilter = appendPatch super.bloomfilter ./patches/bloomfilter-fix-on-32bit.patch; + } diff --git a/pkgs/development/haskell-modules/patches/bloomfilter-fix-on-32bit.patch b/pkgs/development/haskell-modules/patches/bloomfilter-fix-on-32bit.patch new file mode 100644 index 000000000000..7b32dcb4ab6f --- /dev/null +++ b/pkgs/development/haskell-modules/patches/bloomfilter-fix-on-32bit.patch @@ -0,0 +1,28 @@ +From 35d972b3dc5056110d55315f2256d9c5046299c7 Mon Sep 17 00:00:00 2001 +From: Peter Simons +Date: Tue, 1 Sep 2015 17:58:36 +0200 +Subject: [PATCH] Revert "Fix maximum sizing calculation." + +This reverts commit 44b01ba38b4fcdb5a85f44fa2f3af1f29cde8f40. The change breaks +this package on 32 bit platforms. See https://github.com/bos/bloomfilter/issues/7 +for further details. +--- + Data/BloomFilter/Easy.hs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Data/BloomFilter/Easy.hs b/Data/BloomFilter/Easy.hs +index 5143c6e..a349168 100644 +--- a/Data/BloomFilter/Easy.hs ++++ b/Data/BloomFilter/Easy.hs +@@ -72,7 +72,7 @@ safeSuggestSizing capacity errRate + minimum [((-k) * cap / log (1 - (errRate ** (1 / k))), k) + | k <- [1..100]] + roundedBits = nextPowerOfTwo (ceiling bits) +- in if roundedBits <= 0 || roundedBits > 0xffffffff ++ in if roundedBits <= 0 + then Left "capacity too large to represent" + else Right (roundedBits, truncate hashes) + +-- +2.5.1 +