Cabal-2.0.1.0: A framework for packaging Haskell software

Safe Haskell | None
Language | Haskell2010

Distribution.Types.ForeignLib

Synopsis

- data ForeignLib = ForeignLib {
  - foreignLibName :: UnqualComponentName
  - foreignLibType :: ForeignLibType
  - foreignLibOptions :: [ForeignLibOption]
  - foreignLibBuildInfo :: BuildInfo
  - foreignLibVersionInfo :: Maybe LibVersionInfo
  - foreignLibVersionLinux :: Maybe Version
  - foreignLibModDefFile :: [FilePath]
  }
- emptyForeignLib :: ForeignLib
- foreignLibModules :: ForeignLib -> [ModuleName]
- foreignLibIsShared :: ForeignLib -> Bool
- foreignLibVersion :: ForeignLib -> OS -> [Int]
- data LibVersionInfo
- mkLibVersionInfo :: (Int, Int, Int) -> LibVersionInfo
- libVersionInfoCRA :: LibVersionInfo -> (Int, Int, Int)
- libVersionNumber :: LibVersionInfo -> (Int, Int, Int)
- libVersionNumberShow :: LibVersionInfo -> String
- libVersionMajor :: LibVersionInfo -> Int

# Documentation

data ForeignLib #

A foreign library stanza is like a library stanza, except that the built code is intended for consumption by a non-Haskell client.

Constructors

ForeignLib |

Fields

- foreignLibName :: UnqualComponentName

  Name of the foreign library

- foreignLibType :: ForeignLibType

  What kind of foreign library is this (static or dynamic).

- foreignLibOptions :: [ForeignLibOption]

  What options apply to this foreign library (e.g., are we merging in all foreign dependencies.)

- foreignLibBuildInfo :: BuildInfo

  Build information for this foreign library.

- foreignLibVersionInfo :: Maybe LibVersionInfo

  Libtool-style version-info data to compute library version. Refer to the libtool documentation on the current:revision:age versioning scheme.

- foreignLibVersionLinux :: Maybe Version

  Linux library version

- foreignLibModDefFile :: [FilePath]

  (Windows-specific) module definition files

  This is a list rather than a maybe field so that we can flatten the condition trees (for instance, when creating an sdist)

Instances

Eq ForeignLib # |
Methods (==) :: ForeignLib -> ForeignLib -> Bool # (/=) :: ForeignLib -> ForeignLib -> Bool #
Data ForeignLib # |

Methods

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

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

toConstr :: ForeignLib -> Constr Source #

dataTypeOf :: ForeignLib -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Read ForeignLib # |
Methods readsPrec :: Int -> ReadS ForeignLib Source # readList :: ReadS [ForeignLib] Source # readPrec :: ReadPrec ForeignLib Source # readListPrec :: ReadPrec [ForeignLib] Source #
Show ForeignLib # |
Methods showsPrec :: Int -> ForeignLib -> ShowS Source # show :: ForeignLib -> String Source # showList :: [ForeignLib] -> ShowS Source #
Generic ForeignLib # |
Associated Types type Rep ForeignLib :: * -> * Source # Methods from :: ForeignLib -> Rep ForeignLib x Source # to :: Rep ForeignLib x -> ForeignLib Source #
Semigroup ForeignLib # |
Methods (<>) :: ForeignLib -> ForeignLib -> ForeignLib Source # sconcat :: NonEmpty ForeignLib -> ForeignLib Source # stimes :: Integral b => b -> ForeignLib -> ForeignLib Source #
Monoid ForeignLib # |
Methods mempty :: ForeignLib Source # mappend :: ForeignLib -> ForeignLib -> ForeignLib Source # mconcat :: [ForeignLib] -> ForeignLib Source #
Binary ForeignLib # |
Methods put :: ForeignLib -> Put Source # get :: Get ForeignLib Source # putList :: [ForeignLib] -> Put Source #
type Rep ForeignLib # |

