binary.cabal 4.75 KB
Newer Older
Don Stewart's avatar
Don Stewart committed
1
name:            binary
Oleg Grenrus's avatar
Oleg Grenrus committed
2
version:         0.8.0.0
Don Stewart's avatar
Don Stewart committed
3
4
license:         BSD3
license-file:    LICENSE
Lennart Kolmodin's avatar
Lennart Kolmodin committed
5
author:          Lennart Kolmodin <kolmodin@gmail.com>
6
maintainer:      Lennart Kolmodin, Don Stewart <dons00@gmail.com>
7
homepage:        https://github.com/kolmodin/binary
8
description:     Efficient, pure binary serialisation using lazy ByteStrings.
9
                 Haskell values may be encoded to and from binary formats,
Don Stewart's avatar
Don Stewart committed
10
                 written to disk as binary, or sent over the network.
Lennart Kolmodin's avatar
Lennart Kolmodin committed
11
12
                 The format used can be automatically generated, or
                 you can choose to implement a custom format if needed.
Don Stewart's avatar
Don Stewart committed
13
14
15
                 Serialisation speeds of over 1 G\/sec have been observed,
                 so this library should be suitable for high performance
                 scenarios.
Don Stewart's avatar
Don Stewart committed
16
synopsis:        Binary serialisation for Haskell values using lazy ByteStrings
Don Stewart's avatar
Don Stewart committed
17
category:        Data, Parsing
Don Stewart's avatar
Don Stewart committed
18
stability:       provisional
19
build-type:      Simple
20
cabal-version:   >= 1.8
21
tested-with:     GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.4, GHC == 7.10.2
22
extra-source-files:
23
  README.md changelog.md docs/hcar/binary-Lb.tex tools/derive/*.hs
24
25
26
27

-- from the benchmark 'bench'
extra-source-files:
  benchmarks/CBenchmark.h
28

29
30
31
32
source-repository head
  type: git
  location: git://github.com/kolmodin/binary.git

33
library
34
  build-depends:   base >= 3.0 && < 5, bytestring >= 0.9, containers, array
Don Stewart's avatar
Don Stewart committed
35
  hs-source-dirs:  src
36
37
38
  exposed-modules: Data.Binary,
                   Data.Binary.Put,
                   Data.Binary.Get,
39
                   Data.Binary.Get.Internal,
40
                   Data.Binary.Builder,
tibbe's avatar
tibbe committed
41
42
                   Data.Binary.Builder.Internal

43
44
  other-modules:   Data.Binary.Builder.Base,
                   Data.Binary.Class
45

46
47
48
  if impl(ghc >= 7.2.1)
    cpp-options: -DGENERICS
    other-modules: Data.Binary.Generic
49
50
51
    if impl(ghc <= 7.6)
      -- prior to ghc-7.4 generics lived in ghc-prim
      build-depends: ghc-prim
52

Don Stewart's avatar
tweaks    
Don Stewart committed
53
  ghc-options:     -O2 -Wall -fliberate-case-threshold=1000
Don Stewart's avatar
Don Stewart committed
54

55
56
57
58
59
-- Due to circular dependency, we cannot make any of the test-suites or
-- benchmark depend on the binary library. Instead, for each test-suite and
-- benchmark, we include the source directory of binary and build-depend on all
-- the dependencies binary has.

60
61
test-suite qc
  type:  exitcode-stdio-1.0
62
  hs-source-dirs: src tests
63
  main-is: QC.hs
64
65
66
  other-modules:
    Action
    Arbitrary
67
  build-depends:
68
    base >= 3.0 && < 5,
69
70
71
    bytestring >= 0.9,
    random>=1.0.1.0,
    test-framework,
72
    test-framework-quickcheck2 >= 0.3,
73
    QuickCheck>=2.8
74

75
76
  -- build dependencies from using binary source rather than depending on the library
  build-depends: array, containers
Lennart Kolmodin's avatar
Lennart Kolmodin committed
77
  ghc-options: -Wall -O2 -threaded
Lennart Kolmodin's avatar
Lennart Kolmodin committed
78

79
80
test-suite read-write-file
  type:  exitcode-stdio-1.0
81
  hs-source-dirs: src tests
82
83
84
85
86
87
88
89
90
  main-is: File.hs
  build-depends:
    base >= 3.0 && < 5,
    bytestring >= 0.9,
    Cabal,
    directory,
    filepath,
    HUnit

91
92
  -- build dependencies from using binary source rather than depending on the library
  build-depends: array, containers
93
94
  ghc-options: -Wall

Lennart Kolmodin's avatar
Lennart Kolmodin committed
95
96
benchmark bench
  type: exitcode-stdio-1.0
97
  hs-source-dirs: src benchmarks
Lennart Kolmodin's avatar
Lennart Kolmodin committed
98
  main-is: Benchmark.hs
99
  other-modules: MemBench
Lennart Kolmodin's avatar
Lennart Kolmodin committed
100
101
102
  build-depends:
    base >= 3.0 && < 5,
    bytestring
103
104
  -- build dependencies from using binary source rather than depending on the library
  build-depends: array, containers
Lennart Kolmodin's avatar
Lennart Kolmodin committed
105
106
107
108
109
110
  c-sources: benchmarks/CBenchmark.c
  include-dirs: benchmarks
  ghc-options: -O2

benchmark get
  type: exitcode-stdio-1.0
111
  hs-source-dirs: src benchmarks
Lennart Kolmodin's avatar
Lennart Kolmodin committed
112
113
  main-is: Get.hs
  build-depends:
114
    attoparsec,
Lennart Kolmodin's avatar
Lennart Kolmodin committed
115
116
    base >= 3.0 && < 5,
    bytestring,
117
    cereal,
118
    criterion == 1.*,
Lennart Kolmodin's avatar
Lennart Kolmodin committed
119
120
    deepseq,
    mtl
121
122
  -- build dependencies from using binary source rather than depending on the library
  build-depends: array, containers
123
  ghc-options: -O2 -Wall
Lennart Kolmodin's avatar
Lennart Kolmodin committed
124

125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
benchmark generics-bench
  type: exitcode-stdio-1.0
  hs-source-dirs: src benchmarks
  main-is: GenericsBench.hs
  build-depends:
    base >= 3.0 && < 5,
    bytestring,
    Cabal == 1.22.*,
    directory,
    filepath,
    tar,
    unordered-containers,
    zlib,
    criterion
  other-modules:
    GenericsBenchCache
    GenericsBenchTypes
  -- build dependencies from using binary source rather than depending on the library
  build-depends: array, containers
  ghc-options: -O2 -Wall
  if impl(ghc >= 7.2.1)
    cpp-options: -DGENERICS
    other-modules: Data.Binary.Generic
    if impl(ghc <= 7.6)
      -- prior to ghc-7.4 generics lived in ghc-prim
      build-depends: ghc-prim

Lennart Kolmodin's avatar
Lennart Kolmodin committed
152
153
benchmark builder
  type: exitcode-stdio-1.0
154
  hs-source-dirs: src benchmarks
Lennart Kolmodin's avatar
Lennart Kolmodin committed
155
156
157
158
  main-is: Builder.hs
  build-depends:
    base >= 3.0 && < 5,
    bytestring,
159
    criterion == 1.*,
Lennart Kolmodin's avatar
Lennart Kolmodin committed
160
161
    deepseq,
    mtl
162
163
  -- build dependencies from using binary source rather than depending on the library
  build-depends: array, containers
Lennart Kolmodin's avatar
Lennart Kolmodin committed
164
  ghc-options: -O2