diff options
author | Daniel Gröber <dxld@darkboxed.org> | 2017-09-26 13:10:47 +0200 |
---|---|---|
committer | Daniel Gröber <dxld@darkboxed.org> | 2017-09-26 13:10:47 +0200 |
commit | 0fd3126df086eafb2b65900fdd91c158a25ce3da (patch) | |
tree | 3c741ad5d1a0cadaf98257f627c52c9cf5ccffae /CabalHelper | |
parent | 28c9f2567f965904449472bb014719c9eed6a20b (diff) |
Omit -j when calling Setup.hs for Cabal<1.20
Diffstat (limited to 'CabalHelper')
-rw-r--r-- | CabalHelper/Compiletime/Compile.hs | 25 |
1 files changed, 18 insertions, 7 deletions
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" ] |