aboutsummaryrefslogtreecommitdiff
path: root/src/CabalHelper/Compiletime/Program
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2018-10-22 01:20:56 +0200
committerDaniel Gröber <dxld@darkboxed.org>2018-10-27 20:48:56 +0200
commit783eadafe6e6333123add96d2fc0276c8b4cc1d9 (patch)
treefe16786a713d727ab5975f9b1f0f852005308053 /src/CabalHelper/Compiletime/Program
parent069225e2e61562c8166a446d201457425b91ce57 (diff)
Suport using Stack's built-in GHC to build the helper
Diffstat (limited to 'src/CabalHelper/Compiletime/Program')
-rw-r--r--src/CabalHelper/Compiletime/Program/Stack.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/CabalHelper/Compiletime/Program/Stack.hs b/src/CabalHelper/Compiletime/Program/Stack.hs
index e7f280d..322ccaf 100644
--- a/src/CabalHelper/Compiletime/Program/Stack.hs
+++ b/src/CabalHelper/Compiletime/Program/Stack.hs
@@ -20,7 +20,7 @@ Description : Stack program interface
License : GPL-3
-}
-{-# LANGUAGE GADTs, DataKinds #-}
+{-# LANGUAGE NamedFieldPuns, GADTs, DataKinds #-}
module CabalHelper.Compiletime.Program.Stack where
@@ -64,6 +64,7 @@ projPaths qe@QueryEnv {qeProjLoc=ProjLocStackDir projdir} = do
{ sppGlobalPkgDb = PackageDbDir $ look "global-pkg-db:"
, sppSnapPkgDb = PackageDbDir $ look "snapshot-pkg-db:"
, sppLocalPkgDb = PackageDbDir $ look "local-pkg-db:"
+ , sppCompExe = look "compiler-exe:"
}
paths :: QueryEnvI c 'Stack
@@ -85,3 +86,7 @@ listPackageCabalFiles qe@QueryEnv{qeProjLoc=ProjLocStackDir projdir} = do
workdirArg :: QueryEnvI c 'Stack -> [String]
workdirArg QueryEnv{qeDistDir=DistDirStack mworkdir} =
maybeToList $ ("--work-dir="++) . unRelativePath <$> mworkdir
+
+patchCompPrograms :: StackProjPaths -> CompPrograms -> CompPrograms
+patchCompPrograms StackProjPaths{sppCompExe} cprogs =
+ cprogs { ghcProgram = sppCompExe }