Commit c0b63100 authored by John Ericson's avatar John Ericson
Browse files

Add "build-tool-depends" field to `BuildInfo` and parse it (with caveat)

A lack of ":exename" is susposed to indicate all exe components of the package,
but this complicates parsing so I'm punting for now: an explicit component name
is required.
parent d692561f
......@@ -418,6 +418,9 @@ binfoFieldDescrs =
, commaListField "build-tools"
disp parse
buildTools (\xs binfo -> binfo{buildTools=xs})
, commaListField "build-tool-depends"
disp parse
toolDepends (\xs binfo -> binfo{toolDepends=xs})
, commaListFieldWithSep vcat "build-depends"
disp parse
targetBuildDepends (\xs binfo -> binfo{targetBuildDepends=xs})
......
......@@ -423,6 +423,9 @@ binfoFieldDescrs =
, commaListField "build-tools"
disp parsec
buildTools (\xs binfo -> binfo{buildTools=xs})
, commaListField "build-tool-depends"
disp parsec
toolDepends (\xs binfo -> binfo{toolDepends=xs})
, commaListFieldWithSep vcat "build-depends"
disp parsec
targetBuildDepends (\xs binfo -> binfo{targetBuildDepends=xs})
......
......@@ -19,6 +19,7 @@ import Distribution.Compat.Prelude
import Distribution.Types.Mixin
import Distribution.Types.Dependency
import Distribution.Types.ExeDependency
import Distribution.Types.LegacyExeDependency
import Distribution.Types.PkgconfigDependency
......@@ -30,6 +31,7 @@ import Language.Haskell.Extension
data BuildInfo = BuildInfo {
buildable :: Bool, -- ^ component is buildable here
buildTools :: [LegacyExeDependency], -- ^ tools needed to build this bit
toolDepends :: [ExeDependency], -- ^ haskell tools needed to build this bit
cppOptions :: [String], -- ^ options for pre-processing Haskell code
ccOptions :: [String], -- ^ options for C compiler
ldOptions :: [String], -- ^ options for linker
......@@ -71,6 +73,7 @@ instance Monoid BuildInfo where
mempty = BuildInfo {
buildable = True,
buildTools = [],
toolDepends = [],
cppOptions = [],
ccOptions = [],
ldOptions = [],
......@@ -106,6 +109,7 @@ instance Semigroup BuildInfo where
a <> b = BuildInfo {
buildable = buildable a && buildable b,
buildTools = combine buildTools,
toolDepends = combine toolDepends,
cppOptions = combine cppOptions,
ccOptions = combine ccOptions,
ldOptions = combine ldOptions,
......
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