-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | A command line program for extracting compiler arguments from a cabal file. -- -- For further details please consult the README. @package cabal-cargs @version 1.3.0 module CabalCargs.Fields -- | A compiler relevant field. Till Package_Db all fields are from -- the cabal file with the same name, just with lower case letters and -- the "_" replaced by a "-". data Field Hs_Source_Dirs :: Field Ghc_Options :: Field Default_Extensions :: Field Default_Language :: Field Cpp_Options :: Field C_Sources :: Field Cc_Options :: Field Extra_Lib_Dirs :: Field Extra_Libraries :: Field Ld_Options :: Field Include_Dirs :: Field Includes :: Field Build_Depends :: Field -- | the package database of a cabal sandbox Package_Db :: Field -- | the root directory of the cabal package Root_Dir :: Field -- | dirs of automatically generated haskell source files by cabal (e.g. -- Paths_*) Autogen_Hs_Source_Dirs :: Field -- | dirs of automatically generated include files by cabal Autogen_Include_Dirs :: Field -- | automatically generated include files by cabal (e.g. cabal_macros.h) Autogen_Includes :: Field -- | the socket file for hdevtools Hdevtools_Socket :: Field -- | Get all known fields. allFields :: [Field] -- | Which fields should be collected type Fields = [Field] instance GHC.Enum.Bounded CabalCargs.Fields.Field instance GHC.Enum.Enum CabalCargs.Fields.Field instance GHC.Classes.Eq CabalCargs.Fields.Field instance GHC.Show.Show CabalCargs.Fields.Field instance Data.Data.Data CabalCargs.Fields.Field module CabalCargs.Formatting -- | How the fields from the cabal file should be printed out. data Formatting -- | as ghc compatible arguments Ghc :: Formatting -- | as hdevtools compatible arguments Hdevtools :: Formatting -- | the field values are printed as present in the cabal file Pure :: Formatting instance GHC.Classes.Eq CabalCargs.Formatting.Formatting instance GHC.Show.Show CabalCargs.Formatting.Formatting instance Data.Data.Data CabalCargs.Formatting.Formatting instance System.Console.CmdArgs.Default.Default CabalCargs.Formatting.Formatting module CabalCargs.Args -- | The command line arguments of the cabal-cargs command. data Args Args :: Bool -> [String] -> [String] -> [String] -> Bool -> [Field] -> [Field] -> Formatting -> Maybe FilePath -> Maybe FilePath -> [String] -> [String] -> Maybe String -> Maybe String -> Bool -> Args [library] :: Args -> Bool [executable] :: Args -> [String] [testSuite] :: Args -> [String] [benchmark] :: Args -> [String] [allSections] :: Args -> Bool [only] :: Args -> [Field] [ignore] :: Args -> [Field] [format] :: Args -> Formatting [sourceFile] :: Args -> Maybe FilePath [cabalFile] :: Args -> Maybe FilePath [enable] :: Args -> [String] [disable] :: Args -> [String] [os] :: Args -> Maybe String [arch] :: Args -> Maybe String [relative] :: Args -> Bool get :: IO Args instance GHC.Classes.Eq CabalCargs.Args.Args instance GHC.Show.Show CabalCargs.Args.Args instance Data.Data.Data CabalCargs.Args.Args module CabalCargs.Spec -- | Specifies which compiler args from which sections should be collected. data Spec Spec :: [Section] -> Fields -> CondVars -> GenericPackageDescription -> FilePath -> Maybe FilePath -> Maybe FilePath -> Bool -> Spec -- | the sections used for collecting the compiler args [sections] :: Spec -> [Section] -- | for these fields compiler args are collected [fields] :: Spec -> Fields -- | used for the evaluation of the conditional fields in the cabal file [condVars] :: Spec -> CondVars -- | the package description of the read in cabal file [pkgDescrp] :: Spec -> GenericPackageDescription -- | the cabal file read from [cabalFile] :: Spec -> FilePath -- | the dist directory of the cabal build [distDir] :: Spec -> Maybe FilePath -- | the directory of package database of the cabal sandbox [packageDB] :: Spec -> Maybe FilePath -- | if all returned paths are relative to the directory of the cabal file, -- otherwise all paths are absolute [relativePaths] :: Spec -> Bool -- | Create a Spec by the command line arguments given to -- 'cabal-cargs'. -- -- Depending on the command line arguments fromCmdArgs might -- behave like fromCabalFile, if only a cabal file was given, like -- fromSourceFile, if only a source file was given or like a mix -- of both, if a cabal file and a source file have been given. fromCmdArgs :: Args -> IO (Either Error Spec) module CabalCargs.CompilerArgs -- | The collected compiler args from the cabal file. Till the field -- packageDB all fields represent the equaliy named fields -- (- replaced by CamelCase) from the cabal file. data CompilerArgs CompilerArgs :: [FilePath] -> [String] -> [String] -> [String] -> [String] -> [FilePath] -> [String] -> [FilePath] -> [String] -> [String] -> [FilePath] -> [String] -> [String] -> Maybe FilePath -> Maybe FilePath -> [FilePath] -> [FilePath] -> [String] -> Maybe FilePath -> CompilerArgs [hsSourceDirs] :: CompilerArgs -> [FilePath] [ghcOptions] :: CompilerArgs -> [String] [defaultExtensions] :: CompilerArgs -> [String] [defaultLanguage] :: CompilerArgs -> [String] [cppOptions] :: CompilerArgs -> [String] [cSources] :: CompilerArgs -> [FilePath] [ccOptions] :: CompilerArgs -> [String] [extraLibDirs] :: CompilerArgs -> [FilePath] [extraLibraries] :: CompilerArgs -> [String] [ldOptions] :: CompilerArgs -> [String] [includeDirs] :: CompilerArgs -> [FilePath] [includes] :: CompilerArgs -> [String] [buildDepends] :: CompilerArgs -> [String] -- | the path to the package database of the cabal sandbox [packageDB] :: CompilerArgs -> Maybe FilePath -- | the root directory of the cabal package [rootDir] :: CompilerArgs -> Maybe FilePath -- | dirs of automatically generated haskell source files by cabal (e.g. -- Paths_*) [autogenHsSourceDirs] :: CompilerArgs -> [FilePath] -- | dirs of automatically generated include files by cabal [autogenIncludeDirs] :: CompilerArgs -> [FilePath] -- | automatically generated include files by cabal (e.g. cabal_macros.h) [autogenIncludes] :: CompilerArgs -> [String] -- | the path to the hdevtools socket file [hdevtoolsSocket] :: CompilerArgs -> Maybe FilePath -- | Create a CompilerArgs by the command line arguments given to -- 'cabal-cargs'. fromCmdArgs :: Args -> IO (Either Error CompilerArgs) -- | Create a CompilerArgs and collect the compiler args specified -- by Spec. fromSpec :: Spec -> CompilerArgs instance GHC.Classes.Eq CabalCargs.CompilerArgs.CompilerArgs instance GHC.Show.Show CabalCargs.CompilerArgs.CompilerArgs module CabalCargs.Format format :: Formatting -> CompilerArgs -> [String]