diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2019-01-10 04:37:36 -0800 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-01-16 14:17:47 -0500 |
commit | 8765c1e6e6aca590a2fc252c64846890bf87f387 (patch) | |
tree | 3486cd9d5eca722a6b19f1f3f038ad72dbbe6958 /hadrian/src/Base.hs | |
parent | 2e05912086bbb8eab213d44af300ecc396d912aa (diff) | |
download | haskell-8765c1e6e6aca590a2fc252c64846890bf87f387.tar.gz |
Make sure 'haddock' package also copies resources
...and does so in the lib folder of the right stage
Diffstat (limited to 'hadrian/src/Base.hs')
-rw-r--r-- | hadrian/src/Base.hs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/hadrian/src/Base.hs b/hadrian/src/Base.hs index cb0dba06ea..277d6148ab 100644 --- a/hadrian/src/Base.hs +++ b/hadrian/src/Base.hs @@ -24,7 +24,8 @@ module Base ( -- * Paths hadrianPath, configPath, configFile, sourcePath, shakeFilesDir, generatedDir, generatedPath, stageBinPath, stageLibPath, templateHscPath, - ghcDeps, relativePackageDbPath, packageDbPath, packageDbStamp, ghcSplitPath + ghcDeps, haddockDeps, relativePackageDbPath, packageDbPath, packageDbStamp, + ghcSplitPath ) where import Control.Applicative @@ -37,6 +38,7 @@ import Development.Shake hiding (parallel, unit, (*>), Normal) import Development.Shake.Classes import Development.Shake.FilePath import Development.Shake.Util +import Hadrian.Oracles.DirectoryContents import Hadrian.Utilities import Hadrian.Package @@ -114,6 +116,17 @@ ghcDeps stage = mapM (\f -> stageLibPath stage <&> (-/- f)) , "platformConstants" , "settings" ] +-- | Files the `haddock` binary depends on +haddockDeps :: Stage -> Action [FilePath] +haddockDeps stage = do + let resdir = "utils/haddock/haddock-api/resources" + latexResources <- directoryContents matchAll (resdir -/- "latex") + htmlResources <- directoryContents matchAll (resdir -/- "html") + + haddockLib <- stageLibPath stage + return $ [ haddockLib -/- makeRelative resdir f + | f <- latexResources ++ htmlResources ] + -- ref: utils/hsc2hs/ghc.mk -- | Path to 'hsc2hs' template. templateHscPath :: Stage -> Action FilePath |