about summary refs log tree commit diff
path: root/pkgs/development/haskell-modules/patches
diff options
context:
space:
mode:
authorNick Hu <me@nickhu.co.uk>2021-12-01 11:31:05 +0000
committersternenseemann <sternenseemann@systemli.org>2021-12-01 18:25:28 +0100
commit36d5761b3e5aca9742fec85107e3d308a9af872c (patch)
tree6076e0bb6d9b931e9c60b5dee5d52291f0c0f906 /pkgs/development/haskell-modules/patches
parentc85d141221eb60226c213519367752db83425b09 (diff)
haskellPackages.xmonad_0_17_0: respect NIX_GHC and XMONAD_XMESSAGE
Adds xmonad-nix.patch adjusted for xmonad 0.17.0.

Originally posted here: https://discourse.nixos.org/t/use-latest-version-of-xmonad-0-17-0/16191/5

Co-Authored-By: ento <ping@stillspinning.cc>
Co-Authored-By: sternenseemann <sternenseemann@systemli.org>
Diffstat (limited to 'pkgs/development/haskell-modules/patches')
-rw-r--r--pkgs/development/haskell-modules/patches/xmonad_0_17_0-nix.patch34
1 files changed, 34 insertions, 0 deletions
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 0000000000000..e313aed69063a
--- /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)