1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE DeriveGeneric #-}
4 module Distribution
.Types
.PkgconfigDependency
5 ( PkgconfigDependency
(..)
8 import Distribution
.Compat
.Prelude
11 import Distribution
.Types
.PkgconfigName
12 import Distribution
.Types
.PkgconfigVersionRange
14 import Distribution
.Parsec
15 import Distribution
.Pretty
17 import qualified Distribution
.Compat
.CharParsing
as P
19 -- | Describes a dependency on a pkg-config library
22 data PkgconfigDependency
26 deriving (Generic
, Read, Show, Eq
, Ord
, Typeable
, Data
)
28 instance Binary PkgconfigDependency
29 instance Structured PkgconfigDependency
30 instance NFData PkgconfigDependency
where rnf
= genericRnf
32 instance Pretty PkgconfigDependency
where
33 pretty
(PkgconfigDependency name PcAnyVersion
) = pretty name
34 pretty
(PkgconfigDependency name ver
) = pretty name
<+> pretty ver
36 instance Parsec PkgconfigDependency
where
40 verRange
<- parsec
<|
> pure anyPkgconfigVersion
41 pure
$ PkgconfigDependency name verRange