module Language.ATS.Package.Type (
Pkg (..)
, Dependency (..)
, Bin (..)
, Version (..)
, Constraint (..)
, TargetPair (..)
, dirLens
) where
import Control.Lens
import Data.Binary (Binary (..))
import Development.Shake.ATS
import Dhall
data Constraint = Constraint { pkgName :: Text
, lower :: Maybe Version
, upper :: Maybe Version
}
deriving (Eq, Show, Generic, Interpret)
deriving newtype instance Interpret Version
data Dependency = Dependency { libName :: Text
, dir :: Text
, url :: Text
, libVersion :: Version
}
deriving (Eq, Show, Generic, Interpret, Binary)
makeLensesFor [("dir", "dirLens")] ''Dependency
data TargetPair = TargetPair { hs :: Text
, ats :: Text
} deriving (Eq, Show, Generic, Interpret, Binary)
deriving instance Show ForeignCabal
deriving instance Eq ForeignCabal
deriving instance Generic ForeignCabal
deriving instance Interpret ForeignCabal
deriving instance Binary ForeignCabal
data Bin = Bin { src :: Text
, target :: Text
, libs :: [Text]
, hsDeps :: [ForeignCabal]
, hs2ats :: [TargetPair]
, gcBin :: Bool
}
deriving (Show, Eq, Generic, Interpret, Binary)
data Pkg = Pkg { bin :: [Bin]
, test :: [Bin]
, man :: Maybe Text
, version :: Version
, compiler :: Version
, dependencies :: [Dependency]
, clib :: [Dependency]
, ccompiler :: Text
, cflags :: [Text]
, atsSource :: [Text]
, cDir :: Text
}
deriving (Show, Eq, Generic, Interpret, Binary)