aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/haskell-modules/patches
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-10-05 12:43:18 +0000
committerKatharina Fey <kookie@spacekookie.de>2019-10-05 12:44:52 +0000
commitcf85056ba64caf3267d43255ef4a1243e9c8ee3b (patch)
tree3051519e9c8275b870aac43f80af875715c9d124 /nixpkgs/pkgs/development/haskell-modules/patches
parent1148b1d122bc03e9a3665856c9b7bb96bd4e3994 (diff)
parent2436c27541b2f52deea3a4c1691216a02152e729 (diff)
Add 'nixpkgs/' from commit '2436c27541b2f52deea3a4c1691216a02152e729'
git-subtree-dir: nixpkgs git-subtree-mainline: 1148b1d122bc03e9a3665856c9b7bb96bd4e3994 git-subtree-split: 2436c27541b2f52deea3a4c1691216a02152e729
Diffstat (limited to 'nixpkgs/pkgs/development/haskell-modules/patches')
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/GLUT.patch12
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/amazonka-Allow-http-client-0.6.patch24
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/amazonka-core-Allow-http-client-0.6.patch26
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/bloomfilter-fix-on-32bit.patch28
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/dyre-nix.patch25
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/encoding-Cabal-2.0.patch67
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/ghc-paths-nix-ghcjs.patch65
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/ghc-paths-nix.patch43
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/hunspell.patch30
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/opencv-fix-116.patch11
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-0.2.2.0.patch23
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-protoc-0.2.2.3.patch51
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/servant-client-core-streamBody.patch82
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/sexpr-0.2.1.patch86
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/xattr-fix-build.patch16
-rw-r--r--nixpkgs/pkgs/development/haskell-modules/patches/xmonad-nix.patch73
16 files changed, 662 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/GLUT.patch b/nixpkgs/pkgs/development/haskell-modules/patches/GLUT.patch
new file mode 100644
index 00000000000..3025812213b
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/GLUT.patch
@@ -0,0 +1,12 @@
+diff --git a/GLUT.cabal b/GLUT.cabal
+index f370d6c..a404e1e 100644
+--- a/GLUT.cabal
++++ b/GLUT.cabal
+@@ -103,6 +103,7 @@ library
+ else
+ cpp-options: "-DCALLCONV=ccall"
+ cc-options: "-DUSE_DLSYM"
++ pkgconfig-depends: freeglut
+
+ executable BOGLGP01-OnYourOwn1
+ if !flag(BuildExamples)
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/amazonka-Allow-http-client-0.6.patch b/nixpkgs/pkgs/development/haskell-modules/patches/amazonka-Allow-http-client-0.6.patch
new file mode 100644
index 00000000000..9e1eeb75160
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/amazonka-Allow-http-client-0.6.patch
@@ -0,0 +1,24 @@
+From 657b70d174fe5cb61e56cb8b9c5e57f1ec216f2b Mon Sep 17 00:00:00 2001
+From: Mikhail Glushenkov <mikhail.glushenkov@gmail.com>
+Date: Wed, 10 Apr 2019 17:42:57 +0100
+Subject: [PATCH] Allow http-client 0.6.*.
+
+Changelog doesn't list any silently breaking semantic changes.
+---
+ amazonka/amazonka.cabal | 2 +-
+ core/amazonka-core.cabal | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/amazonka/amazonka.cabal b/amazonka/amazonka.cabal
+index e86713f11c..81c4cb7e48 100644
+--- a/amazonka.cabal
++++ b/amazonka.cabal
+@@ -67,7 +67,7 @@ library
+ , conduit-extra >= 1.1
+ , directory >= 1.2
+ , exceptions >= 0.6
+- , http-client >= 0.4 && < 0.6
++ , http-client >= 0.4 && < 0.7
+ , http-conduit >= 2.1.7 && < 3
+ , http-types >= 0.8
+ , ini >= 0.3.5
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/amazonka-core-Allow-http-client-0.6.patch b/nixpkgs/pkgs/development/haskell-modules/patches/amazonka-core-Allow-http-client-0.6.patch
new file mode 100644
index 00000000000..d99072d79c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/amazonka-core-Allow-http-client-0.6.patch
@@ -0,0 +1,26 @@
+From 657b70d174fe5cb61e56cb8b9c5e57f1ec216f2b Mon Sep 17 00:00:00 2001
+From: Mikhail Glushenkov <mikhail.glushenkov@gmail.com>
+Date: Wed, 10 Apr 2019 17:42:57 +0100
+Subject: [PATCH] Allow http-client 0.6.*.
+
+Changelog doesn't list any silently breaking semantic changes.
+---
+ amazonka/amazonka.cabal | 2 +-
+ core/amazonka-core.cabal | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/core/amazonka-core.cabal b/core/amazonka-core.cabal
+index 9796e007cf..eccb24e5bd 100644
+--- a/amazonka-core.cabal
++++ b/amazonka-core.cabal
+@@ -90,7 +90,7 @@ library
+ , deepseq >= 1.4
+ , exceptions >= 0.6
+ , hashable >= 1.2
+- , http-client >= 0.4 && < 0.6
++ , http-client >= 0.4 && < 0.7
+ , http-conduit >= 2.1.4 && < 3
+ , http-types >= 0.8 && (<0.11 || >=0.12)
+ , lens >= 4.4
+--
+2.23.0
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/bloomfilter-fix-on-32bit.patch b/nixpkgs/pkgs/development/haskell-modules/patches/bloomfilter-fix-on-32bit.patch
new file mode 100644
index 00000000000..7b32dcb4ab6
--- /dev/null
+++ b/nixpkgs/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 <simons@cryp.to>
+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
+
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/dyre-nix.patch b/nixpkgs/pkgs/development/haskell-modules/patches/dyre-nix.patch
new file mode 100644
index 00000000000..458e540e0c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/dyre-nix.patch
@@ -0,0 +1,25 @@
+--- dyre-0.8.12/Config/Dyre/Compile.hs 2015-04-13 11:00:20.794278350 +0100
++++ dyre-0.8.12-patched/Config/Dyre/Compile.hs 2015-04-13 11:07:26.938893502 +0100
+@@ -10,11 +10,13 @@
+ import System.FilePath ( (</>) )
+ import System.Directory ( getCurrentDirectory, doesFileExist
+ , createDirectoryIfMissing )
++import System.Environment ( lookupEnv )
++import Control.Applicative ((<$>))
+ import Control.Exception ( bracket )
+-import GHC.Paths ( ghc )
+
+ import Config.Dyre.Paths ( getPaths )
+ import Config.Dyre.Params ( Params(..) )
++import Data.Maybe ( fromMaybe )
+
+ -- | Return the path to the error file.
+ getErrorPath :: Params cfgType -> IO FilePath
+@@ -47,6 +49,7 @@
+ errFile <- getErrorPath params
+ result <- bracket (openFile errFile WriteMode) hClose $ \errHandle -> do
+ ghcOpts <- makeFlags params configFile tempBinary cacheDir libsDir
++ ghc <- fromMaybe "ghc" <$> lookupEnv "NIX_GHC"
+ ghcProc <- runProcess ghc ghcOpts (Just cacheDir) Nothing
+ Nothing Nothing (Just errHandle)
+ waitForProcess ghcProc
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/encoding-Cabal-2.0.patch b/nixpkgs/pkgs/development/haskell-modules/patches/encoding-Cabal-2.0.patch
new file mode 100644
index 00000000000..510e450945b
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/encoding-Cabal-2.0.patch
@@ -0,0 +1,67 @@
+From 67bb87ceff53f0178c988dd4e15eeb2daee92b84 Mon Sep 17 00:00:00 2001
+From: Gregor Kleen <pngwjpgh@users.noreply.github.com>
+Date: Tue, 20 Feb 2018 17:46:24 +0100
+Subject: [PATCH] Relax upper version bounds on dependencies
+
+---
+ Setup.hs | 20 ++++++++++++++++----
+ encoding.cabal | 4 ++--
+ stack.yaml | 4 ++--
+ 3 files changed, 20 insertions(+), 8 deletions(-)
+
+diff --git a/Setup.hs b/Setup.hs
+index de719e6..fe5b84c 100644
+--- a/Setup.hs
++++ b/Setup.hs
+@@ -1,13 +1,25 @@
++{-# LANGUAGE CPP #-}
++
+ module Main where
+
+ import Distribution.Simple
+ import Data.Encoding.Preprocessor.Mapping
+ import Data.Encoding.Preprocessor.XMLMappingBuilder
+
++#if MIN_VERSION_Cabal(2,0,0)
++main = defaultMainWithHooks (simpleUserHooks
++ {hookedPreProcessors = ( ("mapping" , \_ _ _ -> mappingPreprocessor)
++ : ("mapping2", \_ _ _ -> mappingPreprocessor)
++ : ("xml" , \_ _ _ -> xmlPreprocessor)
++ : (hookedPreProcessors simpleUserHooks)
++ )
++ })
++#else
+ main = defaultMainWithHooks (simpleUserHooks
+- {hookedPreProcessors = (("mapping",\_ _ -> mappingPreprocessor)
+- :("mapping2",\_ _ -> mappingPreprocessor)
+- :("xml",\_ _ -> xmlPreprocessor)
+- :(hookedPreProcessors simpleUserHooks)
++ {hookedPreProcessors = ( ("mapping" , \_ _ -> mappingPreprocessor)
++ : ("mapping2", \_ _ -> mappingPreprocessor)
++ : ("xml" , \_ _ -> xmlPreprocessor)
++ : (hookedPreProcessors simpleUserHooks)
+ )
+ })
++#endif
+diff --git a/encoding.cabal b/encoding.cabal
+index ec20617..f221715 100644
+--- a/encoding.cabal
++++ b/encoding.cabal
+@@ -36,7 +36,7 @@ Source-Repository this
+
+ Custom-Setup
+ Setup-Depends: base >=3 && <5,
+- Cabal >=1.24 && <1.25,
++ Cabal >=1.24 && <2.1,
+ containers,
+ filepath,
+ ghc-prim,
+@@ -51,7 +51,7 @@ Library
+ extensible-exceptions >=0.1 && <0.2,
+ ghc-prim >=0.3 && <0.6,
+ mtl >=2.0 && <2.3,
+- regex-compat >=0.71 && <0.95
++ regex-compat >=0.71 && <0.96
+
+ Extensions: CPP
+
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/ghc-paths-nix-ghcjs.patch b/nixpkgs/pkgs/development/haskell-modules/patches/ghc-paths-nix-ghcjs.patch
new file mode 100644
index 00000000000..26ea0eaa5a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/ghc-paths-nix-ghcjs.patch
@@ -0,0 +1,65 @@
+diff --git a/GHC/Paths.hs b/GHC/Paths.hs
+index c87565d..88b3db4 100644
+--- a/GHC/Paths.hs
++++ b/GHC/Paths.hs
+@@ -1,13 +1,35 @@
+ {-# LANGUAGE CPP #-}
++{-# LANGUAGE ScopedTypeVariables #-}
+
+ module GHC.Paths (
+ ghc, ghc_pkg, libdir, docdir
+ ) where
+
++import Control.Exception as E
++import Data.Maybe
++import System.Environment
++import System.IO.Unsafe
++
++-- Yes, there's lookupEnv now, but we want to be compatible
++-- with older GHCs.
++checkEnv :: String -> IO (Maybe String)
++checkEnv var = E.catch (fmap Just (getEnv var))
++ (\ (e :: IOException) -> return Nothing)
++
++nixLibdir, nixDocdir, nixGhc, nixGhcPkg :: Maybe FilePath
++nixLibdir = unsafePerformIO (checkEnv "NIX_GHCJS_LIBDIR")
++nixDocdir = unsafePerformIO (checkEnv "NIX_GHCJS_DOCDIR")
++nixGhc = unsafePerformIO (checkEnv "NIX_GHCJS")
++nixGhcPkg = unsafePerformIO (checkEnv "NIX_GHCJSPKG")
++{-# NOINLINE nixLibdir #-}
++{-# NOINLINE nixDocdir #-}
++{-# NOINLINE nixGhc #-}
++{-# NOINLINE nixGhcPkg #-}
++
+ libdir, docdir, ghc, ghc_pkg :: FilePath
+
+-libdir = GHC_PATHS_LIBDIR
+-docdir = GHC_PATHS_DOCDIR
++libdir = fromMaybe GHC_PATHS_LIBDIR nixLibdir
++docdir = fromMaybe GHC_PATHS_DOCDIR nixDocdir
+
+-ghc = GHC_PATHS_GHC
+-ghc_pkg = GHC_PATHS_GHC_PKG
++ghc = fromMaybe GHC_PATHS_GHC nixGhc
++ghc_pkg = fromMaybe GHC_PATHS_GHC_PKG nixGhcPkg
+diff --git a/Setup.hs b/Setup.hs
+index fad5026..1651650 100644
+--- a/Setup.hs
++++ b/Setup.hs
+@@ -27,13 +27,13 @@ main = defaultMainWithHooks simpleUserHooks {
+ defaultPostConf :: Args -> ConfigFlags -> PackageDescription -> LocalBuildInfo -> IO ()
+ defaultPostConf args flags pkgdescr lbi = do
+ libdir_ <- rawSystemProgramStdoutConf (fromFlag (configVerbosity flags))
+- ghcProgram (withPrograms lbi) ["--print-libdir"]
++ ghcjsProgram (withPrograms lbi) ["--print-libdir"]
+ let libdir = reverse $ dropWhile isSpace $ reverse libdir_
+
+- ghc_pkg = case lookupProgram ghcPkgProgram (withPrograms lbi) of
++ ghc_pkg = case lookupProgram ghcjsPkgProgram (withPrograms lbi) of
+ Just p -> programPath p
+ Nothing -> error "ghc-pkg was not found"
+- ghc = case lookupProgram ghcProgram (withPrograms lbi) of
++ ghc = case lookupProgram ghcjsProgram (withPrograms lbi) of
+ Just p -> programPath p
+ Nothing -> error "ghc was not found"
+
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/ghc-paths-nix.patch b/nixpkgs/pkgs/development/haskell-modules/patches/ghc-paths-nix.patch
new file mode 100644
index 00000000000..b3c75a26a03
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/ghc-paths-nix.patch
@@ -0,0 +1,43 @@
+diff -Naur ghc-paths-0.1.0.9/GHC/Paths.hs ghc-paths-0.1.0.9-new/GHC/Paths.hs
+--- ghc-paths-0.1.0.9/GHC/Paths.hs 2012-12-16 13:53:45.720148396 +0100
++++ ghc-paths-0.1.0.9-new/GHC/Paths.hs 2012-12-16 17:22:12.765576568 +0100
+@@ -1,13 +1,35 @@
+ {-# LANGUAGE CPP #-}
++{-# LANGUAGE ScopedTypeVariables #-}
+
+ module GHC.Paths (
+ ghc, ghc_pkg, libdir, docdir
+ ) where
+
++import Control.Exception as E
++import Data.Maybe
++import System.Environment
++import System.IO.Unsafe
++
++-- Yes, there's lookupEnv now, but we want to be compatible
++-- with older GHCs.
++checkEnv :: String -> IO (Maybe String)
++checkEnv var = E.catch (fmap Just (getEnv var))
++ (\ (e :: IOException) -> return Nothing)
++
++nixLibdir, nixDocdir, nixGhc, nixGhcPkg :: Maybe FilePath
++nixLibdir = unsafePerformIO (checkEnv "NIX_GHC_LIBDIR")
++nixDocdir = unsafePerformIO (checkEnv "NIX_GHC_DOCDIR")
++nixGhc = unsafePerformIO (checkEnv "NIX_GHC")
++nixGhcPkg = unsafePerformIO (checkEnv "NIX_GHCPKG")
++{-# NOINLINE nixLibdir #-}
++{-# NOINLINE nixDocdir #-}
++{-# NOINLINE nixGhc #-}
++{-# NOINLINE nixGhcPkg #-}
++
+ libdir, docdir, ghc, ghc_pkg :: FilePath
+
+-libdir = GHC_PATHS_LIBDIR
+-docdir = GHC_PATHS_DOCDIR
++libdir = fromMaybe GHC_PATHS_LIBDIR nixLibdir
++docdir = fromMaybe GHC_PATHS_DOCDIR nixDocdir
+
+-ghc = GHC_PATHS_GHC
+-ghc_pkg = GHC_PATHS_GHC_PKG
++ghc = fromMaybe GHC_PATHS_GHC nixGhc
++ghc_pkg = fromMaybe GHC_PATHS_GHC_PKG nixGhcPkg
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/hunspell.patch b/nixpkgs/pkgs/development/haskell-modules/patches/hunspell.patch
new file mode 100644
index 00000000000..cc115029a7a
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/hunspell.patch
@@ -0,0 +1,30 @@
+diff -Naur hunspell-hs-0.1.0.0.orig/hunspell-hs.cabal hunspell-hs-0.1.0.0/hunspell-hs.cabal
+--- hunspell-hs-0.1.0.0.orig/hunspell-hs.cabal 2018-08-26 20:23:33.053763300 +0200
++++ hunspell-hs-0.1.0.0/hunspell-hs.cabal 2018-08-26 20:42:05.886074510 +0200
+@@ -37,7 +37,7 @@
+ base >=4.7 && <5
+ , stm
+ if os(linux)
+- extra-libraries:
++ pkgconfig-depends:
+ hunspell
+ if os(darwin)
+ include-dirs:
+@@ -63,7 +63,7 @@
+ , hunspell-hs
+ , stm
+ if os(linux)
+- extra-libraries:
++ pkgconfig-depends:
+ hunspell
+ if os(darwin)
+ include-dirs:
+@@ -88,7 +88,7 @@
+ , hunspell-hs
+ , stm
+ if os(linux)
+- extra-libraries:
++ pkgconfig-depends:
+ hunspell
+ if os(darwin)
+ include-dirs:
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/opencv-fix-116.patch b/nixpkgs/pkgs/development/haskell-modules/patches/opencv-fix-116.patch
new file mode 100644
index 00000000000..bf89d8daf9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/opencv-fix-116.patch
@@ -0,0 +1,11 @@
+diff -ur opencv-0.0.2.1.bak/Setup.hs opencv-0.0.2.1/Setup.hs
+--- opencv-0.0.2.1.bak/Setup.hs 2018-11-10 17:18:41.355731189 +0100
++++ opencv-0.0.2.1/Setup.hs 2018-11-10 17:18:56.901681162 +0100
+@@ -3,6 +3,6 @@
+
+ main = do
+ args <- getArgs
+- let args' | "configure" `elem` args = args ++ ["--with-gcc","c++", "--with-ld","c++"]
++ let args' | "configure" `elem` args = args ++ ["--with-gcc","c++"]
+ | otherwise = args
+ defaultMainArgs args'
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-0.2.2.0.patch b/nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-0.2.2.0.patch
new file mode 100644
index 00000000000..100a828a501
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-0.2.2.0.patch
@@ -0,0 +1,23 @@
+diff -Naur proto-lens-0.2.2.0/proto-lens.cabal proto-lens-0.2.2.0-patched/proto-lens.cabal
+--- proto-lens-0.2.2.0/proto-lens.cabal 2018-08-13 18:05:41.704823370 +0200
++++ proto-lens-0.2.2.0-patched/proto-lens.cabal 2018-08-13 18:07:42.352372300 +0200
+@@ -33,7 +33,7 @@
+ Data.ProtoLens.Encoding.Wire
+ Data.ProtoLens.TextFormat.Parser
+ build-depends: attoparsec == 0.13.*
+- , base >= 4.8 && < 4.11
++ , base >= 4.8
+ , bytestring == 0.10.*
+ , containers == 0.5.*
+ , data-default-class >= 0.0 && < 0.2
+diff -Naur proto-lens-0.2.2.0/src/Data/ProtoLens/TextFormat.hs proto-lens-0.2.2.0-patched/src/Data/ProtoLens/TextFormat.hs
+--- proto-lens-0.2.2.0/src/Data/ProtoLens/TextFormat.hs 2017-04-28 02:16:46.000000000 +0200
++++ proto-lens-0.2.2.0-patched/src/Data/ProtoLens/TextFormat.hs 2018-08-13 18:08:06.371486594 +0200
+@@ -17,6 +17,7 @@
+ readMessageOrDie,
+ ) where
+
++import Prelude hiding ((<>))
+ import Lens.Family2 ((&),(^.),(.~), set, over)
+ import Control.Arrow (left)
+ import qualified Data.ByteString
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-protoc-0.2.2.3.patch b/nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-protoc-0.2.2.3.patch
new file mode 100644
index 00000000000..87fd2aeab21
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/proto-lens-protoc-0.2.2.3.patch
@@ -0,0 +1,51 @@
+diff -Naur proto-lens-protoc-0.2.2.3/proto-lens-protoc.cabal proto-lens-protoc-0.2.2.3-patched/proto-lens-protoc.cabal
+--- proto-lens-protoc-0.2.2.3/proto-lens-protoc.cabal 2018-07-21 22:55:12.041698876 +0200
++++ proto-lens-protoc-0.2.2.3-patched/proto-lens-protoc.cabal 2018-08-13 19:44:44.993147985 +0200
+@@ -37,8 +37,8 @@
+ default-language: Haskell2010
+ hs-source-dirs: src
+ build-depends:
+- Cabal >= 1.22 && < 2.1
+- , base >= 4.8 && < 4.11
++ Cabal >= 1.22
++ , base >= 4.8
+ , bytestring == 0.10.*
+ , containers == 0.5.*
+ , data-default-class >= 0.0 && < 0.2
+@@ -53,6 +53,7 @@
+ , proto-lens == 0.2.2.*
+ , proto-lens-descriptors == 0.2.2.*
+ , text == 1.2.*
++ , semigroups
+ reexported-modules:
+ -- Modules that are needed by the generated Haskell files.
+ -- For forwards compatibility, reexport them as new module names so that
+@@ -76,7 +77,7 @@
+ main-is: protoc-gen-haskell.hs
+
+ build-depends:
+- base >= 4.8 && < 4.11
++ base >= 4.8
+ , bytestring == 0.10.*
+ , containers == 0.5.*
+ , data-default-class >= 0.0 && < 0.2
+diff -Naur proto-lens-protoc-0.2.2.3/src/Data/ProtoLens/Compiler/Definitions.hs proto-lens-protoc-0.2.2.3-patched/src/Data/ProtoLens/Compiler/Definitions.hs
+--- proto-lens-protoc-0.2.2.3/src/Data/ProtoLens/Compiler/Definitions.hs 2017-08-07 06:52:21.000000000 +0200
++++ proto-lens-protoc-0.2.2.3-patched/src/Data/ProtoLens/Compiler/Definitions.hs 2018-08-13 19:14:07.240505220 +0200
+@@ -35,6 +35,7 @@
+ import qualified Data.Map as Map
+ import Data.Maybe (fromMaybe)
+ import Data.Monoid
++import qualified Data.Semigroup as Semigroup
+ import qualified Data.Set as Set
+ import Data.String (IsString(..))
+ import Data.Text (Text, cons, splitOn, toLower, uncons, unpack)
+@@ -139,7 +140,7 @@
+ -- a 'Symbol' is used to construct both the type-level argument to
+ -- @HasLens@ and the name of the function @foo@.
+ newtype Symbol = Symbol String
+- deriving (Eq, Ord, IsString, Monoid)
++ deriving (Eq, Ord, IsString, Semigroup.Semigroup, Monoid)
+
+ nameFromSymbol :: Symbol -> Name
+ nameFromSymbol (Symbol s) = fromString s
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/servant-client-core-streamBody.patch b/nixpkgs/pkgs/development/haskell-modules/patches/servant-client-core-streamBody.patch
new file mode 100644
index 00000000000..ebadd215cb7
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/servant-client-core-streamBody.patch
@@ -0,0 +1,82 @@
+diff --git a/src/Servant/Client/Core/Internal/HasClient.hs b/src/Servant/Client/Core/Internal/HasClient.hs
+index 712007006..6be92ec6d 100644
+--- a/src/Servant/Client/Core/Internal/HasClient.hs
++++ b/src/Servant/Client/Core/Internal/HasClient.hs
+@@ -16,6 +16,8 @@ module Servant.Client.Core.Internal.HasClient where
+ import Prelude ()
+ import Prelude.Compat
+
++import Control.Concurrent.MVar
++ (modifyMVar, newMVar)
+ import qualified Data.ByteString as BS
+ import qualified Data.ByteString.Lazy as BL
+ import Data.Foldable
+@@ -36,13 +38,14 @@ import qualified Network.HTTP.Types as H
+ import Servant.API
+ ((:<|>) ((:<|>)), (:>), AuthProtect, BasicAuth, BasicAuthData,
+ BuildHeadersTo (..), Capture', CaptureAll, Description,
+- EmptyAPI, FramingUnrender (..), FromSourceIO (..), Header',
+- Headers (..), HttpVersion, IsSecure, MimeRender (mimeRender),
++ EmptyAPI, FramingRender (..), FramingUnrender (..),
++ FromSourceIO (..), Header', Headers (..), HttpVersion,
++ IsSecure, MimeRender (mimeRender),
+ MimeUnrender (mimeUnrender), NoContent (NoContent), QueryFlag,
+ QueryParam', QueryParams, Raw, ReflectMethod (..), RemoteHost,
+ ReqBody', SBoolI, Stream, StreamBody', Summary, ToHttpApiData,
+- Vault, Verb, WithNamedContext, contentType, getHeadersHList,
+- getResponse, toQueryParam, toUrlPiece)
++ ToSourceIO (..), Vault, Verb, WithNamedContext, contentType,
++ getHeadersHList, getResponse, toQueryParam, toUrlPiece)
+ import Servant.API.ContentTypes
+ (contentTypes)
+ import Servant.API.Modifiers
+@@ -538,7 +541,7 @@ instance (MimeRender ct a, HasClient m api)
+ hoistClientMonad pm (Proxy :: Proxy api) f (cl a)
+
+ instance
+- ( HasClient m api
++ ( HasClient m api, MimeRender ctype chunk, FramingRender framing, ToSourceIO chunk a
+ ) => HasClient m (StreamBody' mods framing ctype a :> api)
+ where
+
+@@ -547,7 +550,39 @@ instance
+ hoistClientMonad pm _ f cl = \a ->
+ hoistClientMonad pm (Proxy :: Proxy api) f (cl a)
+
+- clientWithRoute _pm Proxy _req _body = error "HasClient @StreamBody"
++ clientWithRoute pm Proxy req body
++ = clientWithRoute pm (Proxy :: Proxy api)
++ $ setRequestBody (RequestBodyStreamChunked givesPopper) (contentType ctypeP) req
++ where
++ ctypeP = Proxy :: Proxy ctype
++ framingP = Proxy :: Proxy framing
++
++ sourceIO = framingRender
++ framingP
++ (mimeRender ctypeP :: chunk -> BL.ByteString)
++ (toSourceIO body)
++
++ -- not pretty.
++ givesPopper :: (IO BS.ByteString -> IO ()) -> IO ()
++ givesPopper needsPopper = S.unSourceT sourceIO $ \step0 -> do
++ ref <- newMVar step0
++
++ -- Note sure we need locking, but it's feels safer.
++ let popper :: IO BS.ByteString
++ popper = modifyMVar ref nextBs
++
++ needsPopper popper
++
++ nextBs S.Stop = return (S.Stop, BS.empty)
++ nextBs (S.Error err) = fail err
++ nextBs (S.Skip s) = nextBs s
++ nextBs (S.Effect ms) = ms >>= nextBs
++ nextBs (S.Yield lbs s) = case BL.toChunks lbs of
++ [] -> nextBs s
++ (x:xs) | BS.null x -> nextBs step'
++ | otherwise -> return (step', x)
++ where
++ step' = S.Yield (BL.fromChunks xs) s
+
+
+
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/sexpr-0.2.1.patch b/nixpkgs/pkgs/development/haskell-modules/patches/sexpr-0.2.1.patch
new file mode 100644
index 00000000000..acafadba031
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/sexpr-0.2.1.patch
@@ -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
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/xattr-fix-build.patch b/nixpkgs/pkgs/development/haskell-modules/patches/xattr-fix-build.patch
new file mode 100644
index 00000000000..4b4f370b17f
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/xattr-fix-build.patch
@@ -0,0 +1,16 @@
+diff --git a/System/Xattr.hsc b/System/Xattr.hsc
+index adaf9cb..9b49996 100644
+--- a/System/Xattr.hsc
++++ b/System/Xattr.hsc
+@@ -45,11 +45,7 @@ module System.Xattr
+ where
+
+ #include <sys/types.h>
+-#ifdef __APPLE__
+ #include <sys/xattr.h>
+-#else
+-#include <attr/xattr.h>
+-#endif
+
+ import Data.Functor ((<$>))
+ import Foreign.C
diff --git a/nixpkgs/pkgs/development/haskell-modules/patches/xmonad-nix.patch b/nixpkgs/pkgs/development/haskell-modules/patches/xmonad-nix.patch
new file mode 100644
index 00000000000..cce011347f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/haskell-modules/patches/xmonad-nix.patch
@@ -0,0 +1,73 @@
+diff --git a/src/XMonad/Core.hs b/src/XMonad/Core.hs
+index 7810522..3262934 100644
+--- a/src/XMonad/Core.hs
++++ b/src/XMonad/Core.hs
+@@ -53,6 +53,7 @@ import System.Posix.Types (ProcessID)
+ import System.Process
+ import System.Directory
+ import System.Exit
++import System.Environment (lookupEnv)
+ import Graphics.X11.Xlib
+ import Graphics.X11.Xlib.Extras (getWindowAttributes, WindowAttributes, Event)
+ import Data.Typeable
+@@ -601,6 +602,7 @@ recompile force = io $ do
+ lib = cfgdir </> "lib"
+ buildscript = cfgdir </> "build"
+
++ ghc <- fromMaybe "ghc" <$> liftIO (lookupEnv "NIX_GHC")
+ libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
+ srcT <- getModTime src
+ binT <- getModTime bin
+@@ -643,7 +645,7 @@ recompile force = io $ do
+ status <- bracket (openFile err WriteMode) hClose $ \errHandle ->
+ waitForProcess =<< if useBuildscript
+ then compileScript bin cfgdir buildscript errHandle
+- else compileGHC bin cfgdir errHandle
++ else compileGHC ghc bin cfgdir errHandle
+
+ -- re-enable SIGCHLD:
+ installSignalHandlers
+@@ -653,6 +655,7 @@ recompile force = io $ do
+ then trace "XMonad recompilation process exited with success!"
+ else do
+ ghcErr <- readFile err
++ xmessage <- fromMaybe "xmessage" <$> liftIO (lookupEnv "XMONAD_XMESSAGE")
+ let msg = unlines $
+ ["Error detected while loading xmonad configuration file: " ++ src]
+ ++ lines (if null ghcErr then show status else ghcErr)
+@@ -660,7 +663,7 @@ recompile force = io $ do
+ -- nb, the ordering of printing, then forking, is crucial due to
+ -- lazy evaluation
+ hPutStrLn stderr msg
+- forkProcess $ executeFile "xmessage" True ["-default", "okay", replaceUnicode msg] Nothing
++ forkProcess $ executeFile xmessage True ["-default", "okay", replaceUnicode msg] Nothing
+ return ()
+ return (status == ExitSuccess)
+ else return True
+@@ -678,16 +681,16 @@ recompile force = io $ do
+ '\8216' -> '`' -- ‘
+ '\8217' -> '`' -- ’
+ _ -> c
+- compileGHC bin dir errHandle =
+- runProcess "ghc" ["--make"
+- , "xmonad.hs"
+- , "-i"
+- , "-ilib"
+- , "-fforce-recomp"
+- , "-main-is", "main"
+- , "-v0"
+- , "-o", bin
+- ] (Just dir) Nothing Nothing Nothing (Just errHandle)
++ compileGHC ghc bin dir errHandle =
++ runProcess ghc ["--make"
++ , "xmonad.hs"
++ , "-i"
++ , "-ilib"
++ , "-fforce-recomp"
++ , "-main-is", "main"
++ , "-v0"
++ , "-o", bin
++ ] (Just dir) Nothing Nothing Nothing (Just errHandle)
+ compileScript bin dir script errHandle =
+ runProcess script [bin] (Just dir) Nothing Nothing Nothing (Just errHandle)
+