Commit f2b9b3f8 authored by Ben Gamari's avatar Ben Gamari 🐢

ci: Introduce --cabal-option flag

parent 2e98fcb4
......@@ -48,6 +48,7 @@ import Utils
data Config = Config { configPatchDir :: FilePath
, configCompiler :: FilePath
, configGhcOptions :: [String]
, configCabalOptions :: [String]
, configOnlyPackages :: Maybe (S.Set Cabal.PackageName)
, configConcurrency :: Int
, configExtraCabalFragments :: [FilePath]
......@@ -55,6 +56,7 @@ data Config = Config { configPatchDir :: FilePath
cabalOptions :: Config -> [String]
cabalOptions cfg =
configCabalOptions cfg ++
[ "-w", configCompiler cfg
] ++ concatMap (\opt -> ["--ghc-option", opt]) (configGhcOptions cfg)
......@@ -64,6 +66,7 @@ config =
<$> patchDir
<*> compiler
<*> ghcOptions
<*> cabalOptions
<*> onlyPackages
<*> concurrency
<*> extraCabalFragments
......@@ -71,6 +74,7 @@ config =
patchDir = option str (short 'p' <> long "patches" <> help "patch directory" <> value "./patches")
compiler = option str (short 'w' <> long "with-compiler" <> help "path of compiler")
ghcOptions = many $ option str (short 'f' <> long "ghc-option" <> help "flag to pass to compiler")
cabalOptions = many $ option str (short 'F' <> long "cabal-option" <> help "flag to pass to cabal-install")
onlyPackages =
fmap (Just . S.fromList) (some $ option pkgName (short 'o' <> long "only" <> help "filter packages"))
<|> pure Nothing
......
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