Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 687771ced6df
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3328ea77492e
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Aug 3, 2018

  1. Copy the full SHA
    3328ea7 View commit details
Showing with 93 additions and 0 deletions.
  1. +7 −0 pkgs/development/haskell-modules/configuration-common.nix
  2. +86 −0 pkgs/development/haskell-modules/patches/sexpr-0.2.1.patch
7 changes: 7 additions & 0 deletions pkgs/development/haskell-modules/configuration-common.nix
Original file line number Diff line number Diff line change
@@ -1128,4 +1128,11 @@ self: super: {

# needed because of testing-feat >=0.4.0.2 && <1.1
language-ecmascript = doJailbreak super.language-ecmascript;

# sexpr is old, broken and has no issue-tracker. Let's fix it the best we can.
sexpr =
appendPatch (overrideCabal super.sexpr (drv: {
isExecutable = false;
libraryHaskellDepends = drv.libraryHaskellDepends ++ [self.QuickCheck];
})) ./patches/sexpr-0.2.1.patch;
}
86 changes: 86 additions & 0 deletions pkgs/development/haskell-modules/patches/sexpr-0.2.1.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Internal.hs sexpr-0.2.1-patched/Codec/Sexpr/Internal.hs
--- sexpr-0.2.1/Codec/Sexpr/Internal.hs 2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Internal.hs 2018-08-03 01:38:08.000000000 +0200
@@ -62,11 +62,6 @@
return $ List []]
arbSexpr n = oneof [Atom <$> arbitrary,
List <$> (resize (n `div` 2) arbitrary)]
- coarbitrary (Atom s) = variant 0 . coarbitrary s
- coarbitrary (HintedAtom h s) = variant 1 . coarbitrary_h . coarbitrary s
- where coarbitrary_h =
- foldr (\a b -> variant (ord a) . variant 1 . b) (variant 0) h
- coarbitrary (List ss) = variant 2 . coarbitrary ss

-- |@fold f s@ applies f to each sub-S-expression of s, from each leaf
-- to the root. @f@ need not preserve the shape of @s@, in contrast
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Printer.hs sexpr-0.2.1-patched/Codec/Sexpr/Printer.hs
--- sexpr-0.2.1/Codec/Sexpr/Printer.hs 2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Printer.hs 2018-08-03 01:41:56.000000000 +0200
@@ -1,4 +1,4 @@
-{-# LANGUAGE FlexibleInstances, OverlappingInstances #-}
+{-# LANGUAGE FlexibleInstances #-}

-- | Export S-expressions in any of the three ordinary forms:
--
@@ -17,6 +17,8 @@

module Codec.Sexpr.Printer where

+import Prelude hiding ((<>))
+
import Codec.Sexpr.Internal

import Data.Binary.Put
@@ -30,7 +32,7 @@
instance Show (Sexpr String) where
show s = advancedString s

-instance Show s => Show (Sexpr s) where
+instance {-# OVERLAPPABLE #-} Show s => Show (Sexpr s) where
show s = advancedString $ fmap show s

raw :: String -> String -> String
diff -Naurw sexpr-0.2.1/Codec/Sexpr/Tests.hs sexpr-0.2.1-patched/Codec/Sexpr/Tests.hs
--- sexpr-0.2.1/Codec/Sexpr/Tests.hs 2009-04-30 00:51:06.000000000 +0200
+++ sexpr-0.2.1-patched/Codec/Sexpr/Tests.hs 2018-08-03 01:46:32.000000000 +0200
@@ -67,11 +67,9 @@

instance Arbitrary B.ByteString where
arbitrary = B.pack `fmap` arbitrary
- coarbitrary = undefined

instance Arbitrary Char where
arbitrary = choose (32,255) >>= \n -> return (chr n)
- coarbitrary n = variant (ord n)


main :: IO ()
diff -Naurw sexpr-0.2.1/sexpr.cabal sexpr-0.2.1-patched/sexpr.cabal
--- sexpr-0.2.1/sexpr.cabal 2018-08-03 01:36:11.000000000 +0200
+++ sexpr-0.2.1-patched/sexpr.cabal 2018-08-03 01:49:13.000000000 +0200
@@ -13,23 +13,9 @@
maintainer: bts@evenmere.org
build-type: Simple

-flag testing
- description: build test executable
- default: False
-
library
- if flag(testing)
- ghc-options: -Wall
- Build-Depends: base, base64-string, pretty, bytestring, binary
+ Build-Depends: base, base64-string, pretty, bytestring, binary, QuickCheck
Exposed-modules: Codec.Sexpr
-
-executable sexpr-test
- if !flag(testing)
- buildable: False
- ghc-options: -Wall
- main-is: Codec/Sexpr/Tests.hs
- other-modules: Codec.Sexpr
- Codec.Sexpr.Parser
+ other-modules: Codec.Sexpr.Parser
Codec.Sexpr.Printer
Codec.Sexpr.Internal
- build-depends: QuickCheck, random