tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
update xmonad nix patch to apply to new xmonad
Jude Taylor
9 years ago
0637f83f
f56fa482
+46
-17
1 changed file
expand all
collapse all
unified
split
pkgs
development
haskell-modules
patches
xmonad-nix.patch
+46
-17
pkgs/development/haskell-modules/patches/xmonad-nix.patch
···
1
1
+
diff --git a/src/XMonad/Core.hs b/src/XMonad/Core.hs
2
2
+
index 138d735..65b5a84 100644
1
3
--- a/src/XMonad/Core.hs
2
4
+++ b/src/XMonad/Core.hs
3
3
-
@@ -48,6 +48,7 @@ import System.Posix.Types (ProcessID)
5
5
+
@@ -51,6 +51,7 @@ import System.Posix.Types (ProcessID)
4
6
import System.Process
5
7
import System.Directory
6
8
import System.Exit
7
9
+import System.Environment (lookupEnv)
8
10
import Graphics.X11.Xlib
9
9
-
import Graphics.X11.Xlib.Extras (Event)
11
11
+
import Graphics.X11.Xlib.Extras (getWindowAttributes, WindowAttributes, Event)
10
12
import Data.Typeable
11
11
-
@@ -463,6 +464,7 @@ recompile force = io $ do
12
12
-
err = base ++ ".errors"
13
13
-
src = base ++ ".hs"
14
14
-
lib = dir </> "lib"
13
13
+
@@ -571,6 +572,7 @@ recompile force = io $ do
14
14
+
lib = cfgdir </> "lib"
15
15
+
buildscript = cfgdir </> "build"
16
16
+
15
17
+ ghc <- fromMaybe "ghc" <$> liftIO (lookupEnv "NIX_GHC")
16
18
libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
17
19
srcT <- getModTime src
18
20
binT <- getModTime bin
19
19
-
@@ -471,7 +473,7 @@ recompile force = io $ do
20
20
-
-- temporarily disable SIGCHLD ignoring:
21
21
-
uninstallSignalHandlers
22
22
-
status <- bracket (openFile err WriteMode) hClose $ \h ->
23
23
-
- waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-main-is", "main", "-v0", "-o",binn] (Just dir)
24
24
-
+ waitForProcess =<< runProcess ghc ["--make", "xmonad.hs", "-i", "-ilib", "-fforce-recomp", "-main-is", "main", "-v0", "-o",binn] (Just dir)
25
25
-
Nothing Nothing Nothing (Just h)
21
21
+
@@ -586,7 +588,7 @@ recompile force = io $ do
22
22
+
status <- bracket (openFile err WriteMode) hClose $ \errHandle ->
23
23
+
waitForProcess =<< if useBuildscript
24
24
+
then compileScript bin cfgdir buildscript errHandle
25
25
+
- else compileGHC bin cfgdir errHandle
26
26
+
+ else compileGHC ghc bin cfgdir errHandle
26
27
27
28
-- re-enable SIGCHLD:
28
28
-
@@ -480,6 +482,7 @@ recompile force = io $ do
29
29
+
installSignalHandlers
30
30
+
@@ -594,6 +596,7 @@ recompile force = io $ do
29
31
-- now, if it fails, run xmessage to let the user know:
30
32
when (status /= ExitSuccess) $ do
31
33
ghcErr <- readFile err
···
33
35
let msg = unlines $
34
36
["Error detected while loading xmonad configuration file: " ++ src]
35
37
++ lines (if null ghcErr then show status else ghcErr)
36
36
-
@@ -487,7 +490,7 @@ recompile force = io $ do
38
38
+
@@ -601,7 +604,7 @@ recompile force = io $ do
37
39
-- nb, the ordering of printing, then forking, is crucial due to
38
40
-- lazy evaluation
39
41
hPutStrLn stderr msg
40
40
-
- forkProcess $ executeFile "xmessage" True ["-default", "okay", msg] Nothing
41
41
-
+ forkProcess $ executeFile xmessage True ["-default", "okay", msg] Nothing
42
42
+
- forkProcess $ executeFile "xmessage" True ["-default", "okay", replaceUnicode msg] Nothing
43
43
+
+ forkProcess $ executeFile xmessage True ["-default", "okay", replaceUnicode msg] Nothing
42
44
return ()
43
45
return (status == ExitSuccess)
44
46
else return True
47
47
+
@@ -619,16 +622,16 @@ recompile force = io $ do
48
48
+
'\8216' -> '`' -- ‘
49
49
+
'\8217' -> '`' -- ’
50
50
+
_ -> c
51
51
+
- compileGHC bin dir errHandle =
52
52
+
- runProcess "ghc" ["--make"
53
53
+
- , "xmonad.hs"
54
54
+
- , "-i"
55
55
+
- , "-ilib"
56
56
+
- , "-fforce-recomp"
57
57
+
- , "-main-is", "main"
58
58
+
- , "-v0"
59
59
+
- , "-o", bin
60
60
+
- ] (Just dir) Nothing Nothing Nothing (Just errHandle)
61
61
+
+ compileGHC ghc bin dir errHandle =
62
62
+
+ runProcess ghc ["--make"
63
63
+
+ , "xmonad.hs"
64
64
+
+ , "-i"
65
65
+
+ , "-ilib"
66
66
+
+ , "-fforce-recomp"
67
67
+
+ , "-main-is", "main"
68
68
+
+ , "-v0"
69
69
+
+ , "-o", bin
70
70
+
+ ] (Just dir) Nothing Nothing Nothing (Just errHandle)
71
71
+
compileScript bin dir script errHandle =
72
72
+
runProcess script [bin] (Just dir) Nothing Nothing Nothing (Just errHandle)
73
73
+