summaryrefslogtreecommitdiff
path: root/src/Settings/Packages/GhcCabal.hs
blob: 0e915b3ea69f7423b56b7ebc7de8ae151919581f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where

import Hadrian.Haskell.Cabal

import Base
import Expression
import Utilities

ghcCabalPackageArgs :: Args
ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do
    cabalDeps    <- expr $ stage1Dependencies cabal
    cabalVersion <- expr $ pkgVersion (unsafePkgCabalFile cabal) -- TODO: improve
    mconcat
        [ pure [ "-package " ++ pkgName pkg | pkg <- cabalDeps \\ [parsec, mtl] ]
        , arg "--make"
        , arg "-j"
        , pure ["-Wall", "-fno-warn-unused-imports", "-fno-warn-warnings-deprecations"]
        , arg ("-DCABAL_VERSION=" ++ replace "." "," cabalVersion)
        , arg "-DCABAL_PARSEC"
        , arg "-DBOOTSTRAPPING"
        , arg "-DMIN_VERSION_binary_0_8_0"
        , arg "libraries/text/cbits/cbits.c"
        , arg "-ilibraries/Cabal/Cabal"
        , arg "-ilibraries/binary/src"
        , arg "-ilibraries/filepath"
        , arg "-ilibraries/hpc"
        , arg "-ilibraries/mtl"
        , arg "-ilibraries/text"
        , arg "-Ilibraries/text/include"
        , arg "-ilibraries/parsec" ]