Squashed 'hadrian/' content from commit 438dc57
[ghc.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 Utilities
8
9 ghcCabalPackageArgs :: Args
10 ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do
11 cabalDeps <- expr $ stage1Dependencies cabal
12 cabalVersion <- expr $ pkgVersion (unsafePkgCabalFile cabal) -- TODO: improve
13 mconcat
14 [ pure [ "-package " ++ pkgName pkg | pkg <- cabalDeps, pkg /= parsec ]
15 , arg "--make"
16 , arg "-j"
17 , pure ["-Wall", "-fno-warn-unused-imports", "-fno-warn-warnings-deprecations"]
18 , arg ("-DCABAL_VERSION=" ++ replace "." "," cabalVersion)
19 , arg "-DBOOTSTRAPPING"
20 , arg "-DMIN_VERSION_binary_0_8_0"
21 , arg "-ilibraries/Cabal/Cabal"
22 , arg "-ilibraries/binary/src"
23 , arg "-ilibraries/filepath"
24 , arg "-ilibraries/hpc" ]