Commit 7e88be54 authored by Duncan Coutts's avatar Duncan Coutts

And don't use the old flag with new cabals

We generate both --constraint and --dependency flags, but we only need
to pass one or the other, depending on the Cabal version.
parent 9af2f517
......@@ -241,17 +241,17 @@ configureOptions = commandOptions configureCommand
filterConfigureFlags :: ConfigFlags -> Version -> ConfigFlags
filterConfigureFlags flags cabalLibVersion
| cabalLibVersion >= Version [1,18,0] [] = flags
| cabalLibVersion < Version [1,3,10] [] = flags_1_3_10
| cabalLibVersion < Version [1,10,0] [] = flags_1_10_0
| cabalLibVersion < Version [1,14,0] [] = flags_1_14_0
| cabalLibVersion < Version [1,18,0] [] = flags_1_18_0
| cabalLibVersion < Version [1,19,0] [] = flags_1_19_0
-- A no-op that silences the "pattern match is non-exhaustive" warning.
| otherwise = flags
| otherwise = flags_latest
where
-- Cabal < 1.19.0 does not grok the dependency flag.
-- Cabal >= 1.19.1 uses --dependency and does not need --constraint
flags_latest = flags { configConstraints = [] }
-- Cabal < 1.19.0 does not grok the --dependency flag.
flags_1_19_0 = flags { configDependencies = [] }
-- Cabal < 1.18.0 doesn't know about --extra-prog-path and --sysconfdir.
flags_1_18_0 = flags_1_19_0 { configProgramPathExtra = []
......@@ -261,7 +261,7 @@ filterConfigureFlags flags cabalLibVersion
flags_1_14_0 = flags_1_18_0 { configBenchmarks = NoFlag }
-- Cabal < 1.10.0 doesn't know about --disable-tests.
flags_1_10_0 = flags_1_14_0 { configTests = NoFlag }
-- Cabal < 1.3.10 does not grok the constraints flag.
-- Cabal < 1.3.10 does not grok the --constraints flag.
flags_1_3_10 = flags_1_10_0 { configConstraints = [] }
-- ------------------------------------------------------------
......
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