diff options
| author | Nick Hu <me@nickhu.co.uk> | 2021-12-01 11:31:05 +0000 |
|---|---|---|
| committer | Nick Hu <me@nickhu.co.uk> | 2021-12-01 11:31:05 +0000 |
| commit | f6631c8559ae07bbe69f4b4f042ff8271a6c8a1b (patch) | |
| tree | 520298e59103d6b51d5b75e08eaf362ed8379db4 | |
| parent | direnv: 2.28.0 -> 2.29.0 (#147956) (diff) | |
| download | nixpkgs-f6631c8559ae07bbe69f4b4f042ff8271a6c8a1b.tar.gz | |
xmonad_0_17_0: add @ento's updated xmonad nix compatibility patchorigin/xmonad_0_17_0
This patch is
https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/patches/xmonad-nix.patch
updated for 0.17.0. It allows xmonad to find GHC (and xmessage), and
thus recompile itself.
| -rw-r--r-- | pkgs/development/haskell-modules/configuration-nix.nix | 1 | ||||
| -rw-r--r-- | pkgs/development/haskell-modules/patches/xmonad_0_17_0-nix.patch | 34 |
2 files changed, 35 insertions, 0 deletions
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix index 0dff5a18fa65..c427b2d7bb98 100644 --- a/pkgs/development/haskell-modules/configuration-nix.nix +++ b/pkgs/development/haskell-modules/configuration-nix.nix @@ -223,6 +223,7 @@ self: super: builtins.intersectAttrs super { # Nix-specific workaround xmonad = appendPatch ./patches/xmonad-nix.patch (dontCheck super.xmonad); + xmonad_0_17_0 = appendPatch ./patches/xmonad_0_17_0-nix.patch (super.xmonad_0_17_0); # wxc supports wxGTX >= 3.0, but our current default version points to 2.8. # http://hydra.cryp.to/build/1331287/log/raw diff --git a/pkgs/development/haskell-modules/patches/xmonad_0_17_0-nix.patch b/pkgs/development/haskell-modules/patches/xmonad_0_17_0-nix.patch new file mode 100644 index 000000000000..e313aed69063 --- /dev/null +++ b/pkgs/development/haskell-modules/patches/xmonad_0_17_0-nix.patch @@ -0,0 +1,34 @@ +diff --git a/src/XMonad/Core.hs b/src/XMonad/Core.hs +index 46a0939..92af53d 100644 +--- a/src/XMonad/Core.hs ++++ b/src/XMonad/Core.hs +@@ -46,6 +46,7 @@ import Data.Traversable (for) + import Data.Time.Clock (UTCTime) + import Data.Default.Class + import Data.List (isInfixOf) ++import System.Environment (lookupEnv) + import System.FilePath + import System.IO + import System.Info +@@ -458,7 +459,8 @@ xfork x = io . forkProcess . finally nullStdin $ do + -- | Use @xmessage@ to show information to the user. + xmessage :: MonadIO m => String -> m () + xmessage msg = void . xfork $ do +- executeFile "xmessage" True ++ xmessageBin <- fromMaybe "xmessage" <$> liftIO (lookupEnv "XMONAD_XMESSAGE") ++ executeFile xmessageBin True + [ "-default", "okay" + , "-xrm", "*international:true" + , "-xrm", "*fontSet:-*-fixed-medium-r-normal-*-18-*-*-*-*-*-*-*,-*-fixed-*-*-*-*-18-*-*-*-*-*-*-*,-*-*-*-*-*-*-18-*-*-*-*-*-*-*" +@@ -654,8 +656,9 @@ compile dirs method = + bracket (openFile (errFileName dirs) WriteMode) hClose $ \err -> do + let run = runProc (cfgDir dirs) err + case method of +- CompileGhc -> +- run "ghc" ghcArgs ++ CompileGhc -> do ++ ghc <- fromMaybe "ghc" <$> (lookupEnv "NIX_GHC") ++ run ghc ghcArgs + CompileStackGhc stackYaml -> + run "stack" ["build", "--silent", "--stack-yaml", stackYaml] .&&. + run "stack" ("ghc" : "--stack-yaml" : stackYaml : "--" : ghcArgs) |
