[Git][ghc/ghc][wip/manpage-dir] packaging: Build manpage in separate directory to other documentation

Matthew Pickering (@mpickering) gitlab at gitlab.haskell.org
Mon Aug 14 08:23:42 UTC 2023



Matthew Pickering pushed to branch wip/manpage-dir at Glasgow Haskell Compiler / GHC


Commits:
a8b05de5 by Matthew Pickering at 2023-08-14T09:23:31+01:00
packaging: Build manpage in separate directory to other documentation

We were installing two copies of the manpage:

* One useless one in the `share/doc` folder, because we copy the doc/
  folder into share/
* The one we deliberately installed into `share/man` etc

The solution is to build the manpage into the `manpage` directory when
building the bindist, and then just install it separately.

Fixes #23707

- - - - -


3 changed files:

- hadrian/bindist/Makefile
- hadrian/src/Rules/BinaryDist.hs
- hadrian/src/Rules/Documentation.hs


Changes:

=====================================
hadrian/bindist/Makefile
=====================================
@@ -201,7 +201,7 @@ install_docs:
 	fi
 
 MAN_SECTION := 1
-MAN_PAGES := doc/users_guide/build-man/ghc.1
+MAN_PAGES := manpage/ghc.1
 
 .PHONY: install_man
 install_man:


=====================================
hadrian/src/Rules/BinaryDist.hs
=====================================
@@ -246,6 +246,10 @@ bindistRules = do
         -- reference. See #20802.
         copyDirectory ("utils" -/- "completion") bindistFilesDir
 
+        -- Copy the manpage into the binary distribution
+        whenM (liftIO (IO.doesDirectoryExist (root -/- "manpage"))) $ do
+          copyDirectory (root -/- "manpage") bindistFilesDir
+
         -- These scripts are only necessary in the configure/install
         -- workflow which is not supported on windows.
         -- TODO: Instead of guarding against windows, we could offer the


=====================================
hadrian/src/Rules/Documentation.hs
=====================================
@@ -43,7 +43,7 @@ archiveRoot :: FilePath
 archiveRoot = docRoot -/- "archives"
 
 manPageBuildPath :: FilePath
-manPageBuildPath = docRoot -/- "users_guide/build-man/ghc.1"
+manPageBuildPath = "manpage" -/- "ghc.1"
 
 -- TODO: Get rid of this hack.
 docContext :: Context



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a8b05de5718aae4b48c1bf65772ba989c2ec5fe2

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/a8b05de5718aae4b48c1bf65772ba989c2ec5fe2
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20230814/b76fd977/attachment-0001.html>


More information about the ghc-commits mailing list