nixpkgs-suyu/pkgs/development/tools/haskell/ghcjs/ghcjs.patch

73 lines
3.1 KiB
Diff
Raw Normal View History

2014-12-12 02:53:25 +01:00
diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
index ed348db..b102695 100644
--- a/src-bin/Boot.hs
+++ b/src-bin/Boot.hs
@@ -510,9 +510,7 @@ initPackageDB :: B ()
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 ()
@@ -536,29 +534,22 @@ installDevelopmentTree = subTop $ do
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
@@ -1093,7 +1084,9 @@ cabalInstallFlags parmakeGhcjs = do
, "--builddir", "dist"
, "--with-compiler", ghcjs ^. pgmLocText
, "--with-hc-pkg", ghcjsPkg ^. pgmLocText
- , "--prefix", toTextI instDir
+ , "--prefix", "@PREFIX@"
+ , "--libdir", "$prefix/lib/$compiler"
+ , "--libsubdir", "$pkgid"
, bool haddock "--enable-documentation" "--disable-documentation"
, "--haddock-html"
, "--haddock-hoogle"
diff --git a/src/Compiler/Info.hs b/src/Compiler/Info.hs
index 2e19849..4c9e94d 100644
--- a/src/Compiler/Info.hs
+++ b/src/Compiler/Info.hs
@@ -48,7 +48,7 @@ compilerInfo nativeToo dflags = do
-- | the directory to use if started without -B flag
getDefaultTopDir :: IO FilePath
getDefaultTopDir = do
- appdir <- getAppUserDataDirectory "ghcjs"
+ let appdir = "@PREFIX@/share/ghcjs"
return (appdir </> subdir </> "ghcjs")
where
targetARCH = arch