haskeline.cabal 5.46 KB
Newer Older
judah's avatar
judah committed
1
Name:           haskeline
judah's avatar
judah committed
2
Cabal-Version:  >=1.16
3
Version:        0.7.1.1
judah's avatar
judah committed
4
5
6
7
8
9
10
Category:       User Interfaces
License:        BSD3
License-File:   LICENSE
Copyright:      (c) Judah Jacobson
Author:         Judah Jacobson
Maintainer:     Judah Jacobson <judah.jacobson@gmail.com>
Category:       User Interfaces
judah's avatar
judah committed
11
12
13
14
Synopsis:       A command-line interface for user input, written in Haskell.
Description:    
                Haskeline provides a user interface for line input in command-line
                programs.  This library is similar in purpose to readline, but since
judah's avatar
judah committed
15
                it is written in Haskell it is (hopefully) more easily used in other
judah's avatar
judah committed
16
17
                Haskell programs.
                .
18
                Haskeline runs both on POSIX-compatible systems and on Windows.
19
Homepage:       http://trac.haskell.org/haskeline
judah's avatar
judah committed
20
Stability:      Experimental
21
Build-Type:     Custom
judah's avatar
judah committed
22
extra-source-files: examples/Test.hs Changelog
23

24
source-repository head
25
26
    type: git
    location: git://github.com/judah/haskeline.git
27

judah's avatar
judah committed
28
29
30
31
32
33
-- There are three main advantages to the terminfo backend over the portable,
-- "dumb" alternative.  First, it enables more efficient control sequences
-- when redrawing the input.  Second, and more importantly, it enables us
-- to draw on multiple lines, so we can wrap long input strings.  And third,
-- the backend adds some extra key sequences such as forwards delete.
--
34
35
-- (The "dumb" terminal also allows editing of long input strings, but is
-- restricted to only one line and thus only shows part of the input at once.)
36
37
38
39
flag terminfo
    Description: Use the terminfo package for POSIX consoles.
    Default: True

judah's avatar
judah committed
40
41
42
-- Note that the Setup script checks whether -liconv is necessary.  This flag
-- lets us override that decision.  When it is True, we use -liconv.  When it
-- is False, we run tests to decide.
43
44
45
46
flag libiconv
    Description: Explicitly link against the libiconv library.
    Default: False

47
48
49
50
51
flag legacy-encoding
    Description: Use the legacy iconv encoding for POSIX, even on ghc>=7.4.1.
                 (Intended for testing only.)
    Default: False

judah's avatar
judah committed
52
Library
53
54
55
    Build-depends: base >=4.3 && < 4.8, containers>=0.4 && < 0.6,
                   directory>=1.1 && < 1.3, bytestring>=0.9 && < 0.11,
                   filepath >= 1.2 && < 1.4, transformers >= 0.2 && < 0.4
judah's avatar
judah committed
56
57
58
    Default-Language: Haskell98
    Default-Extensions: 
                ForeignFunctionInterface, Rank2Types, FlexibleInstances,
59
                TypeSynonymInstances
60
                FlexibleContexts, ExistentialQuantification
61
                ScopedTypeVariables, GeneralizedNewtypeDeriving
62
                MultiParamTypeClasses, OverlappingInstances
judah's avatar
judah committed
63
                UndecidableInstances
64
                ScopedTypeVariables, CPP, DeriveDataTypeable,
65
                PatternGuards
judah's avatar
judah committed
66
    Exposed-Modules:
67
                System.Console.Haskeline
68
                System.Console.Haskeline.Completion
69
                System.Console.Haskeline.MonadException
70
                System.Console.Haskeline.History
71
                System.Console.Haskeline.IO
72
    Other-Modules:
73
                System.Console.Haskeline.Backend
judah's avatar
judah committed
74
                System.Console.Haskeline.Backend.WCWidth
75
76
77
                System.Console.Haskeline.Command
                System.Console.Haskeline.Command.Completion
                System.Console.Haskeline.Command.History
78
                System.Console.Haskeline.Command.KillRing
judah's avatar
judah committed
79
                System.Console.Haskeline.Directory
80
                System.Console.Haskeline.Emacs
judah's avatar
judah committed
81
                System.Console.Haskeline.InputT
82
                System.Console.Haskeline.Key
83
                System.Console.Haskeline.LineState
84
                System.Console.Haskeline.Monads
85
                System.Console.Haskeline.Prefs
judah's avatar
judah committed
86
                System.Console.Haskeline.RunCommand
87
                System.Console.Haskeline.Term
88
                System.Console.Haskeline.Command.Undo
89
                System.Console.Haskeline.Vi
90
    include-dirs: includes
judah's avatar
judah committed
91
    c-sources: cbits/h_wcwidth.c
92

93
94
95
96
    -- We require ghc>=7.4.1 to use the base library encodings,
    -- even though it was implemented in earlier releases,
    -- due to GHC bug #5436 which wasn't fixed until 7.4.1
    if !flag(legacy-encoding) && impl(ghc>=7.4) {
97
        cpp-options: -DUSE_GHC_ENCODINGS
judah's avatar
judah committed
98
        Other-modules: System.Console.Haskeline.Recover
99
100
    } else {
        Build-depends: utf8-string==0.3.* && >=0.3.6
101
    }
102
    if os(windows) {
103
        Build-depends: Win32>=2.0
104
        Other-modules: System.Console.Haskeline.Backend.Win32
judah's avatar
judah committed
105
        c-sources: cbits/win_console.c
judah's avatar
judah committed
106
107
        includes: win_console.h
        install-includes: win_console.h
108
109
        cpp-options: -DMINGW
    } else {
110
        Build-depends: unix>=2.0 && < 2.8
judah's avatar
judah committed
111
                        -- unix-2.3 doesn't build on ghc-6.8.1 or earlier
112
113
114
115
116
117
118
        -- Use manual encoding/decoding on ghc<7.4
        if flag (legacy-encoding) || impl(ghc<7.4) {
            c-sources: cbits/h_iconv.c
            includes: h_iconv.h
            install-includes: h_iconv.h
            Other-modules: System.Console.Haskeline.Backend.Posix.IConv
        }
119
        Other-modules: 
120
                System.Console.Haskeline.Backend.Posix
121
                System.Console.Haskeline.Backend.Posix.Encoder
122
                System.Console.Haskeline.Backend.DumbTerm
123
        if flag(terminfo) {
124
            Build-depends: terminfo>=0.3.1.3 && <0.4
125
126
127
            Other-modules: System.Console.Haskeline.Backend.Terminfo
            cpp-options: -DTERMINFO
        }
128
129
130
        if os(solaris) {
            cpp-options: -DUSE_TERMIOS_H
        }
131
132
    }
    ghc-options: -Wall