aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2016-05-31 13:58:13 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2016-05-31 13:58:13 -0400
commit555bd5d6b8f805cf5921bb67466c632c9db005e9 (patch)
tree09d3f39006e35f0bbeb9c8959470efcef2e7f6f6 /Setup.hs
parenta209897585b11bb93c2d56fab65a3b09e242d341 (diff)
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.
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/Setup.hs b/Setup.hs
index 47bef5e31..fe06a08b1 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -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