Remove Makefile from cabal tarball; man page building is now handled by a small haskell program.

This actually runs faster than building the man pages from the makefile
did. But the main purpose is to let Setup.hs import Build.Mans and so not
need the makefile.
This commit is contained in:
Joey Hess 2016-05-31 13:58:13 -04:00
parent 056a7f67a8
commit f4489cc415
Failed to extract signature
7 changed files with 95 additions and 33 deletions

View file

@ -14,11 +14,13 @@ import Control.Applicative
import Control.Monad
import System.Directory
import Data.List
import Data.Maybe
import Control.Exception
import qualified System.Info
import qualified Build.DesktopFile as DesktopFile
import qualified Build.Configure as Configure
import Build.Mans (buildMans)
import Utility.SafeCommand
main :: IO ()
@ -51,13 +53,10 @@ installManpages copyDest verbosity pkg lbi =
installOrdinaryFiles verbosity dstManDir =<< srcManpages
where
dstManDir = mandir (absoluteInstallDirs pkg lbi copyDest) </> "man1"
srcManpages = do
havemans <- boolSystem "make" [Param "mans"]
if havemans
then zip (repeat "man")
. filter (".1" `isSuffixOf`)
<$> getDirectoryContents "man"
else return []
-- If mdwn2man fails, perhaps because perl is not available,
-- we just skip installing man pages.
srcManpages = zip (repeat "man") . map takeFileName . catMaybes
<$> buildMans
installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
installDesktopFile copyDest _verbosity pkg lbi