diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-07-02 22:09:04 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-07-02 22:12:38 -0700 |
commit | 79764df2d5c75c63b92613316fcc8a9b8379f8cc (patch) | |
tree | 8d94fa2d3e0c3ae96ed980f8445e7be24efd59ea /Setup.hs | |
parent | fbc5384ef809a156b6242758abb20d166a23d3cc (diff) |
Added pandoc.1 to repository. Don't build as part of cabal build.
The process was too fragile. It made too many assumptions about
available libraries (which failed sometimes when sandboxes were
used). This is a low-tech solution. The only drawback is that
`man/pandoc.1` is a generated file in the repository. It will need
to be regenerated periodically when README changes.
Diffstat (limited to 'Setup.hs')
-rw-r--r-- | Setup.hs | 21 |
1 files changed, 2 insertions, 19 deletions
@@ -18,21 +18,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import Distribution.Simple import Distribution.Simple.PreProcess -import Distribution.Simple.InstallDirs (mandir) -import Distribution.PackageDescription (PackageDescription(..), Executable(..)) +import Distribution.PackageDescription (PackageDescription(..)) import System.Process ( rawSystem ) import System.FilePath ( (</>) ) import System.Directory ( findExecutable ) -import Distribution.Simple.Utils (info, notice, rawSystemExit, installOrdinaryFiles) +import Distribution.Simple.Utils (info, notice, installOrdinaryFiles) import Distribution.Simple.Setup import Distribution.Simple.LocalBuildInfo -import Distribution.Verbosity main :: IO () main = defaultMainWithHooks $ simpleUserHooks { -- enable hsb2hs preprocessor for .hsb files hookedPreProcessors = [ppBlobSuffixHandler] - , postBuild = makeManPage , postCopy = installManPage } @@ -49,20 +46,6 @@ ppBlobSuffixHandler = ("hsb", \_ _ -> return () }) -makeManPage :: Args -> BuildFlags - -> PackageDescription -> LocalBuildInfo -> IO () -makeManPage _ bf _ LocalBuildInfo{buildDir=buildDir} - = do notice verbosity "Creating man/pandoc.1" - rawSystemExit verbosity progPath args - where verbosity = fromFlagOrDefault normal $ buildVerbosity bf - progPath = buildDir </> "pandoc" </> "pandoc" - args = ["README", "-t", "man", "-s", - "--template", "man/pandoc.1.template", - "--filter", "man/capitalizeHeaders.hs", - "--filter", "man/removeNotes.hs", - "--filter", "man/removeLinks.hs", - "-o", "man/pandoc.1"] - installManPage :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO () installManPage _ flags pkg lbi = do |