summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2018-04-25 14:47:39 +0300
committerNikolay Amiantov <ab@fmap.me>2018-04-26 17:01:14 +0300
commitbea11a34fbcefe24a66cf64c7388124db567a17d (patch)
tree7cca909bc4aa29e70bba8d564298cf6ebd052438 /pkgs
parent17e5dcd3ddc4a9731ca2cfc72032c1c7ed846133 (diff)
downloadnixpkgs-bea11a34fbcefe24a66cf64c7388124db567a17d.tar
nixpkgs-bea11a34fbcefe24a66cf64c7388124db567a17d.tar.gz
nixpkgs-bea11a34fbcefe24a66cf64c7388124db567a17d.tar.bz2
nixpkgs-bea11a34fbcefe24a66cf64c7388124db567a17d.tar.lz
nixpkgs-bea11a34fbcefe24a66cf64c7388124db567a17d.tar.xz
nixpkgs-bea11a34fbcefe24a66cf64c7388124db567a17d.tar.zst
nixpkgs-bea11a34fbcefe24a66cf64c7388124db567a17d.zip
haskellPackages.encoding: fix build with Cabal 2.0
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/haskell-modules/configuration-common.nix3
-rw-r--r--pkgs/development/haskell-modules/patches/encoding-Cabal-2.0.patch67
2 files changed, 70 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/configuration-common.nix b/pkgs/development/haskell-modules/configuration-common.nix
index e4f2d672864..cfa80062e3b 100644
--- a/pkgs/development/haskell-modules/configuration-common.nix
+++ b/pkgs/development/haskell-modules/configuration-common.nix
@@ -1028,6 +1028,9 @@ self: super: {
     indexed-list-literals = self.indexed-list-literals_0_2_0_0;
   };
 
+  # https://github.com/dmwit/encoding/pull/3
+  encoding = appendPatch super.encoding ./patches/encoding-Cabal-2.0.patch;
+
 }
 
 //
diff --git a/pkgs/development/haskell-modules/patches/encoding-Cabal-2.0.patch b/pkgs/development/haskell-modules/patches/encoding-Cabal-2.0.patch
new file mode 100644
index 00000000000..510e450945b
--- /dev/null
+++ b/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
+