haskellPackages.xmonad: use appropriate patch for >= 0.17

We already had a xmonad-nix.patch for XMonad 0.17, so it's just a matter
of using it. The old patch for 0.16 can be dropped as well, since we no
longer ship that version.
This commit is contained in:
sternenseemann 2022-02-20 22:41:18 +01:00
parent 97ad10cfcc
commit dd0c4562f9
2 changed files with 1 additions and 85 deletions

View File

@ -212,18 +212,7 @@ self: super: builtins.intersectAttrs super {
}) super.tz;
# Nix-specific workaround
xmonad = appendPatch ./patches/xmonad-nix.patch (dontCheck super.xmonad);
xmonad_0_17_0 = doDistribute (appendPatch ./patches/xmonad_0_17_0-nix.patch (super.xmonad_0_17_0));
# Need matching xmonad version
xmonad-contrib_0_17_0 = doDistribute (super.xmonad-contrib_0_17_0.override {
xmonad = self.xmonad_0_17_0;
});
xmonad-extras_0_17_0 = doDistribute (super.xmonad-extras_0_17_0.override {
xmonad = self.xmonad_0_17_0;
xmonad-contrib = self.xmonad-contrib_0_17_0;
});
xmonad = appendPatch ./patches/xmonad_0_17_0-nix.patch (dontCheck super.xmonad);
# wxc supports wxGTX >= 3.0, but our current default version points to 2.8.
# http://hydra.cryp.to/build/1331287/log/raw

View File

@ -1,73 +0,0 @@
diff --git a/src/XMonad/Core.hs b/src/XMonad/Core.hs
index 7810522..3262934 100644
--- a/src/XMonad/Core.hs
+++ b/src/XMonad/Core.hs
@@ -53,6 +53,7 @@ import System.Posix.Types (ProcessID)
import System.Process
import System.Directory
import System.Exit
+import System.Environment (lookupEnv)
import Graphics.X11.Xlib
import Graphics.X11.Xlib.Extras (getWindowAttributes, WindowAttributes, Event)
import Data.Typeable
@@ -601,6 +602,7 @@ recompile force = io $ do
lib = cfgdir </> "lib"
buildscript = cfgdir </> "build"
+ ghc <- fromMaybe "ghc" <$> liftIO (lookupEnv "NIX_GHC")
libTs <- mapM getModTime . Prelude.filter isSource =<< allFiles lib
srcT <- getModTime src
binT <- getModTime bin
@@ -643,7 +645,7 @@ recompile force = io $ do
status <- bracket (openFile err WriteMode) hClose $ \errHandle ->
waitForProcess =<< if useBuildscript
then compileScript bin cfgdir buildscript errHandle
- else compileGHC bin cfgdir errHandle
+ else compileGHC ghc bin cfgdir errHandle
-- re-enable SIGCHLD:
installSignalHandlers
@@ -653,6 +655,7 @@ recompile force = io $ do
then trace "XMonad recompilation process exited with success!"
else 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)
@@ -660,7 +663,7 @@ recompile force = io $ do
-- nb, the ordering of printing, then forking, is crucial due to
-- lazy evaluation
hPutStrLn stderr msg
- forkProcess $ executeFile "xmessage" True ["-default", "okay", replaceUnicode msg] Nothing
+ forkProcess $ executeFile xmessage True ["-default", "okay", replaceUnicode msg] Nothing
return ()
return (status == ExitSuccess)
else return True
@@ -678,16 +681,16 @@ recompile force = io $ do
'\8216' -> '`' --
'\8217' -> '`' --
_ -> c
- compileGHC bin dir errHandle =
- runProcess "ghc" ["--make"
- , "xmonad.hs"
- , "-i"
- , "-ilib"
- , "-fforce-recomp"
- , "-main-is", "main"
- , "-v0"
- , "-o", bin
- ] (Just dir) Nothing Nothing Nothing (Just errHandle)
+ compileGHC ghc bin dir errHandle =
+ runProcess ghc ["--make"
+ , "xmonad.hs"
+ , "-i"
+ , "-ilib"
+ , "-fforce-recomp"
+ , "-main-is", "main"
+ , "-v0"
+ , "-o", bin
+ ] (Just dir) Nothing Nothing Nothing (Just errHandle)
compileScript bin dir script errHandle =
runProcess script [bin] (Just dir) Nothing Nothing Nothing (Just errHandle)