2014-12-12 01:53:25 +00:00
|
|
|
diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
|
2016-02-01 01:40:50 +00:00
|
|
|
index db8b12e..7b815c5 100644
|
2014-12-12 01:53:25 +00:00
|
|
|
--- a/src-bin/Boot.hs
|
|
|
|
+++ b/src-bin/Boot.hs
|
2017-08-11 21:14:01 +01:00
|
|
|
@@ -540,9 +540,7 @@ initPackageDB :: B ()
|
2014-12-12 01:53:25 +00:00
|
|
|
initPackageDB = do
|
|
|
|
msg info "creating package databases"
|
|
|
|
initDB "--global" <^> beLocations . blGlobalDB
|
|
|
|
- traverseOf_ _Just initUser <^> beLocations . blUserDBDir
|
|
|
|
where
|
|
|
|
- initUser dir = rm_f (dir </> "package.conf") >> initDB "--user" (dir </> "package.conf.d")
|
|
|
|
initDB dbName db = do
|
|
|
|
rm_rf db >> mkdir_p db
|
|
|
|
ghcjs_pkg_ ["init", toTextI db] `catchAny_` return ()
|
2017-08-11 21:14:01 +01:00
|
|
|
@@ -566,29 +564,22 @@ installDevelopmentTree = subTop $ do
|
2014-12-12 01:53:25 +00:00
|
|
|
msgD info $ "preparing development boot tree"
|
|
|
|
checkpoint' "ghcjs-boot-git" "ghcjs-boot repository already cloned and prepared" $ do
|
|
|
|
testGit "ghcjs-boot" >>= \case
|
|
|
|
- Just False -> failWith "ghcjs-boot already exists and is not a git repository"
|
|
|
|
- Just True -> do
|
|
|
|
- msg info "ghcjs-boot repository already exists but checkpoint not reached, cleaning first, then cloning"
|
|
|
|
- rm_rf "ghcjs-boot"
|
|
|
|
+ Just _ -> do
|
|
|
|
+ msg info "ghcjs-boot repository already exists; initializing ghcjs-boot"
|
|
|
|
initGhcjsBoot
|
|
|
|
Nothing -> do
|
|
|
|
msgD info "cloning ghcjs-boot git repository"
|
|
|
|
initGhcjsBoot
|
|
|
|
checkpoint' "shims-git" "shims repository already cloned" $ do
|
|
|
|
testGit "shims" >>= \case
|
|
|
|
- Just False -> failWith "shims already exists and is not a git repository"
|
|
|
|
- Just True -> do
|
|
|
|
- msgD info "shims repository already exists but checkpoint not reached, cleaning first, then cloning"
|
|
|
|
- rm_rf "shims"
|
|
|
|
- cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
|
|
|
|
+ Just _ -> do
|
|
|
|
+ msgD info "shims repository already exists; moving on"
|
|
|
|
Nothing -> do
|
|
|
|
msgD info "cloning shims git repository"
|
|
|
|
cloneGit shimsDescr "shims" bsrcShimsDevBranch bsrcShimsDev
|
|
|
|
where
|
|
|
|
initGhcjsBoot = sub $ do
|
|
|
|
- cloneGit bootDescr "ghcjs-boot" bsrcBootDevBranch bsrcBootDev
|
|
|
|
cd "ghcjs-boot"
|
|
|
|
- git_ ["submodule", "update", "--init", "--recursive"]
|
|
|
|
mapM_ patchPackage =<< allPackages
|
|
|
|
preparePrimops
|
|
|
|
buildGenPrim
|
2017-08-11 21:14:01 +01:00
|
|
|
@@ -1141,7 +1132,7 @@ cabalStage1 pkgs = sub $ do
|
|
|
|
globalFlags <- cabalGlobalFlags
|
|
|
|
flags <- cabalInstallFlags (length pkgs == 1)
|
|
|
|
let args = globalFlags ++ ("install" : pkgs) ++
|
|
|
|
- [ "--solver=topdown" -- the modular solver refuses to install stage1 packages
|
|
|
|
+ [ "--allow-boot-library-installs"
|
|
|
|
] ++ map ("--configure-option="<>) configureOpts ++ flags
|
|
|
|
checkInstallPlan pkgs args
|
|
|
|
cabal_ args
|
|
|
|
@@ -1162,7 +1153,7 @@ cabalInstall pkgs = do
|
|
|
|
-- uses somewhat fragile parsing of --dry-run output, find a better way
|
|
|
|
checkInstallPlan :: [Package] -> [Text] -> B ()
|
|
|
|
checkInstallPlan pkgs opts = do
|
|
|
|
- plan <- cabal (opts ++ ["-v2", "--dry-run"])
|
|
|
|
+ plan <- cabal (opts ++ ["-vverbose+nowrap", "--dry-run"])
|
|
|
|
when (hasReinstalls plan || hasUnexpectedInstalls plan || hasNewVersion plan) (err plan)
|
|
|
|
where
|
|
|
|
hasReinstalls = T.isInfixOf "(reinstall)" -- reject reinstalls
|
|
|
|
@@ -1201,14 +1192,14 @@ cabalInstallFlags parmakeGhcjs = do
|
2015-03-13 03:20:56 +00:00
|
|
|
, "--avoid-reinstalls"
|
2014-12-12 01:53:25 +00:00
|
|
|
, "--builddir", "dist"
|
|
|
|
, "--with-compiler", ghcjs ^. pgmLocText
|
2015-03-13 03:20:56 +00:00
|
|
|
+ , "--with-gcc", "@CC@"
|
2014-12-12 01:53:25 +00:00
|
|
|
, "--with-hc-pkg", ghcjsPkg ^. pgmLocText
|
|
|
|
- , "--prefix", toTextI instDir
|
|
|
|
+ , "--prefix", "@PREFIX@"
|
|
|
|
+ , "--libdir", "$prefix/lib/$compiler"
|
|
|
|
+ , "--libsubdir", "$pkgid"
|
|
|
|
, bool haddock "--enable-documentation" "--disable-documentation"
|
|
|
|
, "--haddock-html"
|
2016-02-01 01:40:50 +00:00
|
|
|
--- workaround for hoogle support being broken in haddock for GHC 7.10RC1
|
|
|
|
-#if !(__GLASGOW_HASKELL__ >= 709)
|
|
|
|
, "--haddock-hoogle"
|
|
|
|
-#endif
|
|
|
|
, "--haddock-hyperlink-source"
|
|
|
|
-- don't slow down Windows builds too much, on other platforms we get this more
|
|
|
|
-- or less for free, thanks to dynamic-too
|
2014-12-12 01:53:25 +00:00
|
|
|
diff --git a/src/Compiler/Info.hs b/src/Compiler/Info.hs
|
2016-02-01 01:40:50 +00:00
|
|
|
index 33a401f..e2405a7 100644
|
2014-12-12 01:53:25 +00:00
|
|
|
--- a/src/Compiler/Info.hs
|
|
|
|
+++ b/src/Compiler/Info.hs
|
2015-05-06 20:56:02 +01:00
|
|
|
@@ -48,13 +48,7 @@ compilerInfo nativeToo dflags = do
|
2016-02-01 01:40:50 +00:00
|
|
|
|
2014-12-12 01:53:25 +00:00
|
|
|
-- | the directory to use if started without -B flag
|
|
|
|
getDefaultTopDir :: IO FilePath
|
2015-05-06 20:56:02 +01:00
|
|
|
-getDefaultTopDir = do
|
2014-12-12 01:53:25 +00:00
|
|
|
- appdir <- getAppUserDataDirectory "ghcjs"
|
2015-05-06 20:56:02 +01:00
|
|
|
- return (appdir </> subdir </> "ghcjs")
|
|
|
|
- where
|
|
|
|
- targetARCH = arch
|
|
|
|
- targetOS = os
|
|
|
|
- subdir = targetARCH ++ '-':targetOS ++ '-':getFullCompilerVersion
|
|
|
|
+getDefaultTopDir = return "@PREFIX@/lib/ghcjs-@VERSION@"
|
2016-02-01 01:40:50 +00:00
|
|
|
|
2015-05-06 20:56:02 +01:00
|
|
|
getDefaultLibDir :: IO FilePath
|
|
|
|
getDefaultLibDir = getDefaultTopDir
|