From b11b05385b5615aaf08bd245af53e8df03a193b3 Mon Sep 17 00:00:00 2001 From: defanor Date: Thu, 28 Dec 2017 05:03:26 +0300 Subject: Install and enable a few uncluttering XSLTs by default --- Setup.hs | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) (limited to 'Setup.hs') 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 -- cgit v1.2.3