diff options
Diffstat (limited to 'hadrian/src/Context.hs')
| -rw-r--r-- | hadrian/src/Context.hs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/hadrian/src/Context.hs b/hadrian/src/Context.hs index 3269714c29..745901159d 100644 --- a/hadrian/src/Context.hs +++ b/hadrian/src/Context.hs @@ -8,7 +8,7 @@ module Context ( -- * Paths contextDir, buildPath, buildDir, pkgInplaceConfig, pkgSetupConfigFile, pkgHaddockFile, pkgLibraryFile, pkgGhciLibraryFile, pkgConfFile, objectPath, - contextPath, getContextPath, libDir, libPath + contextPath, getContextPath, libDir, libPath, distDir ) where import Base @@ -46,10 +46,19 @@ getStagedSettingList f = getSettingList . f =<< getStage libDir :: Context -> FilePath libDir Context {..} = stageString stage -/- "lib" --- | Path to the directory containg the final artifact in a given 'Context' +-- | Path to the directory containg the final artifact in a given 'Context'. libPath :: Context -> Action FilePath libPath context = buildRoot <&> (-/- libDir context) +-- | Get the directory name for binary distribution files +-- <arch>-<os>-ghc-<version>. +distDir :: Action FilePath +distDir = do + version <- setting ProjectVersion + hostOs <- setting BuildOs + hostArch <- setting BuildArch + return $ hostArch ++ "-" ++ hostOs ++ "-ghc-" ++ version + pkgFile :: Context -> String -> String -> Action FilePath pkgFile context@Context {..} prefix suffix = do path <- buildPath context |
