Abstract over make
So on FreeBSD we get gmake.
This commit is contained in:
parent
fee16758de
commit
c0c70f5c9b
20
lib/GHCup.hs
20
lib/GHCup.hs
@ -140,12 +140,7 @@ installGHCBin bDls ver mpfReq = do
|
|||||||
[rel|ghc-configure.log|]
|
[rel|ghc-configure.log|]
|
||||||
(Just path)
|
(Just path)
|
||||||
Nothing
|
Nothing
|
||||||
lEM $ liftIO $ execLogged [s|make|]
|
lEM $ liftIO $ make [[s|install|]] (Just path)
|
||||||
True
|
|
||||||
[[s|install|]]
|
|
||||||
[rel|ghc-make.log|]
|
|
||||||
(Just path)
|
|
||||||
Nothing
|
|
||||||
pure ()
|
pure ()
|
||||||
|
|
||||||
|
|
||||||
@ -541,20 +536,11 @@ GhcWithLlvmCodeGen = YES|]
|
|||||||
lift
|
lift
|
||||||
$ $(logInfo)
|
$ $(logInfo)
|
||||||
[i|Building (this may take a while)... Run 'tail -f ~/.ghcup/logs/ghc-make.log' to see the progress.|]
|
[i|Building (this may take a while)... Run 'tail -f ~/.ghcup/logs/ghc-make.log' to see the progress.|]
|
||||||
lEM $ liftIO $ execLogged [s|make|]
|
lEM $ liftIO $ make (maybe [] (\j -> [[s|-j|] <> fS (show j)]) jobs)
|
||||||
True
|
|
||||||
(maybe [] (\j -> [[s|-j|] <> fS (show j)]) jobs)
|
|
||||||
[rel|ghc-make.log|]
|
|
||||||
(Just workdir)
|
(Just workdir)
|
||||||
Nothing
|
|
||||||
|
|
||||||
lift $ $(logInfo) [i|Installing...|]
|
lift $ $(logInfo) [i|Installing...|]
|
||||||
lEM $ liftIO $ execLogged [s|make|]
|
lEM $ liftIO $ make [[s|install|]] (Just workdir)
|
||||||
True
|
|
||||||
[[s|install|]]
|
|
||||||
[rel|ghc-make.log|]
|
|
||||||
(Just workdir)
|
|
||||||
Nothing
|
|
||||||
|
|
||||||
markSrcBuilt ghcdir workdir = do
|
markSrcBuilt ghcdir workdir = do
|
||||||
let dest = (ghcdir </> ghcUpSrcBuiltFile)
|
let dest = (ghcdir </> ghcUpSrcBuiltFile)
|
||||||
|
@ -44,7 +44,7 @@ import Prelude hiding ( abs
|
|||||||
)
|
)
|
||||||
import Safe
|
import Safe
|
||||||
import System.IO.Error
|
import System.IO.Error
|
||||||
import System.Posix.FilePath ( takeFileName )
|
import System.Posix.FilePath ( getSearchPath, takeFileName )
|
||||||
import System.Posix.Files.ByteString ( readSymbolicLink )
|
import System.Posix.Files.ByteString ( readSymbolicLink )
|
||||||
import URI.ByteString
|
import URI.ByteString
|
||||||
|
|
||||||
@ -325,3 +325,12 @@ ghcToolFiles ver = do
|
|||||||
-- this GHC was built from source. It contains the build config.
|
-- this GHC was built from source. It contains the build config.
|
||||||
ghcUpSrcBuiltFile :: Path Rel
|
ghcUpSrcBuiltFile :: Path Rel
|
||||||
ghcUpSrcBuiltFile = [rel|.ghcup_src_built|]
|
ghcUpSrcBuiltFile = [rel|.ghcup_src_built|]
|
||||||
|
|
||||||
|
|
||||||
|
-- | Calls gmake if it exists in PATH, otherwise make.
|
||||||
|
make :: [ByteString] -> Maybe (Path Abs) -> IO (Either ProcessError ())
|
||||||
|
make args workdir = do
|
||||||
|
spaths <- catMaybes . fmap parseAbs <$> getSearchPath
|
||||||
|
has_gmake <- isJust <$> searchPath spaths [rel|gmake|]
|
||||||
|
let mymake = if has_gmake then [s|gmake|] else [s|make|]
|
||||||
|
execLogged mymake True args [rel|ghc-make.log|] workdir Nothing
|
||||||
|
Loading…
Reference in New Issue
Block a user