Simplify Package data type
[hadrian.git] / src / Settings / Packages / GhcCabal.hs
1 module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where
2
3 import Hadrian.Haskell.Cabal
4
5 import Base
6 import Expression
7 import GHC
8 import Utilities
9
10 ghcCabalPackageArgs :: Args
11 ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do
12 cabalDeps <- expr $ pkgDependencies cabal
13 (_, cabalVersion) <- expr $ cabalNameVersion (pkgCabalFile cabal)
14 mconcat
15 [ pure [ "-package " ++ pkgName pkg | pkg <- cabalDeps ]
16 , arg "--make"
17 , arg "-j"
18 , arg ("-DCABAL_VERSION=" ++ replace "." "," cabalVersion)
19 , arg "-DBOOTSTRAPPING"
20 , arg "-DMIN_VERSION_binary_0_8_0"
21 , arg "-DGENERICS"
22 , arg "-optP-include"
23 , arg $ "-optP" ++ pkgPath ghcCabal -/- "cabal_macros_boot.h"
24 , arg "-ilibraries/Cabal/Cabal"
25 , arg "-ilibraries/binary/src"
26 , arg "-ilibraries/filepath"
27 , arg "-ilibraries/hpc" ]