module Distribution.Simple.Program.Builtin (
builtinPrograms,
ghcProgram,
ghcPkgProgram,
lhcProgram,
lhcPkgProgram,
nhcProgram,
hmakeProgram,
jhcProgram,
hugsProgram,
ffihugsProgram,
uhcProgram,
gccProgram,
ranlibProgram,
arProgram,
stripProgram,
happyProgram,
alexProgram,
hsc2hsProgram,
c2hsProgram,
cpphsProgram,
hscolourProgram,
haddockProgram,
greencardProgram,
ldProgram,
tarProgram,
cppProgram,
pkgConfigProgram,
) where
import Distribution.Simple.Program.Types
( Program(..), simpleProgram )
import Distribution.Simple.Utils
( findProgramLocation, findProgramVersion )
builtinPrograms :: [Program]
builtinPrograms =
[
ghcProgram :: ProgramghcProgram
, ghcPkgProgram :: ProgramghcPkgProgram
, hugsProgram :: ProgramhugsProgram
, ffihugsProgram :: ProgramffihugsProgram
, nhcProgram :: ProgramnhcProgram
, hmakeProgram :: ProgramhmakeProgram
, jhcProgram :: ProgramjhcProgram
, lhcProgram :: ProgramlhcProgram
, lhcPkgProgram :: ProgramlhcPkgProgram
, uhcProgram :: ProgramuhcProgram
, hscolourProgram :: ProgramhscolourProgram
, haddockProgram :: ProgramhaddockProgram
, happyProgram :: ProgramhappyProgram
, alexProgram :: ProgramalexProgram
, hsc2hsProgram :: Programhsc2hsProgram
, c2hsProgram :: Programc2hsProgram
, cpphsProgram :: ProgramcpphsProgram
, greencardProgram :: ProgramgreencardProgram
, gccProgram :: ProgramgccProgram
, ranlibProgram :: ProgramranlibProgram
, arProgram :: ProgramarProgram
, stripProgram :: ProgramstripProgram
, ldProgram :: ProgramldProgram
, tarProgram :: ProgramtarProgram
, pkgConfigProgram :: ProgrampkgConfigProgram
]
ghcProgram :: Program
ghcProgram = (simpleProgram :: String -> ProgramsimpleProgram "ghc") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--numeric-version" id :: a -> aid
}
ghcPkgProgram :: Program
ghcPkgProgram = (simpleProgram :: String -> ProgramsimpleProgram "ghc-pkg") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:_:_:_:ver:_) -> ver :: Stringver
_ -> ""
}
lhcProgram :: Program
lhcProgram = (simpleProgram :: String -> ProgramsimpleProgram "lhc") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--numeric-version" id :: a -> aid
}
lhcPkgProgram :: Program
lhcPkgProgram = (simpleProgram :: String -> ProgramsimpleProgram "lhc-pkg") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:_:_:_:ver:_) -> ver :: Stringver
_ -> ""
}
nhcProgram :: Program
nhcProgram = (simpleProgram :: String -> ProgramsimpleProgram "nhc98") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:('v':ver):_) -> ver :: Stringver
_ -> ""
}
hmakeProgram :: Program
hmakeProgram = (simpleProgram :: String -> ProgramsimpleProgram "hmake") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:ver:_) -> ver :: Stringver
_ -> ""
}
jhcProgram :: Program
jhcProgram = (simpleProgram :: String -> ProgramsimpleProgram "jhc") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:ver:_) -> ver :: Stringver
_ -> ""
}
uhcProgram :: Program
uhcProgram = (simpleProgram :: String -> ProgramsimpleProgram "uhc") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version-dotted" id :: a -> aid
}
hugsProgram :: Program
hugsProgram = simpleProgram :: String -> ProgramsimpleProgram "hugs"
ffihugsProgram :: Program
ffihugsProgram = simpleProgram :: String -> ProgramsimpleProgram "ffihugs"
happyProgram :: Program
happyProgram = (simpleProgram :: String -> ProgramsimpleProgram "happy") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:_:ver:_) -> ver :: Stringver
_ -> ""
}
alexProgram :: Program
alexProgram = (simpleProgram :: String -> ProgramsimpleProgram "alex") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:_:ver:_) -> takeWhile :: (a -> Bool) -> [a] -> [a]takeWhile (elem :: Eq a => a -> [a] -> Bool`elem` ('.'(:) :: a -> [a] -> [a]:['0'..'9'])) ver :: Stringver
_ -> ""
}
gccProgram :: Program
gccProgram = (simpleProgram :: String -> ProgramsimpleProgram "gcc") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "-dumpversion" id :: a -> aid
}
ranlibProgram :: Program
ranlibProgram = simpleProgram :: String -> ProgramsimpleProgram "ranlib"
arProgram :: Program
arProgram = simpleProgram :: String -> ProgramsimpleProgram "ar"
stripProgram :: Program
stripProgram = simpleProgram :: String -> ProgramsimpleProgram "strip"
hsc2hsProgram :: Program
hsc2hsProgram = (simpleProgram :: String -> ProgramsimpleProgram "hsc2hs") {
programFindVersion =
findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:_:ver:_) -> ver :: Stringver
_ -> ""
}
c2hsProgram :: Program
c2hsProgram = (simpleProgram :: String -> ProgramsimpleProgram "c2hs") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--numeric-version" id :: a -> aid
}
cpphsProgram :: Program
cpphsProgram = (simpleProgram :: String -> ProgramsimpleProgram "cpphs") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:ver:_) -> ver :: Stringver
_ -> ""
}
hscolourProgram :: Program
hscolourProgram = (simpleProgram :: String -> ProgramsimpleProgram "hscolour") {
programFindLocation = \v -> findProgramLocation :: Verbosity -> FilePath -> IO (Maybe FilePath)findProgramLocation v :: Verbosityv "HsColour",
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "-version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:ver:_) -> ver :: Stringver
_ -> ""
}
haddockProgram :: Program
haddockProgram = (simpleProgram :: String -> ProgramsimpleProgram "haddock") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" ($) :: (a -> b) -> a -> b$ \str ->
case words :: String -> [String]words str :: Stringstr of
(_:_:ver:_) -> takeWhile :: (a -> Bool) -> [a] -> [a]takeWhile (elem :: Eq a => a -> [a] -> Bool`elem` ('.'(:) :: a -> [a] -> [a]:['0'..'9'])) ver :: Stringver
_ -> ""
}
greencardProgram :: Program
greencardProgram = simpleProgram :: String -> ProgramsimpleProgram "greencard"
ldProgram :: Program
ldProgram = simpleProgram :: String -> ProgramsimpleProgram "ld"
tarProgram :: Program
tarProgram = simpleProgram :: String -> ProgramsimpleProgram "tar"
cppProgram :: Program
cppProgram = simpleProgram :: String -> ProgramsimpleProgram "cpp"
pkgConfigProgram :: Program
pkgConfigProgram = (simpleProgram :: String -> ProgramsimpleProgram "pkg-config") {
programFindVersion = findProgramVersion ::
String
-> (String -> String)
-> Verbosity
-> FilePath
-> IO (Maybe Version)findProgramVersion "--version" id :: a -> aid
}