1cabal-version:       3.0
2
3-- ^^^ `cabal-version` is not the version of cabal-install nor
4-- that of the Cabal library. It's the cabal specification version.
5-- c.f. https://www.haskell.org/cabal/users-guide/file-format-changelog.html#spec-history
6
7
8-- Initial cogent.cabal generated by cabal init.  For further documentation,
9-- see http://haskell.org/cabal/users-guide/
10
11name:                cogent
12version:             3.0.1
13-- synopsis:
14-- description:
15-- license:
16-- license-file:        LICENSE
17
18author:              The Cogent Team and Contributors
19maintainer:          Zilin Chen <zilin.chen@data61.csiro.au>
20                     Vincent Jackson <v.jackson@unsw.edu.au>
21homepage:            https://ts.data61.csiro.au/projects/TS/cogent.pml
22bug-reports:         https://github.com/NICTA/cogent/issues
23-- copyright:
24-- category:
25build-type:          Custom
26tested-with:         GHC==8.4.3, GHC==8.6.5, GHC==8.8.3
27
28
29data-files:
30  static/jquery.min.js
31  static/style.css
32  static/toc.min.js
33  static/logo.png
34  lib/cogent-defns.h
35  lib/gum/common/*.cogent
36  lib/gum/fs/linux/*.cogent
37  lib/gum/kernel/linux/*.cogent
38  lib/gum/test/test.cogent
39  lib/gum/anti/*.ac
40  lib/gum/anti/abstract/*.ah
41  lib/c/linux/abstract-defns.h
42  lib/c/rbt.h
43  isa/ROOT
44  isa/*.thy
45
46flag builtin-arrays
47  description: Enable experimental arrays with SMT solving
48  manual: True
49  default: False
50
51flag refinement-types
52  description: Enable experimental refinement types features
53  manual: True
54  default: False
55
56flag docgent
57  description: Enable documentation generator (drastically embiggens build time)
58  manual: True
59  default: False
60
61flag haskell-backend
62  description: Enable PBT/Haskell backend
63  manual: True
64  default: False
65
66flag llvm-backend
67  description: Enable LLVM backend
68  manual: True
69  default: False
70
71
72source-repository head
73  type:     git
74  location: https://github.com/NICTA/cogent/
75
76custom-setup
77  setup-depends:
78                base >= 4.10 && < 4.15
79              , Cabal >= 3.0
80                -- ^^^ 3.0 is needed as we use Cabal in Setup.hs
81              , directory >= 1.2
82              , filepath >= 1.4.0.0
83              , process >= 1.2.0.0
84
85
86library
87  hs-source-dirs: src
88  exposed-modules:
89                Cogent.C
90              , Cogent.C.Expr
91              , Cogent.C.Monad
92              , Cogent.C.Render
93              , Cogent.C.Syntax
94              , Cogent.C.Type
95              , Cogent.Common.Syntax
96              , Cogent.Common.Types
97              , Cogent.Compiler
98              , Cogent.Context
99              , Cogent.Core
100              , Cogent.Dargent.Allocation
101              , Cogent.Dargent.CodeGen
102              , Cogent.Dargent.Core
103              , Cogent.Dargent.Desugar
104              , Cogent.Dargent.Surface
105              , Cogent.Dargent.TypeCheck
106              , Cogent.Dargent.Util
107              , Cogent.Desugar
108              , Cogent.GetOpt
109              , Cogent.Glue
110              , Cogent.Inference
111              , Cogent.Interpreter
112              , Cogent.Isabelle
113              , Cogent.Isabelle.ACInstall
114              , Cogent.Isabelle.AllRefine
115              , Cogent.Isabelle.Compound
116              , Cogent.Isabelle.CorresProof
117              , Cogent.Isabelle.CorresSetup
118              , Cogent.Isabelle.Deep
119              , Cogent.Isabelle.GraphGen
120              , Cogent.Isabelle.MonoProof
121              , Cogent.Isabelle.NormalProof
122              , Cogent.Isabelle.ProofGen
123              , Cogent.Isabelle.Root
124              , Cogent.Isabelle.Shallow
125              , Cogent.Isabelle.ShallowTable
126              , Cogent.Isabelle.TypeProofs
127              , Cogent.Isabelle.IsabelleName
128              , Cogent.Mono
129              , Cogent.Normal
130              , Cogent.Parser
131              , Cogent.PrettyPrint
132              , Cogent.Preprocess
133              , Cogent.Quote
134              , Cogent.Reorganizer
135              , Cogent.Simplify
136              , Cogent.SuParser
137              , Cogent.Surface
138              , Cogent.TypeCheck
139              , Cogent.TypeCheck.ARow
140              , Cogent.TypeCheck.Base
141              , Cogent.TypeCheck.Errors
142              , Cogent.TypeCheck.Generator
143              , Cogent.TypeCheck.LRow
144              , Cogent.TypeCheck.Post
145              , Cogent.TypeCheck.Row
146              , Cogent.TypeCheck.Solver
147              , Cogent.TypeCheck.Solver.Simplify
148              , Cogent.TypeCheck.Solver.Unify
149              , Cogent.TypeCheck.Solver.Normalise
150              , Cogent.TypeCheck.Solver.Equate
151              , Cogent.TypeCheck.Solver.Goal
152              , Cogent.TypeCheck.Solver.Monad
153              , Cogent.TypeCheck.Solver.Rewrite
154              , Cogent.TypeCheck.Solver.SinkFloat
155              , Cogent.TypeCheck.Solver.Default
156              , Cogent.TypeCheck.Solver.Util
157              , Cogent.TypeCheck.Subst
158              , Cogent.TypeCheck.Util
159              , Cogent.Util
160              , Data.DList
161              , Data.Ex
162              , Data.Fin
163              , Data.LeafTree
164              , Data.Nat
165              , Data.OMap
166              , Data.PropEq
167              , Data.Vec
168              -- Generated
169              , Paths_cogent
170              , Version_cogent
171
172  autogen-modules:
173                Paths_cogent
174              , Version_cogent
175
176  build-depends:
177                ansi-wl-pprint >= 0.6
178              , base >= 4.10 && < 4.15
179              , binary
180              , bytestring >= 0.10 
181              , containers >= 0.5.8
182              , cpphs >= 1.19
183              , directory >= 1.2
184              , filepath >= 1.4.0.0 
185              , graph-wrapper >= 0.2
186              , isa-parser >= 0.1.0.0
187              , language-c-quote >= 0.10.2
188              , mainland-pretty >= 0.2.6
189              , microlens >= 0.4.9
190              , microlens-ghc >= 0.4.9
191              , microlens-mtl >= 0.1.11
192              , microlens-th >= 0.4.1
193              , mtl >= 2.2.1
194              , parsec >= 3.1
195              , pretty-show-ansi-wl >= 1.5
196              , srcloc >= 0.4
197              , syb >= 0.4
198              , template-haskell
199              , transformers >= 0.4.2
200  if flag(haskell-backend)
201    exposed-modules: Cogent.Haskell.FFIGen
202                   , Cogent.Haskell.HscGen
203                   , Cogent.Haskell.HscSyntax
204                   , Cogent.Haskell.Shallow
205    cpp-options: -DWITH_HASKELL
206    build-depends: haskell-src-exts >= 1.19, pretty
207  if flag(llvm-backend)
208    exposed-modules: Cogent.LLVM.Compile
209    cpp-options: -DWITH_LLVM
210    build-depends: llvm-hs >= 9.0.1, llvm-hs-pure >= 9.0.0
211  if flag(builtin-arrays) || flag(refinement-types)
212    exposed-modules: 
213                     Cogent.TypeCheck.SMT
214                   , Cogent.TypeCheck.Solver.SMT
215    build-depends: sbv >= 8.0
216  if flag(builtin-arrays)
217    cpp-options: -DBUILTIN_ARRAYS
218  if flag(refinement-types)
219    cpp-options: -DREFINEMENT_TYPES
220  if flag(docgent)
221    cpp-options: -DWITH_DOCGENT
222    build-depends: ansi-terminal >= 0.6
223                 , pandoc >= 1.19.2.4
224                 , pandoc-types >= 1.16
225                 , shakespeare >= 2.0
226                 , text >= 0.11.3.1
227                 , data-default >=0.5
228                 , blaze-html >= 0.8.1
229                 , blaze-markup >= 0.7
230    exposed-modules: Cogent.DocGent
231
232  default-language: Haskell2010
233  default-extensions: CPP NoMonadFailDesugaring
234  build-tool-depends:
235              alex:alex
236            , happy:happy
237  ghc-options:
238    -- -Wall
239    -- -Werror
240    -fno-warn-name-shadowing
241    -fno-warn-missing-signatures
242    -fno-warn-unused-matches
243    -O2
244    -optP-Wno-nonportable-include-path
245    -- -rtsopts
246    -- +RTS -K256M
247  -- if impl(ghc >= 7.10.1)
248  --  ghc-options: -fno-warn-unticked-promoted-constructors
249
250
251Executable cogent
252  main-is: Main.hs
253
254  build-depends:
255                cogent
256              , ansi-wl-pprint >= 0.6
257              , atomic-write >= 0.2.0.4
258              , base >= 4.10 && < 4.15
259              , binary
260              , containers >= 0.5.8
261              , directory >=1.2
262              , filepath >= 1.4.0.0
263              , mainland-pretty >= 0.2.6
264              , pretty-show-ansi-wl >= 1.5
265              , process >= 1.2.0.0
266              , text >= 0.11.3.1
267              , time >= 1.5
268              , transformers >= 0.4.2
269              , microlens >= 0.4.8
270
271  if flag(llvm-backend)
272    cpp-options: -DWITH_LLVM
273  if flag(haskell-backend)
274    cpp-options: -DWITH_HASKELL
275  if flag(builtin-arrays)
276    cpp-options: -DBUILTIN_ARRAYS
277  if flag(docgent)
278    cpp-options: -DWITH_DOCGENT
279
280  default-language: Haskell2010
281  default-extensions: CPP
282  build-tool-depends:
283              alex:alex
284            , happy:happy
285  ghc-options:
286    -Wall
287    -- -Werror
288    -fno-warn-name-shadowing
289    -fno-warn-missing-signatures
290    -fno-warn-unused-matches
291    -O2
292    -optP-Wno-nonportable-include-path
293    -- -rtsopts
294    -- +RTS -K256M
295  -- if impl(ghc >= 7.10.1)
296  --  ghc-options: -fno-warn-unticked-promoted-constructors
297
298test-suite test-util
299  type: exitcode-stdio-1.0
300  default-language: Haskell2010
301  default-extensions: CPP
302  main-is: test-util.hs
303  build-depends:
304                cogent
305              , base >= 4.10 && < 4.15
306              , containers >= 0.5.8
307              , directory >=1.2
308              , filepath >= 1.4.0.0
309              , mtl >= 2.2.1
310
311test-suite test-quickcheck
312  buildable: True
313  type: exitcode-stdio-1.0
314  default-language: Haskell2010
315  default-extensions: CPP
316  main-is: tests-quickcheck-run.hs
317  hs-source-dirs: tests-quickcheck .
318  other-modules:
319                CogentTests.Dargent.Core
320              , CogentTests.Dargent.Surface
321              , CogentTests.Dargent.TypeCheck
322              , CogentTests.Dargent.Desugar
323              , CogentTests.Dargent.CodeGen
324              , CogentTests.Core
325  build-depends:
326                cogent
327              , base >= 4.10 && < 4.15
328              , Cabal >= 3.0
329              , containers >= 0.5.8
330              , mainland-pretty >= 0.2.6
331              , parsec >= 3.1
332              , QuickCheck >= 2.11.3
333              , transformers
334              , mtl >= 2.2.1
335