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

ci: Introduce --cabal-option flag

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