Move the register-inplace special-case stuff into the ghc-prim package
[ghc-hetmet.git] / libraries / installPackage.hs
index 3ab4f7e..00560a7 100644 (file)
@@ -11,13 +11,14 @@ import Distribution.Simple.Utils
 import Distribution.Verbosity
 import System.Environment
 
+-- XXX This will need to be changed
+distPref :: FilePath
+distPref = defaultDistPref
+
 main :: IO ()
 main
   = do args <- getArgs
        case args of
-           "register" : "--inplace" :args' ->
-               let verbosity = mkVerbosity args'
-               in doRegisterInplace verbosity
            "install" : ghcpkg : ghcpkgconf : destdir : topdir :
                     iprefix : ibindir : ilibdir : ilibexecdir : idynlibdir :
                     idatadir : idocdir : ihtmldir : ihaddockdir :
@@ -34,23 +35,6 @@ mkVerbosity [] = normal
 mkVerbosity ['-':'v':v] = readEOrFail flagToVerbosity v
 mkVerbosity args = error ("Bad arguments: " ++ show args)
 
-doRegisterInplace :: Verbosity -> IO ()
-doRegisterInplace verbosity =
-       do lbi <- getConfig verbosity
-          let registerFlags = defaultRegisterFlags { regInPlace = toFlag True }
-              pd = localPkgDescr lbi
-              pd_reg = if pkgName (package pd) == "ghc-prim"
-                       then case library pd of
-                            Just lib ->
-                                let ems = "GHC.Prim" : exposedModules lib
-                                    lib' = lib { exposedModules = ems }
-                                in pd { library = Just lib' }
-                            Nothing ->
-                                error "Expected a library, but none found"
-                       else pd
-          (regHook simpleUserHooks) pd_reg lbi simpleUserHooks registerFlags
-          return ()
-
 doInstall :: Verbosity -> FilePath -> FilePath -> FilePath -> FilePath
           -> FilePath -> FilePath -> FilePath -> FilePath -> FilePath
           -> FilePath -> FilePath -> FilePath -> FilePath
@@ -136,7 +120,7 @@ replaceTopdir _ p = p
 -- Get the build info, merging the setup-config and buildinfo files.
 getConfig :: Verbosity -> IO LocalBuildInfo
 getConfig verbosity = do
-    lbi <- getPersistBuildConfig
+    lbi <- getPersistBuildConfig distPref
     maybe_infoFile <- defaultHookedPackageDesc
     case maybe_infoFile of
         Nothing -> return lbi