summary refs log tree commit diff
path: root/pkgs/development/compilers/ghcjs/ghcjs.patch
blob: 618656f787ce0df9a81aa7bdbffe0672778facf4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
diff --git a/src-bin/Boot.hs b/src-bin/Boot.hs
index 3c68dcf..64f3cf7 100644
--- a/src-bin/Boot.hs
+++ b/src-bin/Boot.hs
@@ -512,9 +512,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 ()
@@ -538,29 +536,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
@@ -1085,8 +1076,11 @@ cabalInstallFlags parmakeGhcjs = do
            , "--avoid-reinstalls"
            , "--builddir",      "dist"
            , "--with-compiler", ghcjs ^. pgmLocText
+           , "--with-gcc",      "@CC@"
            , "--with-hc-pkg",   ghcjsPkg ^. pgmLocText
-           , "--prefix",        toTextI instDir
+           , "--prefix",        "@PREFIX@"
+           , "--libdir",        "$prefix/lib/$compiler"
+           , "--libsubdir",     "$pkgid"
            , bool haddock "--enable-documentation" "--disable-documentation"
            , "--haddock-html"
 -- workaround for hoogle support being broken in haddock for GHC 7.10RC1
diff --git a/src/Compiler/Info.hs b/src/Compiler/Info.hs
index 33a401f..5d09c86 100644
--- a/src/Compiler/Info.hs
+++ b/src/Compiler/Info.hs
@@ -49,7 +49,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