Cabal-3.2.1.0: A framework for packaging Haskell software
Copyright Duncan Coutts 2007-2008
Maintainer cabal-devel@haskell.org
Portability portable
Safe Haskell None
Language Haskell2010

Distribution.System

Description

Cabal often needs to do slightly different things on specific platforms. You probably know about the os however using that is very inconvenient because it is a string and different Haskell implementations do not agree on using the same strings for the same platforms! (In particular see the controversy over "windows" vs "mingw32"). So to make it more consistent and easy to use we have an OS enumeration.

Synopsis

Operating System

data OS Source #

These are the known OS names: Linux, Windows, OSX ,FreeBSD, OpenBSD, NetBSD, DragonFly ,Solaris, AIX, HPUX, IRIX ,HaLVM ,Hurd ,IOS, Android,Ghcjs

The following aliases can also be used:, * Windows aliases: mingw32, win32, cygwin32 * OSX alias: darwin * Hurd alias: gnu * FreeBSD alias: kfreebsdgnu * Solaris alias: solaris2

Instances

Instances details
Eq OS Source #
Instance details

Defined in Distribution.System

Data OS Source #
Instance details

Defined in Distribution.System

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> OS -> c OS Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c OS Source #

toConstr :: OS -> Constr Source #

dataTypeOf :: OS -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c OS ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c OS ) Source #

gmapT :: ( forall b. Data b => b -> b) -> OS -> OS Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> OS -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> OS -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> OS -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> OS -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> OS -> m OS Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> OS -> m OS Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> OS -> m OS Source #

Ord OS Source #
Instance details

Defined in Distribution.System

Read OS Source #
Instance details

Defined in Distribution.System

Show OS Source #
Instance details

Defined in Distribution.System

Generic OS Source #
Instance details

Defined in Distribution.System

Associated Types

type Rep OS :: Type -> Type Source #

Binary OS Source #
Instance details

Defined in Distribution.System

NFData OS Source #
Instance details

Defined in Distribution.System

Methods

rnf :: OS -> () Source #

Structured OS Source #
Instance details

Defined in Distribution.System

Pretty OS Source #
Instance details

Defined in Distribution.System

Parsec OS Source #
Instance details

Defined in Distribution.System

type Rep OS Source #
Instance details

Defined in Distribution.System

Machine Architecture

data Arch Source #

These are the known Arches: I386, X86_64, PPC, PPC64, Sparc, Arm, AArch64, Mips, SH, IA64, S39, Alpha, Hppa, Rs6000, M68k, Vax, and JavaScript.

The following aliases can also be used: * PPC alias: powerpc * PPC64 alias : powerpc64, powerpc64le * Sparc aliases: sparc64, sun4 * Mips aliases: mipsel, mipseb * Arm aliases: armeb, armel * AArch64 aliases: arm64

Instances

Instances details
Eq Arch Source #
Instance details

Defined in Distribution.System

Data Arch Source #
Instance details

Defined in Distribution.System

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Arch -> c Arch Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c Arch Source #

toConstr :: Arch -> Constr Source #

dataTypeOf :: Arch -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c Arch ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c Arch ) Source #

gmapT :: ( forall b. Data b => b -> b) -> Arch -> Arch Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Arch -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Arch -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Arch -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Arch -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Arch -> m Arch Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Arch -> m Arch Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Arch -> m Arch Source #

Ord Arch Source #
Instance details

Defined in Distribution.System

Read Arch Source #
Instance details

Defined in Distribution.System

Show Arch Source #
Instance details

Defined in Distribution.System

Generic Arch Source #
Instance details

Defined in Distribution.System

Associated Types

type Rep Arch :: Type -> Type Source #

Binary Arch Source #
Instance details

Defined in Distribution.System

NFData Arch Source #
Instance details

Defined in Distribution.System

Structured Arch Source #
Instance details

Defined in Distribution.System

Pretty Arch Source #
Instance details

Defined in Distribution.System

Parsec Arch Source #
Instance details

Defined in Distribution.System

type Rep Arch Source #
Instance details

Defined in Distribution.System

