haskellPackages.sexpr: fix build

+93
+7
pkgs/development/haskell-modules/configuration-common.nix
··· 1128 1128 1129 1129 # needed because of testing-feat >=0.4.0.2 && <1.1 1130 1130 language-ecmascript = doJailbreak super.language-ecmascript; 1131 + 1132 + # sexpr is old, broken and has no issue-tracker. Let's fix it the best we can. 1133 + sexpr = 1134 + appendPatch (overrideCabal super.sexpr (drv: { 1135 + isExecutable = false; 1136 + libraryHaskellDepends = drv.libraryHaskellDepends ++ [self.QuickCheck]; 1137 + })) ./patches/sexpr-0.2.1.patch; 1131 1138 }
+86
pkgs/development/haskell-modules/patches/sexpr-0.2.1.patch
··· 1 + diff -Naurw sexpr-0.2.1/Codec/Sexpr/Internal.hs sexpr-0.2.1-patched/Codec/Sexpr/Internal.hs 2 + --- sexpr-0.2.1/Codec/Sexpr/Internal.hs 2009-04-30 00:51:06.000000000 +0200 3 + +++ sexpr-0.2.1-patched/Codec/Sexpr/Internal.hs 2018-08-03 01:38:08.000000000 +0200 4 + @@ -62,11 +62,6 @@ 5 + return $ List []] 6 + arbSexpr n = oneof [Atom <$> arbitrary, 7 + List <$> (resize (n `div` 2) arbitrary)] 8 + - coarbitrary (Atom s) = variant 0 . coarbitrary s 9 + - coarbitrary (HintedAtom h s) = variant 1 . coarbitrary_h . coarbitrary s 10 + - where coarbitrary_h = 11 + - foldr (\a b -> variant (ord a) . variant 1 . b) (variant 0) h 12 + - coarbitrary (List ss) = variant 2 . coarbitrary ss 13 + 14 + -- |@fold f s@ applies f to each sub-S-expression of s, from each leaf 15 + -- to the root. @f@ need not preserve the shape of @s@, in contrast 16 + diff -Naurw sexpr-0.2.1/Codec/Sexpr/Printer.hs sexpr-0.2.1-patched/Codec/Sexpr/Printer.hs 17 + --- sexpr-0.2.1/Codec/Sexpr/Printer.hs 2009-04-30 00:51:06.000000000 +0200 18 + +++ sexpr-0.2.1-patched/Codec/Sexpr/Printer.hs 2018-08-03 01:41:56.000000000 +0200 19 + @@ -1,4 +1,4 @@ 20 + -{-# LANGUAGE FlexibleInstances, OverlappingInstances #-} 21 + +{-# LANGUAGE FlexibleInstances #-} 22 + 23 + -- | Export S-expressions in any of the three ordinary forms: 24 + -- 25 + @@ -17,6 +17,8 @@ 26 + 27 + module Codec.Sexpr.Printer where 28 + 29 + +import Prelude hiding ((<>)) 30 + + 31 + import Codec.Sexpr.Internal 32 + 33 + import Data.Binary.Put 34 + @@ -30,7 +32,7 @@ 35 + instance Show (Sexpr String) where 36 + show s = advancedString s 37 + 38 + -instance Show s => Show (Sexpr s) where 39 + +instance {-# OVERLAPPABLE #-} Show s => Show (Sexpr s) where 40 + show s = advancedString $ fmap show s 41 + 42 + raw :: String -> String -> String 43 + diff -Naurw sexpr-0.2.1/Codec/Sexpr/Tests.hs sexpr-0.2.1-patched/Codec/Sexpr/Tests.hs 44 + --- sexpr-0.2.1/Codec/Sexpr/Tests.hs 2009-04-30 00:51:06.000000000 +0200 45 + +++ sexpr-0.2.1-patched/Codec/Sexpr/Tests.hs 2018-08-03 01:46:32.000000000 +0200 46 + @@ -67,11 +67,9 @@ 47 + 48 + instance Arbitrary B.ByteString where 49 + arbitrary = B.pack `fmap` arbitrary 50 + - coarbitrary = undefined 51 + 52 + instance Arbitrary Char where 53 + arbitrary = choose (32,255) >>= \n -> return (chr n) 54 + - coarbitrary n = variant (ord n) 55 + 56 + 57 + main :: IO () 58 + diff -Naurw sexpr-0.2.1/sexpr.cabal sexpr-0.2.1-patched/sexpr.cabal 59 + --- sexpr-0.2.1/sexpr.cabal 2018-08-03 01:36:11.000000000 +0200 60 + +++ sexpr-0.2.1-patched/sexpr.cabal 2018-08-03 01:49:13.000000000 +0200 61 + @@ -13,23 +13,9 @@ 62 + maintainer: bts@evenmere.org 63 + build-type: Simple 64 + 65 + -flag testing 66 + - description: build test executable 67 + - default: False 68 + - 69 + library 70 + - if flag(testing) 71 + - ghc-options: -Wall 72 + - Build-Depends: base, base64-string, pretty, bytestring, binary 73 + + Build-Depends: base, base64-string, pretty, bytestring, binary, QuickCheck 74 + Exposed-modules: Codec.Sexpr 75 + - 76 + -executable sexpr-test 77 + - if !flag(testing) 78 + - buildable: False 79 + - ghc-options: -Wall 80 + - main-is: Codec/Sexpr/Tests.hs 81 + - other-modules: Codec.Sexpr 82 + - Codec.Sexpr.Parser 83 + + other-modules: Codec.Sexpr.Parser 84 + Codec.Sexpr.Printer 85 + Codec.Sexpr.Internal 86 + - build-depends: QuickCheck, random