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.
This commit is contained in:
John MacFarlane 2015-07-02 22:09:04 -07:00
parent fbc5384ef8
commit 79764df2d5
6 changed files with 4352 additions and 28 deletions

10
INSTALL
View file

@ -75,12 +75,12 @@ Quick install
--extra-include-dirs=/usr/local/Cellar/icu4c/51.1/include \
-funicode_collation text-icu pandoc-citeproc
The `pandoc.1` man page will be built and installed automatically.
The build process shows you where it is installed: you may need
to set your `MANPATH` accordingly.
The `pandoc.1` man page will be installed automatically. cabal shows
you where it is installed: you may need to set your `MANPATH`
accordingly. If `README` has been modified, the man page can be
rebuilt: `make man/pandoc.1`.
The `pandoc-citeproc.1` man page will also be built and installed
automatically.
The `pandoc-citeproc.1` man page will also be installed automatically.
[GHC]: http://www.haskell.org/ghc/
[Haskell platform]: http://hackage.haskell.org/platform/

View file

@ -27,19 +27,26 @@ install: full
cabal copy
cabal register
dist:
dist: man/pandoc.1
cabal sdist
rm -rf "pandoc-${version}"
tar xvzf dist/pandoc-${version}.tar.gz
cd pandoc-${version}
cabal configure ${CABALARGS} && cabal build && cabal test && cd .. && rm -rf "pandoc-${version}"
debpkg:
debpkg: man/pandoc.1
./make_deb.sh
osxpkg:
osxpkg: man/pandoc.1
./make_osx_package.sh
man/pandoc.1: README man/pandoc.1.template
pandoc $< -t man -s --template man/pandoc.1.template \
--filter man/capitalizeHeaders.hs \
--filter man/removeNotes.hs \
--filter man/removeLinks.hs \
-o $@
download_stats:
curl https://api.github.com/repos/jgm/pandoc/releases | \
jq '[.[] | .assets | .[] | {name: .name, download_count: .download_count}]'

View file

@ -2,6 +2,8 @@ _ Test, on linux, windows, mac (inc. website demos)
_ Finalize changelog
_ man man/pandoc.1 and commit if needed
_ Tag release in git
_ Tag templates

View file

@ -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

4332
man/pandoc.1 Normal file

File diff suppressed because it is too large Load diff

View file

@ -109,6 +109,7 @@ Data-Files:
Extra-Source-Files:
-- documentation
INSTALL, BUGS, CONTRIBUTING.md, changelog
man/pandoc.1
-- files needed to build man page
man/capitalizeHeaders.hs
man/removeNotes.hs
@ -209,7 +210,6 @@ Extra-Source-Files:
tests/epub/*.native
tests/txt2tags.t2t
tests/twiki-reader.twiki
Extra-Tmp-Files: man/pandoc.1
Source-repository head
type: git