summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/patches/xmonad-nix.patch
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/xmonad-nix.patch
parent23f5a23ec7251a54918d00aa996bfffcb6b72d3b (diff)
downloadnixpkgs-3801ef59127330d30f98ff3af3e04e7ac790722e.tar
nixpkgs-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.gz
nixpkgs-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.bz2
nixpkgs-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.lz
nixpkgs-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.xz
nixpkgs-3801ef59127330d30f98ff3af3e04e7ac790722e.tar.zst
nixpkgs-3801ef59127330d30f98ff3af3e04e7ac790722e.zip
haskell: move patches to patches directory
Diffstat (limited to 'pkgs/development/haskell-modules/patches/xmonad-nix.patch')
-rw-r--r--pkgs/development/haskell-modules/patches/xmonad-nix.patch44
1 files changed, 44 insertions, 0 deletions
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 00000000000..810d8435a34
--- /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