2Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>
4This program is free software; you can redistribute it and/or modify
5it under the terms of the GNU General Public License as published by
6the Free Software Foundation; either version 2 of the License, or
7(at your option) any later version.
9This program is distributed in the hope that it will be useful,
10but WITHOUT ANY WARRANTY; without even the implied warranty of
11MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12GNU General Public License for more details.
14You should have received a copy of the GNU General Public License
15along with this program; if not, write to the Free Software
16Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19import Distribution.Simple
20import Distribution.Simple.PreProcess
21import Distribution.PackageDescription (PackageDescription(..), Executable(..))
22import System.Process ( rawSystem )
23import System.FilePath ( (</>) )
24import System.Directory ( findExecutable )
25import Distribution.Simple.Utils (info)
28main = defaultMainWithHooks $ simpleUserHooks {
29 -- enable hsb2hs preprocessor for .hsb files
30 hookedPreProcessors = [ppBlobSuffixHandler]
31 -- ensure that make-pandoc-man-pages doesn't get installed to bindir
32 , copyHook = \pkgdescr ->
33 (copyHook simpleUserHooks) pkgdescr{ executables =
34 [x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }
35 , instHook = \pkgdescr ->
36 (instHook simpleUserHooks) pkgdescr{ executables =
37 [x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }
40ppBlobSuffixHandler :: PPSuffixHandler
41ppBlobSuffixHandler = ("hsb", \_ _ ->
43 platformIndependent = True,
44 runPreProcessor = mkSimplePreProcessor $ \infile outfile verbosity ->
45 do info verbosity $ "Preprocessing " ++ infile ++ " to " ++ outfile
46 hsb2hsPath <- findExecutable "hsb2hs"
48 Just p -> rawSystem p [infile, infile, outfile]
49 Nothing -> error "hsb2hs is needed to build this program: cabal install hsb2hs"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list