summaryrefslogtreecommitdiff
path: root/hadrian
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-05-31 10:59:46 -0400
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-06-25 03:54:39 -0400
commit4acc2934952f4849c2082015d9bebef446d46545 (patch)
tree0473e7926f36a73666c3e5e6e3adfd9c2303667c /hadrian
parent30e42652ed895c3ed086e7834be46f93ba1cc61b (diff)
downloadhaskell-4acc2934952f4849c2082015d9bebef446d46545.tar.gz
hadrian/make: Detect makeindex
Previously we would simply assume that makeindex was available. Now we correctly detect it in `configure` and respect this conclusion in hadrian and make.
Diffstat (limited to 'hadrian')
-rw-r--r--hadrian/cfg/system.config.in1
-rw-r--r--hadrian/src/Builder.hs11
-rw-r--r--hadrian/src/Rules/Documentation.hs7
3 files changed, 12 insertions, 7 deletions
diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in
index 810b290d1b..e1b7684b84 100644
--- a/hadrian/cfg/system.config.in
+++ b/hadrian/cfg/system.config.in
@@ -24,6 +24,7 @@ system-ghc-pkg = @GhcPkgCmd@
tar = @TarCmd@
patch = @PatchCmd@
xelatex = @XELATEX@
+makeindex = @MAKEINDEX@
makeinfo = @MAKEINFO@
# Python 3 is required to run test driver.
diff --git a/hadrian/src/Builder.hs b/hadrian/src/Builder.hs
index b6fd3e7f2a..e51936ec77 100644
--- a/hadrian/src/Builder.hs
+++ b/hadrian/src/Builder.hs
@@ -140,6 +140,7 @@ data Builder = Alex
| Tar TarMode
| Unlit
| Xelatex
+ | Makeindex -- ^ from xelatex
deriving (Eq, Generic, Show)
instance Binary Builder
@@ -279,13 +280,8 @@ instance H.Builder Builder where
Makeinfo -> do
cmd' echo [path] "--no-split" [ "-o", output] [input]
- Xelatex -> do
- unit $ cmd' [Cwd output] [path] buildArgs
- unit $ cmd' [Cwd output] [path] buildArgs
- unit $ cmd' [Cwd output] [path] buildArgs
- unit $ cmd' [Cwd output] ["makeindex"] (input -<.> "idx")
- unit $ cmd' [Cwd output] [path] buildArgs
- unit $ cmd' [Cwd output] [path] buildArgs
+ Xelatex -> unit $ cmd' [Cwd output] [path] buildArgs
+ Makeindex -> unit $ cmd' [Cwd output] [path] buildArgs
Tar _ -> cmd' buildOptions echo [path] buildArgs
_ -> cmd' echo [path] buildArgs
@@ -326,6 +322,7 @@ systemBuilderPath builder = case builder of
Sphinx _ -> fromKey "sphinx-build"
Tar _ -> fromKey "tar"
Xelatex -> fromKey "xelatex"
+ Makeindex -> fromKey "makeindex"
_ -> error $ "No entry for " ++ show builder ++ inCfg
where
inCfg = " in " ++ quote configFile ++ " file."
diff --git a/hadrian/src/Rules/Documentation.hs b/hadrian/src/Rules/Documentation.hs
index a673e2e074..f39d52c512 100644
--- a/hadrian/src/Rules/Documentation.hs
+++ b/hadrian/src/Rules/Documentation.hs
@@ -290,6 +290,13 @@ buildSphinxPdf path = do
need (map (rstFilesDir -/-) rstFiles)
build $ target docContext (Sphinx LatexMode) [pathPath path] [dir]
checkSphinxWarnings dir
+
+ -- LaTeX "fixed point"
+ build $ target docContext Xelatex [path <.> "tex"] [dir]
+ build $ target docContext Xelatex [path <.> "tex"] [dir]
+ build $ target docContext Xelatex [path <.> "tex"] [dir]
+ build $ target docContext Makeindex [path <.> "idx"] [dir]
+ build $ target docContext Xelatex [path <.> "tex"] [dir]
build $ target docContext Xelatex [path <.> "tex"] [dir]
copyFileUntracked (dir -/- path <.> "pdf") file