[commit: packages/haskeline] master: Convert to simple build-type (43d7fa1)
git at git.haskell.org
git at git.haskell.org
Fri Apr 21 06:41:44 UTC 2017
Repository : ssh://git@git.haskell.org/haskeline
On branch : master
Link : http://git.haskell.org/packages/haskeline.git/commitdiff/43d7fa106027fcd4ec7f443923a8dd5b8c169f9c
>---------------------------------------------------------------
commit 43d7fa106027fcd4ec7f443923a8dd5b8c169f9c
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Thu Apr 20 22:50:40 2017 +0200
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.
>---------------------------------------------------------------
43d7fa106027fcd4ec7f443923a8dd5b8c169f9c
Setup.hs | 30 +-----------------------------
haskeline.cabal | 3 ++-
2 files changed, 3 insertions(+), 30 deletions(-)
diff --git a/Setup.hs b/Setup.hs
index 68ce844..9a994af 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,30 +1,2 @@
-import Distribution.System
-import Distribution.PackageDescription
import Distribution.Simple
-import Distribution.Simple.Setup
-
-import Control.Monad(when)
-
-main :: IO ()
-main = defaultMainWithHooks myHooks
-
-myHooks :: UserHooks
-myHooks
- | 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
diff --git a/haskeline.cabal b/haskeline.cabal
index ace63ec..c031c2f 100644
--- a/haskeline.cabal
+++ b/haskeline.cabal
@@ -19,7 +19,7 @@ Description:
Homepage: http://trac.haskell.org/haskeline
Bug-Reports: https://github.com/judah/haskeline/issues
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
Library
-- We require ghc>=7.4.1 (base>=4.5) to use the base library encodings, even
More information about the ghc-commits
mailing list