make LTS branch pre-releases
[cabal.git] / Cabal-syntax / src / Distribution / Types / SetupBuildInfo.hs
blob18a01523a9e77cb4fe95117835eb19c316deb73d
1 {-# LANGUAGE DeriveDataTypeable #-}
2 {-# LANGUAGE DeriveGeneric #-}
4 module Distribution.Types.SetupBuildInfo
5 ( SetupBuildInfo (..)
6 ) where
8 import Distribution.Compat.Prelude
9 import 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
26 -- file. See #3199.
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
36 mappend = (<>)
38 instance Semigroup SetupBuildInfo where
39 a <> b =
40 SetupBuildInfo
41 (setupDepends a <> setupDepends b)
42 (defaultSetupDepends a || defaultSetupDepends b)