diff --git a/Distribution/Simple/Configure.hs b/Distribution/Simple/Configure.hs index c15847a59bd4cf7a346e376abe150f4f54f26420..7d386748eee894d5238b1a55847369edf852147b 100644 --- a/Distribution/Simple/Configure.hs +++ b/Distribution/Simple/Configure.hs @@ -100,8 +100,8 @@ import Distribution.Simple.Setup import Distribution.Simple.InstallDirs ( InstallDirs(..), defaultInstallDirs, combineInstallDirs ) import Distribution.Simple.LocalBuildInfo - ( LocalBuildInfo(..), absoluteInstallDirs - , prefixRelativeInstallDirs ) + ( LocalBuildInfo(..), ComponentLocalBuildInfo(..) + , absoluteInstallDirs, prefixRelativeInstallDirs ) import Distribution.Simple.Utils ( die, warn, info, setupMessage, createDirectoryIfMissingVerbose , intercalate, comparing, cabalVersion, cabalBootstrapping @@ -416,6 +416,10 @@ configure (pkg_descr0, pbi) cfg (distPref </> "scratch") (configScratchDir cfg), packageDeps = dep_pkgs, + libraryConfig = (\_ -> ComponentLocalBuildInfo dep_pkgs) + `fmap` library pkg_descr', + executableConfigs = (\exe -> (exeName exe, ComponentLocalBuildInfo dep_pkgs)) + `fmap` executables pkg_descr', installedPkgs = packageDependsIndex, pkgDescrFile = Nothing, localPkgDescr = pkg_descr', diff --git a/Distribution/Simple/LocalBuildInfo.hs b/Distribution/Simple/LocalBuildInfo.hs index 20693842e6db6b2ab5e0dcab9488e5bb638dd773..b434352e32bf796e692d7a5bb3a985105f7382b5 100644 --- a/Distribution/Simple/LocalBuildInfo.hs +++ b/Distribution/Simple/LocalBuildInfo.hs @@ -46,6 +46,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -} module Distribution.Simple.LocalBuildInfo ( LocalBuildInfo(..), + ComponentLocalBuildInfo(..), -- * Installation directories module Distribution.Simple.InstallDirs, absoluteInstallDirs, prefixRelativeInstallDirs, @@ -78,13 +79,17 @@ data LocalBuildInfo = LocalBuildInfo { -- ^ Where to build the package. scratchDir :: FilePath, -- ^ Where to put the result of the Hugs build. + --TODO: eliminate packageDeps field packageDeps :: [PackageIdentifier], - -- ^ Which packages we depend on, /exactly/. + -- ^ External package dependencies for the package as a whole, + -- the union of the individual 'targetPackageDeps'. -- The 'Distribution.PackageDescription.PackageDescription' -- specifies a set of build dependencies -- that must be satisfied in terms of version ranges. This -- field fixes those dependencies to the specific versions -- available on this machine for this compiler. + libraryConfig :: Maybe ComponentLocalBuildInfo, + executableConfigs :: [(String, ComponentLocalBuildInfo)], installedPkgs :: PackageIndex InstalledPackageInfo, -- ^ All the info about all installed packages. pkgDescrFile :: Maybe FilePath, @@ -104,7 +109,10 @@ data LocalBuildInfo = LocalBuildInfo { stripExes :: Bool, -- ^Whether to strip executables during install progPrefix :: PathTemplate, -- ^Prefix to be prepended to installed executables progSuffix :: PathTemplate -- ^Suffix to be appended to installed executables + } deriving (Read, Show) +data ComponentLocalBuildInfo = ComponentLocalBuildInfo { + componentPackageDeps :: [PackageIdentifier] } deriving (Read, Show) -- -----------------------------------------------------------------------------