Commit 43d7fa10 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel 🕺
Browse files

Convert to simple build-type

The logic in Setup.hs doesn't affect the build per-se, but rather
prints out a purely informational warning on non-windows systems
in case `terminfo` is disabled. However, the upcoming Cabal 2.0 API
breaks the Setup.hs script so it's easier to just convert to simple
build-type and avoid the additional complexity and overhead.
parent d6b5bbba
import Distribution.System
import Distribution.PackageDescription
import Distribution.Simple
import Distribution.Simple.Setup
import Control.Monad(when)
main :: IO ()
main = defaultMainWithHooks myHooks
myHooks :: UserHooks
| buildOS == Windows = simpleUserHooks
| otherwise = simpleUserHooks {
confHook = \genericDescript flags -> do
warnIfNotTerminfo flags
confHook simpleUserHooks genericDescript flags
warnIfNotTerminfo flags = when (not (hasFlagSet flags (FlagName "terminfo")))
$ mapM_ putStrLn
[ "*** Warning: running on POSIX but not building the terminfo backend. ***"
, "You may need to install the terminfo package manually, e.g. with"
, "\"cabal install terminfo\"; or, use \"-fterminfo\" when configuring or"
, "installing this package."
hasFlagSet :: ConfigFlags -> FlagName -> Bool
hasFlagSet cflags flag = Just True == lookup flag (configConfigurationsFlags cflags)
main = defaultMain
......@@ -19,7 +19,7 @@ Description:
Stability: Stable
Build-Type: Custom
Build-Type: Simple
extra-source-files: examples/Test.hs Changelog includes/*.h
source-repository head
......@@ -37,6 +37,7 @@ source-repository head
flag terminfo
Description: Use the terminfo package for POSIX consoles.
Default: True
Manual: True
-- We require ghc>=7.4.1 (base>=4.5) to use the base library encodings, even
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment