Commit 5fccc856 authored by judah.jacobson@gmail.com's avatar judah.jacobson@gmail.com
Browse files

Make installPackage install settings from the [package].buildinfo file.

M ./libraries/installPackage.hs -1 +14
parent 1f86a261
...@@ -5,6 +5,7 @@ import Distribution.Simple.Configure ...@@ -5,6 +5,7 @@ import Distribution.Simple.Configure
import Distribution.Simple.LocalBuildInfo import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Program import Distribution.Simple.Program
import Distribution.Simple.Setup import Distribution.Simple.Setup
import Distribution.Simple.Utils
import Distribution.Verbosity import Distribution.Verbosity
import System.Environment import System.Environment
...@@ -41,7 +42,7 @@ doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity = ...@@ -41,7 +42,7 @@ doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity =
regGenScript = False, regGenScript = False,
regInPlace = False regInPlace = False
} }
lbi <- getPersistBuildConfig lbi <- getConfig verbosity
let pd = localPkgDescr lbi let pd = localPkgDescr lbi
i = installDirTemplates lbi i = installDirTemplates lbi
-- XXX This is an almighty hack, shadowing the base -- XXX This is an almighty hack, shadowing the base
...@@ -84,3 +85,15 @@ doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity = ...@@ -84,3 +85,15 @@ doit destdir pref idatadir idocdir ghcpkg ghcpkgconf verbosity =
(regHook simpleUserHooks) pd_reg lbi_reg userHooks registerFlags (regHook simpleUserHooks) pd_reg lbi_reg userHooks registerFlags
return () return ()
-- Get the build info, merging the setup-config and buildinfo files.
getConfig :: Verbosity -> IO LocalBuildInfo
getConfig verbosity = do
lbi <- getPersistBuildConfig
maybe_infoFile <- defaultHookedPackageDesc
case maybe_infoFile of
Nothing -> return lbi
Just infoFile -> do
hbi <- readHookedBuildInfo verbosity infoFile
return lbi { localPkgDescr = updatePackageDescription hbi (localPkgDescr lbi)}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment