summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/patches
diff options
context:
space:
mode:
authorobadz <dav-github@odav.org>2015-08-05 20:48:18 +0100
committerobadz <dav-github@odav.org>2015-08-06 11:14:05 +0100
commit3801ef59127330d30f98ff3af3e04e7ac790722e (patch)
tree1085c539bb6dd90ace1536ac2e8a516b9a4d64ab /pkgs/development/haskell-modules/patches
parent23f5a23ec7251a54918d00aa996bfffcb6b72d3b (diff)
downloadnixlib-3801ef59127330d30f98ff3af3e04e7ac790722e.tar
nixlib-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.gz
nixlib-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.bz2
nixlib-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.lz
nixlib-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.xz
nixlib-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.zst
nixlib-3801ef59127330d30f98ff3af3e04e7ac790722e.zip
haskell: move patches to patches directory
Diffstat (limited to 'pkgs/development/haskell-modules/patches')
-rw-r--r--pkgs/development/haskell-modules/patches/dyre-nix.patch25
-rw-r--r--pkgs/development/haskell-modules/patches/edit-distance-fix-boundaries.patch30
-rw-r--r--pkgs/development/haskell-modules/patches/ghc-paths-nix-ghcjs.patch65
-rw-r--r--pkgs/development/haskell-modules/patches/ghc-paths-nix.patch43
-rw-r--r--pkgs/development/haskell-modules/patches/graphviz-fix-ghc710.patch11
-rw-r--r--pkgs/development/haskell-modules/patches/haskell-src-meta-ghc710.patch55
-rw-r--r--pkgs/development/haskell-modules/patches/wxc-no-ldconfig.patch10
-rw-r--r--pkgs/development/haskell-modules/patches/xmonad-nix.patch44
8 files changed, 283 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/patches/dyre-nix.patch b/pkgs/development/haskell-modules/patches/dyre-nix.patch
new file mode 100644
index 000000000000..458e540e0c4a
--- /dev/null
+++ b/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/pkgs/development/haskell-modules/patches/edit-distance-fix-boundaries.patch b/pkgs/development/haskell-modules/patches/edit-distance-fix-boundaries.patch
new file mode 100644
index 000000000000..ec88c65f8bc0
--- /dev/null
+++ b/pkgs/development/haskell-modules/patches/edit-distance-fix-boundaries.patch
@@ -0,0 +1,30 @@
+diff -ru3 edit-distance-0.2.1.2-old/edit-distance.cabal edit-distance-0.2.1.2/edit-distance.cabal
+--- edit-distance-0.2.1.2-old/edit-distance.cabal	2015-04-17 22:46:50.964116064 +0300
++++ edit-distance-0.2.1.2/edit-distance.cabal	2015-04-17 22:41:31.216027373 +0300
+@@ -36,7 +36,7 @@
+                                 Text.EditDistance.ArrayUtilities

+         

+         if flag(splitBase)

+-                Build-Depends:  base >= 3 && < 4.8, array >= 0.1, random >= 1.0, containers >= 0.1.0.1

++                Build-Depends:  base >= 3 && < 5, array >= 0.1, random >= 1.0, containers >= 0.1.0.1

+         else

+                 Build-Depends:  base < 3

+         

+@@ -54,7 +54,7 @@
+         else            

+                 Build-Depends:          test-framework >= 0.1.1, QuickCheck >= 1.1 && < 2.0, test-framework-quickcheck

+                 if flag(splitBase)

+-                        Build-Depends:  base >= 3 && < 4.8, array >= 0.1, random >= 1.0

++                        Build-Depends:  base >= 3 && < 5, array >= 0.1, random >= 1.0

+                 else

+                         Build-Depends:  base < 3

+ 

+@@ -65,7 +65,7 @@
+                 Buildable:      False

+         else

+                 if flag(splitBase)

+-                        Build-Depends:  base >= 3 && < 4.8, array >= 0.1, random >= 1.0, time >= 1.0, process >= 1.0,

++                        Build-Depends:  base >= 3 && < 5, array >= 0.1, random >= 1.0, time >= 1.0, process >= 1.0,

+                                         deepseq >= 1.2, unix >= 2.3, criterion >= 0.6

+                 else

+                         Build-Depends:  base < 3,

diff --git a/pkgs/development/haskell-modules/patches/ghc-paths-nix-ghcjs.patch b/pkgs/development/haskell-modules/patches/ghc-paths-nix-ghcjs.patch
new file mode 100644
index 000000000000..26ea0eaa5a8b
--- /dev/null
+++ b/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/pkgs/development/haskell-modules/patches/ghc-paths-nix.patch b/pkgs/development/haskell-modules/patches/ghc-paths-nix.patch
new file mode 100644
index 000000000000..b3c75a26a035
--- /dev/null
+++ b/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/pkgs/development/haskell-modules/patches/graphviz-fix-ghc710.patch b/pkgs/development/haskell-modules/patches/graphviz-fix-ghc710.patch
new file mode 100644
index 000000000000..e72bb793da73
--- /dev/null
+++ b/pkgs/development/haskell-modules/patches/graphviz-fix-ghc710.patch
@@ -0,0 +1,11 @@
+diff -ru3 graphviz.old/Data/GraphViz/Algorithms.hs graphviz/Data/GraphViz/Algorithms.hs
+--- graphviz.old/Data/GraphViz/Algorithms.hs	2015-05-18 15:21:38.379771357 +0300
++++ graphviz/Data/GraphViz/Algorithms.hs	2015-05-18 15:01:01.940122684 +0300
+@@ -38,6 +38,7 @@
+ import Data.GraphViz.Types.Canonical
+ import Data.GraphViz.Types.Internal.Common
+ 
++import           Prelude                   hiding (traverse)
+ import           Control.Arrow             (first, second, (***))
+ import           Control.Monad             (unless)
+ import           Control.Monad.Trans.State
diff --git a/pkgs/development/haskell-modules/patches/haskell-src-meta-ghc710.patch b/pkgs/development/haskell-modules/patches/haskell-src-meta-ghc710.patch
new file mode 100644
index 000000000000..c3df98043b3b
--- /dev/null
+++ b/pkgs/development/haskell-modules/patches/haskell-src-meta-ghc710.patch
@@ -0,0 +1,55 @@
+From 24e6f45408083745080ff2f3710f58209041113c Mon Sep 17 00:00:00 2001
+From: Luite Stegeman <stegeman@gmail.com>
+Date: Sun, 28 Dec 2014 21:33:22 +0100
+Subject: [PATCH] updates for GHC 7.10 and Template Haskell 2.10
+
+---
+ haskell-src-meta.cabal                        | 4 ++--
+ src/Language/Haskell/Meta/Syntax/Translate.hs | 6 ++++++
+ src/Language/Haskell/Meta/Utils.hs            | 5 ++++-
+ 3 files changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/src/Language/Haskell/Meta/Syntax/Translate.hs b/src/Language/Haskell/Meta/Syntax/Translate.hs
+index 189d32e..36a08f1 100644
+--- a/src/Language/Haskell/Meta/Syntax/Translate.hs
++++ b/src/Language/Haskell/Meta/Syntax/Translate.hs
+@@ -384,9 +384,15 @@ a .->. b = AppT (AppT ArrowT a) b
+ toCxt :: Hs.Context -> Cxt
+ toCxt = fmap toPred
+  where
++#if MIN_VERSION_template_haskell(2,10,0)
++  toPred (Hs.ClassA n ts) = foldl' AppT (ConT (toName n)) (fmap toType ts)
++  toPred (Hs.InfixA t1 n t2) = foldl' AppT (ConT (toName n)) (fmap toType [t1,t2])
++  toPred (Hs.EqualP t1 t2) = foldl' AppT EqualityT (fmap toType [t1,t2])
++#else
+   toPred (Hs.ClassA n ts) = ClassP (toName n) (fmap toType ts)
+   toPred (Hs.InfixA t1 n t2) = ClassP (toName n) (fmap toType [t1, t2])
+   toPred (Hs.EqualP t1 t2) = EqualP (toType t1) (toType t2)
++#endif
+   toPred a@Hs.IParam{} = noTH "toCxt" a
+ 
+ foldAppT :: Type -> [Type] -> Type
+diff --git a/src/Language/Haskell/Meta/Utils.hs b/src/Language/Haskell/Meta/Utils.hs
+index 36f7e96..d194f3e 100644
+--- a/src/Language/Haskell/Meta/Utils.hs
++++ b/src/Language/Haskell/Meta/Utils.hs
+@@ -166,6 +166,9 @@ renameT env new (ForallT ns cxt t) =
+     unVarT (VarT n) = PlainTV n
+     renamePreds = renameThings renamePred
+ 
++#if MIN_VERSION_template_haskell(2,10,0)
++    renamePred = renameT
++#else
+     renamePred env new (ClassP n ts) = let
+         (ts', env', new') = renameTs env new [] ts
+       in (ClassP (normaliseName n) ts', env', new')
+@@ -174,7 +177,7 @@ renameT env new (ForallT ns cxt t) =
+         (t1', env1, new1) = renameT env new t1
+         (t2', env2, new2) = renameT env1 new1 t2
+       in (EqualP t1' t2', env2, new2)
+-
++#endif
+ 
+ -- | Remove qualification, etc.
+ normaliseName :: Name -> Name
+
diff --git a/pkgs/development/haskell-modules/patches/wxc-no-ldconfig.patch b/pkgs/development/haskell-modules/patches/wxc-no-ldconfig.patch
new file mode 100644
index 000000000000..72a8648cab67
--- /dev/null
+++ b/pkgs/development/haskell-modules/patches/wxc-no-ldconfig.patch
@@ -0,0 +1,10 @@
+Only in wxc-0.91.0.0: dist
+diff -ubr wxc-0.91.0.0-orig/Setup.hs wxc-0.91.0.0/Setup.hs
+--- wxc-0.91.0.0-orig/Setup.hs	2014-10-31 13:30:15.514809137 +0100
++++ wxc-0.91.0.0/Setup.hs	2014-10-31 13:33:53.606372005 +0100
+@@ -507,5 +507,3 @@
+         inst_lib_dir = libdir $ absoluteInstallDirs pkg_descr local_bld_info NoCopyDest

+ 

+     installOrdinaryFile (verbosity flags) (bld_dir </> lib_name) (inst_lib_dir </> lib_name)

+-    ldconfig inst_lib_dir

+-

diff --git a/pkgs/development/haskell-modules/patches/xmonad-nix.patch b/pkgs/development/haskell-modules/patches/xmonad-nix.patch
new file mode 100644
index 000000000000..810d8435a343
--- /dev/null
+++ b/pkgs/development/haskell-modules/patches/xmonad-nix.patch
@@ -0,0 +1,44 @@
+--- xmonad-0.11/XMonad/Core.hs	2013-01-01 01:31:47.000000000 +0000
++++ new-xmonad/XMonad/Core.hs	2013-12-23 17:36:40.862146910 +0000
+@@ -47,6 +47,7 @@
+ import System.Process
+ import System.Directory
+ import System.Exit
++import System.Environment (lookupEnv)
+ import Graphics.X11.Xlib
+ import Graphics.X11.Xlib.Extras (Event)
+ import Data.Typeable
+@@ -452,6 +453,7 @@
+         err  = base ++ ".errors"
+         src  = base ++ ".hs"
+         lib  = dir </> "lib"
++    ghc <- fromMaybe "ghc" <$> liftIO (lookupEnv "NIX_GHC")
+     libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
+     srcT <- getModTime src
+     binT <- getModTime bin
+@@ -460,7 +462,7 @@
+         -- temporarily disable SIGCHLD ignoring:
+         uninstallSignalHandlers
+         status <- bracket (openFile err WriteMode) hClose $ \h ->
+-            waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir)
++            waitForProcess =<< runProcess ghc ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-v0", "-o",binn] (Just dir)
+                                     Nothing Nothing Nothing (Just h)
+ 
+         -- re-enable SIGCHLD:
+@@ -469,6 +471,7 @@
+         -- now, if it fails, run xmessage to let the user know:
+         when (status /= ExitSuccess) $ 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)
+@@ -476,7 +479,7 @@
+             -- nb, the ordering of printing, then forking, is crucial due to
+             -- lazy evaluation
+             hPutStrLn stderr msg
+-            forkProcess $ executeFile "xmessage" True ["-default", "okay", msg] Nothing
++            forkProcess $ executeFile xmessage True ["-default", "okay", msg] Nothing
+             return ()
+         return (status == ExitSuccess)
+       else return True