Commit ae8c28f8 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add new ComponentLocalBuildInfo

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