type Rep ForeignLib = D1 * (MetaData "ForeignLib" "Distribution.Types.ForeignLib" "Cabal-2.0.1.0" False) (C1 * (MetaCons "ForeignLib" PrefixI True) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "foreignLibName") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * UnqualComponentName)) ((:*:) * (S1 * (MetaSel (Just Symbol "foreignLibType") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * ForeignLibType)) (S1 * (MetaSel (Just Symbol "foreignLibOptions") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [ForeignLibOption])))) ((:*:) * ((:*:) * (S1 * (MetaSel (Just Symbol "foreignLibBuildInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * BuildInfo)) (S1 * (MetaSel (Just Symbol "foreignLibVersionInfo") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe LibVersionInfo)))) ((:*:) * (S1 * (MetaSel (Just Symbol "foreignLibVersionLinux") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * (Maybe Version))) (S1 * (MetaSel (Just Symbol "foreignLibModDefFile") NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * [FilePath]))))))

emptyForeignLib :: ForeignLib #

An empty foreign library.

foreignLibModules :: ForeignLib -> [ModuleName] #

Modules defined by a foreign library.

foreignLibIsShared :: ForeignLib -> Bool #

Is the foreign library shared?

foreignLibVersion :: ForeignLib -> OS -> [Int] #

Get a version number for a foreign library. If we're on Linux, and a Linux version is specified, use that. If we're on Linux, and libtool-style version-info is specified, translate that field into appropriate version numbers. Otherwise, this feature is unsupported so we don't return any version data.

data LibVersionInfo #

Instances

Eq LibVersionInfo # |
Methods (==) :: LibVersionInfo -> LibVersionInfo -> Bool # (/=) :: LibVersionInfo -> LibVersionInfo -> Bool #
Data LibVersionInfo # |

Methods

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

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

toConstr :: LibVersionInfo -> Constr Source #

dataTypeOf :: LibVersionInfo -> DataType Source #

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

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

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

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

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

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

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

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

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

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

Ord LibVersionInfo # |
Methods compare :: LibVersionInfo -> LibVersionInfo -> Ordering # (<) :: LibVersionInfo -> LibVersionInfo -> Bool # (<=) :: LibVersionInfo -> LibVersionInfo -> Bool # (>) :: LibVersionInfo -> LibVersionInfo -> Bool # (>=) :: LibVersionInfo -> LibVersionInfo -> Bool # max :: LibVersionInfo -> LibVersionInfo -> LibVersionInfo # min :: LibVersionInfo -> LibVersionInfo -> LibVersionInfo #
Read LibVersionInfo # |
Methods readsPrec :: Int -> ReadS LibVersionInfo Source # readList :: ReadS [LibVersionInfo] Source # readPrec :: ReadPrec LibVersionInfo Source # readListPrec :: ReadPrec [LibVersionInfo] Source #
Show LibVersionInfo # |
Methods showsPrec :: Int -> LibVersionInfo -> ShowS Source # show :: LibVersionInfo -> String Source # showList :: [LibVersionInfo] -> ShowS Source #
Generic LibVersionInfo # |
Associated Types type Rep LibVersionInfo :: * -> * Source # Methods from :: LibVersionInfo -> Rep LibVersionInfo x Source # to :: Rep LibVersionInfo x -> LibVersionInfo Source #
Binary LibVersionInfo # |
Methods put :: LibVersionInfo -> Put Source # get :: Get LibVersionInfo Source # putList :: [LibVersionInfo] -> Put Source #
Text LibVersionInfo # |
Methods disp :: LibVersionInfo -> Doc # parse :: ReadP r LibVersionInfo #
type Rep LibVersionInfo # |

type Rep LibVersionInfo = D1 * (MetaData "LibVersionInfo" "Distribution.Types.ForeignLib" "Cabal-2.0.1.0" False) (C1 * (MetaCons "LibVersionInfo" PrefixI False) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Int)) ((:*:) * (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Int)) (S1 * (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 * Int)))))

mkLibVersionInfo :: (Int, Int, Int) -> LibVersionInfo #

Construct `LibVersionInfo` from `(current, revision, age)` numbers.

For instance, `mkLibVersionInfo (3,0,0)` constructs a `LibVersionInfo` representing the version-info `3:0:0`.

All version components must be non-negative.

libVersionInfoCRA :: LibVersionInfo -> (Int, Int, Int) #

From a given `LibVersionInfo`, extract the `(current, revision, age)` numbers.

libVersionNumber :: LibVersionInfo -> (Int, Int, Int) #

Given a version-info field, produce a `major.minor.build` version

libVersionNumberShow :: LibVersionInfo -> String #

Given a version-info field, return `"major.minor.build"` as a `String`

libVersionMajor :: LibVersionInfo -> Int #

Return the `major` version of a version-info field.