summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortim.thelion <tim.thelion@gmail.com>2007-12-18 07:51:46 +0100
committertim.thelion <tim.thelion@gmail.com>2007-12-18 07:51:46 +0100
commitaa3bcc30d837719840064a1ed0972929c2bcde50 (patch)
treef65c89772d16a2c7d0b32a433b329f8f58b54d70
parent77c511849ea79cf39d202388482ec130acee64f7 (diff)
downloadmetatile-aa3bcc30d837719840064a1ed0972929c2bcde50.tar
metatile-aa3bcc30d837719840064a1ed0972929c2bcde50.zip
Allow for sharing of home directory across architectures.
darcs-hash:20071218065146-c18d4-533b073367884fbd9212fc547ce9e4e558a21bc9
-rw-r--r--Main.hs3
-rw-r--r--XMonad/Core.hs11
2 files changed, 9 insertions, 5 deletions
diff --git a/Main.hs b/Main.hs
index e169ff1..a38f697 100644
--- a/Main.hs
+++ b/Main.hs
@@ -18,6 +18,7 @@ import XMonad
import Control.Exception (handle)
import System.IO
+import System.Info
import System.Environment
import System.Posix.Process (executeFile)
@@ -43,5 +44,5 @@ buildLaunch = do
recompile False
dir <- getXMonadDir
args <- getArgs
- executeFile (dir ++ "/xmonad") False args Nothing
+ executeFile (dir ++ "/xmonad-"++arch++"-"++os) False args Nothing
return ()
diff --git a/XMonad/Core.hs b/XMonad/Core.hs
index 3933022..cc39b94 100644
--- a/XMonad/Core.hs
+++ b/XMonad/Core.hs
@@ -38,6 +38,7 @@ import Control.Applicative
import Control.Monad.State
import Control.Monad.Reader
import System.IO
+import System.Info
import System.Posix.Process (executeFile, forkProcess, getProcessStatus, createSession)
import System.Process
import System.Directory
@@ -355,14 +356,16 @@ getXMonadDir = io $ getAppUserDataDirectory "xmonad"
recompile :: MonadIO m => Bool -> m ()
recompile force = io $ do
dir <- getXMonadDir
- let bin = dir ++ "/" ++ "xmonad"
- err = bin ++ ".errors"
- src = bin ++ ".hs"
+ let binn = "xmonad-"++arch++"-"++os
+ bin = dir ++ "/" ++ binn
+ base = dir ++ "/" ++ "xmonad"
+ err = base ++ ".errors"
+ src = base ++ ".hs"
srcT <- getModTime src
binT <- getModTime bin
when (force || srcT > binT) $ do
status <- bracket (openFile err WriteMode) hClose $ \h -> do
- waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0"] (Just dir)
+ waitForProcess =<< runProcess "ghc" ["--make", "xmonad.hs", "-i", "-no-recomp", "-v0", "-o",binn] (Just dir)
Nothing Nothing Nothing (Just h)
-- now, if it fails, run xmessage to let the user know: