-
Notifications
You must be signed in to change notification settings - Fork 1.1k
/
opam
70 lines (64 loc) · 1.86 KB
/
opam
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
opam-version: "2.0"
maintainer: "thomas@gazagnaire.org"
authors: "Thomas Gazagnaire"
homepage: "https://github.com/mirage/mirage-tc"
bug-reports: "https://github.com/mirage/mirage-tc/issues"
dev-repo: "git+https://github.com/mirage/mirage-tc.git"
license: "ISC"
build: [
["./configure" "--prefix" prefix]
[make]
["./configure" "--prefix" "--enable-tests"] {with-test}
[make "test"] {with-test}
]
install: [make "install"]
remove: ["ocamlfind" "remove" "tc"]
depends: [
"ocaml" {>= "4.01.0"}
"ezjsonm" {>= "0.3.0" & < "0.4.0"}
"mstruct" {>= "1.3.1"}
"cstruct"
"sexplib"
"bin_prot"
"alcotest" {with-test}
"ounit" {with-test}
"ocamlbuild" {build}
]
synopsis: "MirageOS type-classes"
description: """
A set of functors and combinators to pretty-print (using sexplib), to
convert to and from and JSON and Cstruct buffers.
```ocaml
# Tc.show (module Tc.S) "Hello world!";;
- : string = "\\"Hello world!\\""
# Tc.to_json (module Tc.App2(Tc.P)(Tc.I)(Tc.S)) (3, "foo");;
- : Ezjsonm.t = `A [`String "3"; `String "foo"]
```
A slightly more complex example, using autogen code instead of functor
composition:
```ocaml
# camlp4o;;
# require "sexplib.syntax";;
# require "comparelib.syntax";;
# require "bin_prot.syntax";;
# module M = struct
type t = { foo: int; bar: string list } with sexp, bin_prot, compare
end;;
# module X = Tc.I0(M);;
# let t = { foo = 3; bar = [ "hello"; "world" ] };;
# Tc.to_json (module X) t;;
- : Ezjsonm.t =
`A
[`A [`String "foo"; `String "3"];
`A [`String "bar"; `A [`String "hello"; `String "world"]]]
# Tc.write_string (module X) t;;
- : string = "\\003\\002\\005hello\\005world"
```"""
flags: light-uninstall
url {
src: "https://github.com/mirage/mirage-tc/archive/0.2.0.tar.gz"
checksum: [
"sha256=857c09894389b4c4526b9ed52a33fcd936a1c0cd76655e2ae9b7ef9517c1be4b"
"md5=5c816232affa7429a1ea8200bb6bb03e"
]
}