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
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',
......
......@@ -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)
-- -----------------------------------------------------------------------------
......
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