Commit eec6cbdf authored by Daniel Gröber (dxld)'s avatar Daniel Gröber (dxld)

Filter $libexecsubdir when talking to Cabal<1.25

parent 2d8c4ee6
......@@ -38,6 +38,7 @@ module Distribution.Simple.InstallDirs (
PathTemplateEnv,
toPathTemplate,
fromPathTemplate,
combinePathTemplate,
substPathTemplate,
initialPathTemplateEnv,
platformTemplateEnv,
......
......@@ -72,6 +72,7 @@ module Distribution.Simple.Setup (
fromFlagOrDefault,
flagToMaybe,
flagToList,
maybeToFlag,
BooleanFlag(..),
boolOpt, boolOpt', trueArg, falseArg,
optionVerbosity, optionNumJobs, readPToMaybe ) where
......@@ -186,6 +187,10 @@ allFlags flags = if all (\f -> fromFlagOrDefault False f) flags
then Flag True
else NoFlag
maybeToFlag :: Maybe a -> Flag a
maybeToFlag Nothing = NoFlag
maybeToFlag (Just x) = Flag x
-- | Types that represent boolean flags.
class BooleanFlag a where
asBool :: a -> Bool
......
......@@ -89,13 +89,13 @@ import Distribution.Simple.Setup
, TestFlags(..), BenchmarkFlags(..)
, SDistFlags(..), HaddockFlags(..)
, readPackageDbList, showPackageDbList
, Flag(..), toFlag, flagToMaybe, flagToList
, Flag(..), toFlag, flagToMaybe, flagToList, maybeToFlag
, BooleanFlag(..), optionVerbosity
, boolOpt, boolOpt', trueArg, falseArg
, optionNumJobs )
import Distribution.Simple.InstallDirs
( PathTemplate, InstallDirs(dynlibdir, sysconfdir)
, toPathTemplate, fromPathTemplate )
( PathTemplate, InstallDirs(..)
, toPathTemplate, fromPathTemplate, combinePathTemplate )
import Distribution.Version
( Version, mkVersion, nullVersion, anyVersion, thisVersion )
import Distribution.Package
......@@ -429,8 +429,13 @@ filterConfigureFlags flags cabalLibVersion
-- Cabal < 1.25 doesn't support --deterministic
configDeterministic = mempty
}
configInstallDirs_1_25_0 = (configInstallDirs flags) { dynlibdir = NoFlag }
configInstallDirs_1_25_0 = let dirs = configInstallDirs flags in
dirs { dynlibdir = NoFlag
, libexecsubdir = NoFlag
, libexecdir = maybeToFlag $
combinePathTemplate <$> flagToMaybe (libexecdir dirs)
<*> flagToMaybe (libexecsubdir dirs)
}
-- Cabal < 1.23 doesn't know about '--profiling-detail'.
-- Cabal < 1.23 has a hacked up version of 'enable-profiling'
-- which we shouldn't use.
......
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