[commit: packages/Cabal] ghc-head: Add a sensible extra-prog-path to the default ~/.cabal/config (66a1bbf)
git at git.haskell.org
git at git.haskell.org
Mon Aug 26 23:29:34 CEST 2013
Repository : ssh://git@git.haskell.org/Cabal
On branch : ghc-head
Link : http://git.haskell.org/?p=packages/Cabal.git;a=commit;h=66a1bbf9eca4aa95cda5476bcd031401bf1e3f46
>---------------------------------------------------------------
commit 66a1bbf9eca4aa95cda5476bcd031401bf1e3f46
Author: Duncan Coutts <duncan at community.haskell.org>
Date: Sat Aug 10 22:44:15 2013 +0100
Add a sensible extra-prog-path to the default ~/.cabal/config
e.g. extra-prog-path: /home/duncan/.cabal/bin
This should help with the problem that people install tools like alex,
happy, c2hs etc and then cabal cannot find them.
Arguably we should have this as the default value for extra-prog-path,
so that it affects existing installations, rather than just affecting
new installations where we generate the ~/.cabal/config for the first
time. It's easy to change if we want to do that.
>---------------------------------------------------------------
66a1bbf9eca4aa95cda5476bcd031401bf1e3f46
cabal-install/Distribution/Client/Config.hs | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/cabal-install/Distribution/Client/Config.hs b/cabal-install/Distribution/Client/Config.hs
index 88697d8..77b3d5e 100644
--- a/cabal-install/Distribution/Client/Config.hs
+++ b/cabal-install/Distribution/Client/Config.hs
@@ -203,12 +203,16 @@ initialSavedConfig = do
cacheDir <- defaultCacheDir
logsDir <- defaultLogsDir
worldFile <- defaultWorldFile
+ extraPath <- defaultExtraPath
return mempty {
savedGlobalFlags = mempty {
globalCacheDir = toFlag cacheDir,
globalRemoteRepos = [defaultRemoteRepo],
globalWorldFile = toFlag worldFile
},
+ savedConfigureFlags = mempty {
+ configProgramPathExtra = extraPath
+ },
savedInstallFlags = mempty {
installSummaryFile = [toPathTemplate (logsDir </> "build.log")],
installBuildReports= toFlag AnonymousReports,
@@ -242,6 +246,11 @@ defaultWorldFile = do
dir <- defaultCabalDir
return $ dir </> "world"
+defaultExtraPath :: IO [FilePath]
+defaultExtraPath = do
+ dir <- defaultCabalDir
+ return [dir </> "bin"]
+
defaultCompiler :: CompilerFlavor
defaultCompiler = fromMaybe GHC defaultCompilerFlavor
More information about the ghc-commits
mailing list