Commit 6b858a1b authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Add flags to build command for specifying program paths

So we're going to allow --with-PROG for the build and haddock
commands, in addition to the existing --PROG-options= flags.
parent a037bb48
...@@ -1148,6 +1148,7 @@ instance Monoid CleanFlags where ...@@ -1148,6 +1148,7 @@ instance Monoid CleanFlags where
-- ------------------------------------------------------------ -- ------------------------------------------------------------
data BuildFlags = BuildFlags { data BuildFlags = BuildFlags {
buildProgramPaths :: [(String, FilePath)],
buildProgramArgs :: [(String, [String])], buildProgramArgs :: [(String, [String])],
buildDistPref :: Flag FilePath, buildDistPref :: Flag FilePath,
buildVerbosity :: Flag Verbosity buildVerbosity :: Flag Verbosity
...@@ -1156,6 +1157,7 @@ data BuildFlags = BuildFlags { ...@@ -1156,6 +1157,7 @@ data BuildFlags = BuildFlags {
defaultBuildFlags :: BuildFlags defaultBuildFlags :: BuildFlags
defaultBuildFlags = BuildFlags { defaultBuildFlags = BuildFlags {
buildProgramPaths = mempty,
buildProgramArgs = [], buildProgramArgs = [],
buildDistPref = Flag defaultDistPref, buildDistPref = Flag defaultDistPref,
buildVerbosity = Flag normal buildVerbosity = Flag normal
...@@ -1173,7 +1175,10 @@ buildCommand progConf = makeCommand name shortDesc longDesc defaultBuildFlags op ...@@ -1173,7 +1175,10 @@ buildCommand progConf = makeCommand name shortDesc longDesc defaultBuildFlags op
buildDistPref (\d flags -> flags { buildDistPref = d }) buildDistPref (\d flags -> flags { buildDistPref = d })
showOrParseArgs showOrParseArgs
: programConfigurationOptions progConf showOrParseArgs : programConfigurationPaths progConf showOrParseArgs
buildProgramPaths (\v flags -> flags { buildProgramPaths = v})
++ programConfigurationOptions progConf showOrParseArgs
buildProgramArgs (\v flags -> flags { buildProgramArgs = v}) buildProgramArgs (\v flags -> flags { buildProgramArgs = v})
emptyBuildFlags :: BuildFlags emptyBuildFlags :: BuildFlags
...@@ -1181,11 +1186,13 @@ emptyBuildFlags = mempty ...@@ -1181,11 +1186,13 @@ emptyBuildFlags = mempty
instance Monoid BuildFlags where instance Monoid BuildFlags where
mempty = BuildFlags { mempty = BuildFlags {
buildProgramPaths = mempty,
buildProgramArgs = mempty, buildProgramArgs = mempty,
buildVerbosity = mempty, buildVerbosity = mempty,
buildDistPref = mempty buildDistPref = mempty
} }
mappend a b = BuildFlags { mappend a b = BuildFlags {
buildProgramPaths = combine buildProgramPaths,
buildProgramArgs = combine buildProgramArgs, buildProgramArgs = combine buildProgramArgs,
buildVerbosity = combine buildVerbosity, buildVerbosity = combine buildVerbosity,
buildDistPref = combine buildDistPref buildDistPref = combine buildDistPref
......
Supports Markdown
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