Skip to content

Commit 463fc49

Browse files
committed
Add a flag to disable the example executable (and test).
GHC's build currently can't handle packages with both a library and a binary. Help out by allowing a build to disable the executable, which is only needed for the test. (So disable the test as well.) Also bump the version to 0.8.0.1.
1 parent ff19768 commit 463fc49

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

Changelog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Changed in version 0.8.0.1:
2+
* Add a Cabal flag to disable the example executable as well as
3+
the test that uses it.
14
Changed in version 0.8.0.0:
25
* Breaking changes:
36
* Add a `MonadFail` instance for `InputT`.

haskeline.cabal

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: haskeline
22
Cabal-Version: >=1.10
3-
Version: 0.8.0.0
3+
Version: 0.8.0.1
44
Category: User Interfaces
55
License: BSD3
66
License-File: LICENSE
@@ -38,6 +38,13 @@ flag terminfo
3838
Default: True
3939
Manual: True
4040

41+
-- Help the GHC build by making it possible to disable the extra binary.
42+
-- TODO: Make GHC handle packages with both a library and an executable.
43+
flag examples
44+
Description: Enable executable components used for tests.
45+
Default: True
46+
Manual: True
47+
4148
Library
4249
-- We require ghc>=7.4.1 (base>=4.5) to use the base library encodings, even
4350
-- though it was implemented in earlier releases, due to GHC bug #5436 which
@@ -117,15 +124,22 @@ test-suite haskeline-tests
117124
hs-source-dirs: tests
118125
Default-Language: Haskell98
119126

120-
if os(windows)
127+
if os(windows) {
121128
buildable: False
129+
}
130+
if !flag(examples) {
131+
buildable: False
132+
}
122133
Main-Is: Unit.hs
123134
Build-depends: base, containers, text, bytestring, HUnit, process, unix
124135
Other-Modules: RunTTY, Pty
125136
build-tool-depends: haskeline:haskeline-examples-Test
126137

127138
-- The following program is used by unit tests in `tests` executable
128139
Executable haskeline-examples-Test
140+
if !flag(examples) {
141+
buildable: False
142+
}
129143
Build-depends: base, containers, haskeline
130144
Default-Language: Haskell2010
131145
hs-source-dirs: examples

0 commit comments

Comments
 (0)