From 0fd3126df086eafb2b65900fdd91c158a25ce3da Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Tue, 26 Sep 2017 13:10:47 +0200 Subject: Omit -j when calling Setup.hs for Cabal<1.20 --- CabalHelper/Compiletime/Compile.hs | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'CabalHelper/Compiletime/Compile.hs') diff --git a/CabalHelper/Compiletime/Compile.hs b/CabalHelper/Compiletime/Compile.hs index 409239f..6ea2676 100644 --- a/CabalHelper/Compiletime/Compile.hs +++ b/CabalHelper/Compiletime/Compile.hs @@ -294,7 +294,7 @@ installCabal opts ever = do db <- createPkgDb opts e_commit_ver - runCabalInstall opts db srcdir + runCabalInstall opts db srcdir ever return (db, e_commit_ver) @@ -311,8 +311,9 @@ Otherwise we might be able to use the shipped Setup.hs -} -runCabalInstall :: Options -> PackageDbDir -> CabalSourceDir -> IO () -runCabalInstall opts (PackageDbDir db) (CabalSourceDir srcdir) = do +runCabalInstall + :: Options -> PackageDbDir -> CabalSourceDir -> Either HEAD Version-> IO () +runCabalInstall opts (PackageDbDir db) (CabalSourceDir srcdir) ever = do cabalInstallVer <- cabalInstallVersion opts cabal_opts <- return $ concat [ @@ -335,7 +336,7 @@ runCabalInstall opts (PackageDbDir db) (CabalSourceDir srcdir) = do callProcessStderr opts (Just "/") (cabalProgram opts) cabal_opts setupProgram <- compileSetupHs opts db srcdir - runSetupHs opts setupProgram db srcdir + runSetupHs opts setupProgram db srcdir ever hPutStrLn stderr "done" @@ -347,11 +348,21 @@ cabalOptions opts = else [] ] -runSetupHs :: Options -> SetupProgram -> FilePath -> FilePath -> IO () -runSetupHs opts SetupProgram {..} db srcdir = do +runSetupHs + :: Options + -> SetupProgram + -> FilePath + -> FilePath + -> Either HEAD Version + -> IO () +runSetupHs opts SetupProgram {..} db srcdir ever = do let run = callProcessStderr opts (Just srcdir) setupProgram + parmake_opt + | Right ver <- ever, ver >= Version [1,20] [] = ["-j"] + | otherwise = [] + run $ [ "configure", "--package-db", db, "--prefix", db "prefix" ] ++ cabalOptions opts - run [ "build", "-j" ] + run $ [ "build" ] ++ parmake_opt run [ "copy" ] run [ "register" ] -- cgit v1.2.3