Commit 1fd9854b authored by Zhen Zhang's avatar Zhen Zhang Committed by Andrey Mokhov
Browse files

Fix CABAL_VERSION argument in building ghc-cabal (#319)

parent bc32262d
module Settings.Packages.GhcCabal (ghcCabalPackageArgs) where
import Distribution.PackageDescription.Parse
import Base
import GHC
import Oracles.Config.Setting
import Predicate
import Package (pkgCabalFile)
import Distribution.Verbosity (silent)
import Distribution.Text (display)
import Distribution.Package (pkgVersion)
import Distribution.PackageDescription (packageDescription)
import qualified Distribution.PackageDescription as DP
ghcCabalPackageArgs :: Args
ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do
......@@ -12,10 +20,17 @@ ghcCabalPackageArgs = stage0 ? package ghcCabal ? builder Ghc ? do
win <- lift windowsHost
let cabalDeps = [ array, base, bytestring, containers, deepseq, directory
, pretty, process, time, if win then win32 else unix ]
lift $ need [pkgCabalFile cabal]
pd <- liftIO . readGenericPackageDescription silent $ pkgCabalFile cabal
let identifier = DP.package . packageDescription $ pd
cabalVersion = display . pkgVersion $ identifier
mconcat
[ append [ "-package " ++ pkgNameString pkg | pkg <- cabalDeps ]
, arg "--make"
, arg "-j"
, arg ("-DCABAL_VERSION=" ++ replace "." "," cabalVersion)
, arg "-DBOOTSTRAPPING"
, arg "-DMIN_VERSION_binary_0_8_0"
, arg "-DGENERICS"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment