Revert "Setup.hs: Better way of handling man page building."

This reverts commit ed061b91c8.
This commit is contained in:
John MacFarlane 2013-10-08 20:52:56 -07:00
parent ed061b91c8
commit 627c54011b
2 changed files with 9 additions and 12 deletions

View file

@ -4,7 +4,7 @@ import Distribution.Simple
import Distribution.Simple.PreProcess import Distribution.Simple.PreProcess
import Distribution.Simple.Setup import Distribution.Simple.Setup
(copyDest, copyVerbosity, fromFlag, installVerbosity, BuildFlags(..)) (copyDest, copyVerbosity, fromFlag, installVerbosity, BuildFlags(..))
import Distribution.PackageDescription (PackageDescription(..), Executable(..), BuildInfo(..)) import Distribution.PackageDescription (PackageDescription(..), Executable(..))
import Distribution.Simple.LocalBuildInfo import Distribution.Simple.LocalBuildInfo
(LocalBuildInfo(..), absoluteInstallDirs) (LocalBuildInfo(..), absoluteInstallDirs)
import Distribution.Verbosity ( Verbosity, silent ) import Distribution.Verbosity ( Verbosity, silent )
@ -19,19 +19,18 @@ import System.Exit
main :: IO () main :: IO ()
main = do main = do
defaultMainWithHooks $ simpleUserHooks { defaultMainWithHooks $ simpleUserHooks {
buildHook = \pkgdescr -> postBuild = makeManPages
(buildHook simpleUserHooks) pkgdescr{ executables =
[x | x <- executables pkgdescr,
exeName x /= "make-pandoc-man-pages"] ++
[x{ buildInfo = (buildInfo x){ buildable = True } }
| x <- executables pkgdescr,
exeName x == "make-pandoc-man-pages"] }
, postBuild = makeManPages
, postCopy = \ _ flags pkg lbi -> , postCopy = \ _ flags pkg lbi ->
installManpages pkg lbi (fromFlag $ copyVerbosity flags) installManpages pkg lbi (fromFlag $ copyVerbosity flags)
(fromFlag $ copyDest flags) (fromFlag $ copyDest flags)
, postInst = \ _ flags pkg lbi -> , postInst = \ _ flags pkg lbi ->
installManpages pkg lbi (fromFlag $ installVerbosity flags) NoCopyDest installManpages pkg lbi (fromFlag $ installVerbosity flags) NoCopyDest
, copyHook = \pkgdescr ->
(copyHook simpleUserHooks) pkgdescr{ executables =
[x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }
, instHook = \pkgdescr ->
(instHook simpleUserHooks) pkgdescr{ executables =
[x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }
, hookedPreProcessors = [ppBlobSuffixHandler] , hookedPreProcessors = [ppBlobSuffixHandler]
} }
exitWith ExitSuccess exitWith ExitSuccess

View file

@ -361,12 +361,10 @@ Executable pandoc
Main-Is: pandoc.hs Main-Is: pandoc.hs
Buildable: True Buildable: True
-- NOTE: A trick in Setup.hs makes sure this won't be installed:
Executable make-pandoc-man-pages Executable make-pandoc-man-pages
Main-Is: make-pandoc-man-pages.hs Main-Is: make-pandoc-man-pages.hs
Hs-Source-Dirs: man Hs-Source-Dirs: man
Buildable: False
-- Setup.hs will make this look buildable in build phase,
-- but it won't be copied/installed
Build-Depends: pandoc, Build-Depends: pandoc,
base >= 4.2 && < 5, base >= 4.2 && < 5,
directory >= 1 && < 1.3, directory >= 1 && < 1.3,