diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-04-11 13:12:37 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-04-11 15:31:26 -0400 |
commit | bf71e5f4d875806e8f2623d95545c8b7a7c2d8f4 (patch) | |
tree | f7fa8439df3c89b592c89db0408324c8951c7f51 /Setup.hs | |
download | debug-me-bf71e5f4d875806e8f2623d95545c8b7a7c2d8f4.tar.gz |
some basic data types and hashing to start debug-me
This commit was sponsored by Denis Dzyubenko on Patreon.
Diffstat (limited to 'Setup.hs')
-rw-r--r-- | Setup.hs | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..80bfc03 --- /dev/null +++ b/Setup.hs @@ -0,0 +1,30 @@ +{-# OPTIONS_GHC -fno-warn-tabs #-} + +import Distribution.Simple +import Distribution.Simple.LocalBuildInfo +import Distribution.Simple.Setup +import Distribution.Simple.Utils (installOrdinaryFiles, rawSystemExit) +import Distribution.PackageDescription (PackageDescription(..)) +import Distribution.Verbosity (Verbosity) +import System.Info +import System.FilePath + +main :: IO () +main = defaultMainWithHooks simpleUserHooks + { postCopy = myPostCopy + } + +myPostCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO () +myPostCopy _ flags pkg lbi = if System.Info.os /= "mingw32" + then installManpages dest verbosity pkg lbi + else return () + where + dest = fromFlag $ copyDest flags + verbosity = fromFlag $ copyVerbosity flags + +{- See http://www.haskell.org/haskellwiki/Cabal/Developer-FAQ#Installing_manpages -} +installManpages :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () +installManpages copyDest verbosity pkg lbi = + installOrdinaryFiles verbosity dstManDir [(".", "debug-me.1")] + where + dstManDir = mandir (absoluteInstallDirs pkg lbi copyDest) </> "man1" |