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