summaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authordefanor <defanor@uberspace.net>2017-12-28 05:03:26 +0300
committerdefanor <defanor@uberspace.net>2017-12-28 06:39:17 +0300
commitb11b05385b5615aaf08bd245af53e8df03a193b3 (patch)
tree99304984295784f70f8f4c3e3cbc8488bf16e0a6 /Setup.hs
parentc27c14e866dfb4a3c6c85393ffd0522933c67651 (diff)
Install and enable a few uncluttering XSLTs by default
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs28
1 files changed, 17 insertions, 11 deletions
diff --git a/Setup.hs b/Setup.hs
index 1a01025..0015f6c 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -23,18 +23,24 @@ import Distribution.Simple.Setup
import System.FilePath
import System.Directory
-main = defaultMainWithHooks simpleUserHooks { postCopy = installManPage }
+main = defaultMainWithHooks simpleUserHooks { postCopy = installExtras }
-- | Installs pancake.1.
-installManPage :: Args
- -> CopyFlags
- -> PackageDescription
- -> LocalBuildInfo
- -> IO ()
-installManPage _ cf pd lbi = do
+installExtras :: Args
+ -> CopyFlags
+ -> PackageDescription
+ -> LocalBuildInfo
+ -> IO ()
+installExtras _ cf pd lbi = do
let dirs = absoluteInstallDirs pd lbi (fromFlag $ copyDest cf)
- man1 = mandir dirs </> "man1"
- fname = "pancake.1"
- target = man1 </> fname
+ verbosity = fromFlag $ copyVerbosity cf
+ -- todo: use absoluteComponentInstallDirs once will switch to
+ -- cabal 2, e.g.:
+ -- absoluteComponentInstallDirs pd lbi (localUnitId lbi)
+ -- (fromFlag $ copyDest cf)
+ -- install man page
+ let man1 = mandir dirs </> "man1"
+ manFileName = "pancake.1"
+ manTarget = man1 </> manFileName
createDirectoryIfMissing True man1
- installOrdinaryFile (fromFlag $ copyVerbosity cf) fname target
+ installOrdinaryFile verbosity manFileName manTarget