1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE DeriveGeneric #-}
4 module Distribution
.Types
.SetupBuildInfo
8 import Distribution
.Compat
.Prelude
11 import Distribution
.Types
.Dependency
13 -- ---------------------------------------------------------------------------
14 -- The SetupBuildInfo type
16 -- One can see this as a very cut-down version of BuildInfo below.
17 -- To keep things simple for tools that compile Setup.hs we limit the
18 -- options authors can specify to just Haskell package dependencies.
20 data SetupBuildInfo
= SetupBuildInfo
21 { setupDepends
:: [Dependency
]
22 , defaultSetupDepends
:: Bool
23 -- ^ Is this a default 'custom-setup' section added by the cabal-install
24 -- code (as opposed to user-provided)? This field is only used
25 -- internally, and doesn't correspond to anything in the .cabal
28 deriving (Generic
, Show, Eq
, Ord
, Read, Typeable
, Data
)
30 instance Binary SetupBuildInfo
31 instance Structured SetupBuildInfo
32 instance NFData SetupBuildInfo
where rnf
= genericRnf
34 instance Monoid SetupBuildInfo
where
35 mempty
= SetupBuildInfo
[] False
38 instance Semigroup SetupBuildInfo
where
41 (setupDepends a
<> setupDepends b
)
42 (defaultSetupDepends a || defaultSetupDepends b
)