Commit d7bbef5b authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Unlit 'Setup.lhs' before copying to 'dist/setup/setup.hs'.

Fixes #1573.
parent 6b06b6ca
...@@ -43,6 +43,8 @@ import Distribution.Compiler ( buildCompilerId ) ...@@ -43,6 +43,8 @@ import Distribution.Compiler ( buildCompilerId )
import Distribution.Simple.Compiler import Distribution.Simple.Compiler
( CompilerFlavor(GHC), Compiler(compilerId) ( CompilerFlavor(GHC), Compiler(compilerId)
, PackageDB(..), PackageDBStack ) , PackageDB(..), PackageDBStack )
import Distribution.Simple.PreProcess
( runSimplePreProcessor, ppUnlit )
import Distribution.Simple.Program import Distribution.Simple.Program
( ProgramConfiguration, emptyProgramConfiguration ( ProgramConfiguration, emptyProgramConfiguration
, getProgramSearchPath, getDbProgramOutput, runDbProgram, ghcProgram ) , getProgramSearchPath, getDbProgramOutput, runDbProgram, ghcProgram )
...@@ -295,7 +297,9 @@ externalSetupMethod verbosity options pkg bt mkargs = do ...@@ -295,7 +297,9 @@ externalSetupMethod verbosity options pkg bt mkargs = do
"Using 'build-type: Custom' but there is no Setup.hs or Setup.lhs script." "Using 'build-type: Custom' but there is no Setup.hs or Setup.lhs script."
let src = (if useHs then customSetupHs else customSetupLhs) let src = (if useHs then customSetupHs else customSetupLhs)
srcNewer <- src `moreRecentFile` setupHs srcNewer <- src `moreRecentFile` setupHs
when srcNewer $ copyFileVerbose verbosity src setupHs when srcNewer $ if useHs
then copyFileVerbose verbosity src setupHs
else runSimplePreProcessor ppUnlit src setupHs verbosity
where where
customSetupHs = workingDir </> "Setup.hs" customSetupHs = workingDir </> "Setup.hs"
customSetupLhs = workingDir </> "Setup.lhs" customSetupLhs = workingDir </> "Setup.lhs"
......
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