mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-16 14:54:29 +01:00
Merge pull request #7358 from Fuuzetsu/dyre-nix_ghc
haskell-ng: patch dyre to check NIX_GHC
This commit is contained in:
commit
3e176fb2e3
2 changed files with 28 additions and 0 deletions
|
@ -731,6 +731,9 @@ self: super: {
|
|||
# Tries to run GUI in tests
|
||||
leksah = dontCheck super.leksah;
|
||||
|
||||
# Patch to consider NIX_GHC just like xmonad does
|
||||
dyre = appendPatch super.dyre ./dyre-nix.patch;
|
||||
|
||||
} // {
|
||||
|
||||
# Not on Hackage.
|
||||
|
|
25
pkgs/development/haskell-modules/dyre-nix.patch
Normal file
25
pkgs/development/haskell-modules/dyre-nix.patch
Normal file
|
@ -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
|
Loading…
Reference in a new issue