haskeline.cabal 5.58 KB
Newer Older
judah's avatar
judah committed
1
Name:           haskeline
2
Cabal-Version:  >=1.6
judah's avatar
judah committed
3
Version:        0.7.0.4
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 CHANGES
23

24
25
26
27
source-repository head
    type: darcs
    location: http://code.haskell.org/haskeline

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
    if impl(ghc>=6.11) {
54
        Build-depends: base >=4.1 && < 4.8, containers>=0.1 && < 0.6, directory>=1.0 && < 1.3,
55
                       bytestring>=0.9 && < 0.11
56
57
    }
    else {
58
59
        Build-depends: base>=3 && <4.1 , containers>=0.1 && < 0.3, directory==1.0.*,
                       bytestring==0.9.*
60
    }
61
    Build-depends:  filepath >= 1.1 && < 1.4, transformers >= 0.2 && < 0.4
judah's avatar
judah committed
62
    Extensions:     ForeignFunctionInterface, Rank2Types, FlexibleInstances,
63
                TypeSynonymInstances
64
                FlexibleContexts, ExistentialQuantification
65
                ScopedTypeVariables, GeneralizedNewtypeDeriving
66
                MultiParamTypeClasses, OverlappingInstances
judah's avatar
judah committed
67
                UndecidableInstances
68
                ScopedTypeVariables, CPP, DeriveDataTypeable,
69
                PatternGuards
judah's avatar
judah committed
70
    Exposed-Modules:
71
                System.Console.Haskeline
72
                System.Console.Haskeline.Completion
73
                System.Console.Haskeline.MonadException
74
                System.Console.Haskeline.History
75
                System.Console.Haskeline.IO
76
    Other-Modules:
77
                System.Console.Haskeline.Backend
judah's avatar
judah committed
78
                System.Console.Haskeline.Backend.WCWidth
79
80
81
                System.Console.Haskeline.Command
                System.Console.Haskeline.Command.Completion
                System.Console.Haskeline.Command.History
82
                System.Console.Haskeline.Command.KillRing
judah's avatar
judah committed
83
                System.Console.Haskeline.Directory
84
                System.Console.Haskeline.Emacs
judah's avatar
judah committed
85
                System.Console.Haskeline.InputT
86
                System.Console.Haskeline.Key
87
                System.Console.Haskeline.LineState
88
                System.Console.Haskeline.Monads
89
                System.Console.Haskeline.Prefs
judah's avatar
judah committed
90
                System.Console.Haskeline.RunCommand
91
                System.Console.Haskeline.Term
92
                System.Console.Haskeline.Command.Undo
93
                System.Console.Haskeline.Vi
94
    include-dirs: includes
judah's avatar
judah committed
95
    c-sources: cbits/h_wcwidth.c
96

97
98
99
100
    -- 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) {
101
        cpp-options: -DUSE_GHC_ENCODINGS
judah's avatar
judah committed
102
        Other-modules: System.Console.Haskeline.Recover
103
104
    } else {
        Build-depends: utf8-string==0.3.* && >=0.3.6
105
    }
106
    if os(windows) {
107
        Build-depends: Win32>=2.0
108
        Other-modules: System.Console.Haskeline.Backend.Win32
judah's avatar
judah committed
109
        c-sources: cbits/win_console.c
judah's avatar
judah committed
110
111
        includes: win_console.h
        install-includes: win_console.h
112
113
        cpp-options: -DMINGW
    } else {
114
        Build-depends: unix>=2.0 && < 2.8
judah's avatar
judah committed
115
                        -- unix-2.3 doesn't build on ghc-6.8.1 or earlier
116
117
118
119
120
121
122
        -- 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
        }
123
        Other-modules: 
124
                System.Console.Haskeline.Backend.Posix
125
                System.Console.Haskeline.Backend.Posix.Encoder
126
                System.Console.Haskeline.Backend.DumbTerm
127
        if flag(terminfo) {
128
            Build-depends: terminfo>=0.3.1.3 && <0.4
129
130
131
            Other-modules: System.Console.Haskeline.Backend.Terminfo
            cpp-options: -DTERMINFO
        }
132
133
134
        if os(solaris) {
            cpp-options: -DUSE_TERMIOS_H
        }
135
136
    }
    ghc-options: -Wall