type Rep Arch = D1 (' MetaData "Arch" "Distribution.System" "Cabal-3.2.1.0-3w1fQQbNnuQ5xlFGwVXcPy" ' False ) (((( C1 (' MetaCons "I386" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "X86_64" ' PrefixI ' False ) ( U1 :: Type -> Type )) :+: ( C1 (' MetaCons "PPC" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "PPC64" ' PrefixI ' False ) ( U1 :: Type -> Type ))) :+: (( C1 (' MetaCons "Sparc" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "Arm" ' PrefixI ' False ) ( U1 :: Type -> Type )) :+: ( C1 (' MetaCons "AArch64" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: ( C1 (' MetaCons "Mips" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "SH" ' PrefixI ' False ) ( U1 :: Type -> Type ))))) :+: ((( C1 (' MetaCons "IA64" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "S390" ' PrefixI ' False ) ( U1 :: Type -> Type )) :+: ( C1 (' MetaCons "Alpha" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "Hppa" ' PrefixI ' False ) ( U1 :: Type -> Type ))) :+: (( C1 (' MetaCons "Rs6000" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "M68k" ' PrefixI ' False ) ( U1 :: Type -> Type )) :+: ( C1 (' MetaCons "Vax" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: ( C1 (' MetaCons "JavaScript" ' PrefixI ' False ) ( U1 :: Type -> Type ) :+: C1 (' MetaCons "OtherArch" ' PrefixI ' False ) ( S1 (' MetaSel (' Nothing :: Maybe Symbol ) ' NoSourceUnpackedness ' NoSourceStrictness ' DecidedLazy ) ( Rec0 String )))))))

Platform is a pair of arch and OS

data Platform Source #

Instances

Instances details
Eq Platform Source #
Instance details

Defined in Distribution.System

Data Platform Source #
Instance details

Defined in Distribution.System

Methods

gfoldl :: ( forall d b. Data d => c (d -> b) -> d -> c b) -> ( forall g. g -> c g) -> Platform -> c Platform Source #

gunfold :: ( forall b r. Data b => c (b -> r) -> c r) -> ( forall r. r -> c r) -> Constr -> c Platform Source #

toConstr :: Platform -> Constr Source #

dataTypeOf :: Platform -> DataType Source #

dataCast1 :: Typeable t => ( forall d. Data d => c (t d)) -> Maybe (c Platform ) Source #

dataCast2 :: Typeable t => ( forall d e. ( Data d, Data e) => c (t d e)) -> Maybe (c Platform ) Source #

gmapT :: ( forall b. Data b => b -> b) -> Platform -> Platform Source #

gmapQl :: (r -> r' -> r) -> r -> ( forall d. Data d => d -> r') -> Platform -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> ( forall d. Data d => d -> r') -> Platform -> r Source #

gmapQ :: ( forall d. Data d => d -> u) -> Platform -> [u] Source #

gmapQi :: Int -> ( forall d. Data d => d -> u) -> Platform -> u Source #

gmapM :: Monad m => ( forall d. Data d => d -> m d) -> Platform -> m Platform Source #

gmapMp :: MonadPlus m => ( forall d. Data d => d -> m d) -> Platform -> m Platform Source #

gmapMo :: MonadPlus m => ( forall d. Data d => d -> m d) -> Platform -> m Platform Source #

Ord Platform Source #
Instance details

Defined in Distribution.System

Read Platform Source #
Instance details

Defined in Distribution.System

Show Platform Source #
Instance details

Defined in Distribution.System

Generic Platform Source #
Instance details

Defined in Distribution.System

Binary Platform Source #
Instance details

Defined in Distribution.System

NFData Platform Source #
Instance details

Defined in Distribution.System

Structured Platform Source #
Instance details

Defined in Distribution.System

Pretty Platform Source #
Instance details

Defined in Distribution.System

Parsec Platform Source #
Instance details

Defined in Distribution.System

type Rep Platform Source #
Instance details

Defined in Distribution.System

buildPlatform :: Platform Source #

The platform Cabal was compiled on. In most cases, LocalBuildInfo.hostPlatform should be used instead (the platform we're targeting).

Internal

Classification

data ClassificationStrictness Source #

How strict to be when classifying strings into the OS and Arch enums.

The reason we have multiple ways to do the classification is because there are two situations where we need to do it.

For parsing OS and arch names in .cabal files we really want everyone to be referring to the same or or arch by the same name. Variety is not a virtue in this case. We don't mind about case though.

For the System.Info.os/arch different Haskell implementations use different names for the same or/arch. Also they tend to distinguish versions of an OS/arch which we just don't care about.

The Compat classification allows us to recognise aliases that are already in common use but it allows us to distinguish them from the canonical name which enables us to warn about such deprecated aliases.