guix-more/more/packages/ocaml.scm

ocaml.scm

1
;;; GNU Guix --- Functional package management for GNU
2
;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu>
3
;;;
4
;;; This file is part of GNU Guix.
5
;;;
6
;;; GNU Guix is free software; you can redistribute it and/or modify it
7
;;; under the terms of the GNU General Public License as published by
8
;;; the Free Software Foundation; either version 3 of the License, or (at
9
;;; your option) any later version.
10
;;;
11
;;; GNU Guix is distributed in the hope that it will be useful, but
12
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
;;; GNU General Public License for more details.
15
;;;
16
;;; You should have received a copy of the GNU General Public License
17
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
18
19
(define-module (more packages ocaml)
20
  #:use-module (guix packages)
21
  #:use-module (guix download)
22
  #:use-module (guix utils)
23
  #:use-module (guix build-system ocaml)
24
  #:use-module ((guix licenses) #:prefix license:)
25
  #:use-module (gnu packages)
26
  #:use-module (gnu packages base)
27
  #:use-module (gnu packages llvm)
28
  #:use-module (gnu packages multiprecision)
29
  #:use-module (gnu packages ocaml)
30
  #:use-module (gnu packages protobuf))
31
32
;; Janestreet packages are found in a similar way and all need the same patch.
33
(define (janestreet-origin name version hash)
34
  (origin (method url-fetch)
35
          (uri (string-append "https://ocaml.janestreet.com/ocaml-core/"
36
                              (version-major+minor version) "/files/"
37
                              name "-" version ".tar.gz"))
38
          (sha256 (base32 hash))
39
          (modules '((guix build utils)))
40
          (snippet
41
           (let ((pattern (string-append "lib/" name)))
42
             `(begin
43
                ;; install.ml contains an invalid reference to the ppx file and
44
                ;; propagates this error to the generated META file.  It
45
                ;; looks for it in the "lib" directory, but it is installed in
46
                ;; "lib/ocaml/site-lib/package".  This substitute does not change
47
                ;; this file for non ppx packages.
48
                (substitute* "install.ml"
49
                  ((,pattern) (string-append "lib/ocaml/site-lib/" ,name)))
50
                ;; The standard Makefile would try to install janestreet modules
51
                ;; in OCaml's directory in the store, which is read-only.
52
                (substitute* "Makefile"
53
                  (("--prefix")
54
                   "--libdir $(LIBDIR) --prefix")))))))
55
56
;; They also require almost the same set of arguments
57
(define janestreet-arguments
58
  `(#:use-make? #t
59
    #:make-flags
60
    (list (string-append "CONFIGUREFLAGS=--prefix "
61
                         (assoc-ref %outputs "out")
62
                         " --enable-tests")
63
          (string-append "LIBDIR="
64
                         (assoc-ref %outputs "out")
65
                         "/lib/ocaml/site-lib")
66
          ;; for ocaml-bin-prot, otherwise ignored
67
          (string-append "OCAML_TOPLEVEL_PATH="
68
                         (assoc-ref %build-inputs "findlib")
69
                         "/lib/ocaml/site-lib"))
70
    #:phases (modify-phases %standard-phases (delete 'configure))))
71
72
(define-public ocaml-sexplib
73
  (package
74
    (name "ocaml-sexplib")
75
    (version "113.33.03")
76
    (source (janestreet-origin "sexplib" version
77
              "1ffjmj8if9lyv965cgn2ld1xv7g52qsr8mqflbm515ck1i8l2ima"))
78
    (build-system ocaml-build-system)
79
    (native-inputs
80
     `(("js-build-tools" ,ocaml-js-build-tools)
81
       ("opam" ,opam)))
82
    (arguments janestreet-arguments)
83
    (home-page "https://github.com/janestreet/sexplib")
84
    (synopsis "Library for serializing OCaml values to and from S-expressions")
85
    (description "Sexplib contains functionality for parsing and pretty-printing
86
s-expressions.")
87
    (license license:asl2.0)))
88
89
(define-public ocaml-typerep
90
  (package
91
    (name "ocaml-typerep")
92
    (version "113.33.03")
93
    (source (janestreet-origin "typerep" version
94
              "1b9v5bmi824a9d4sx0f40ixq0yfcbiqxafg4a1jx95xg9199zafy"))
95
    (native-inputs
96
     `(("js-build-tools" ,ocaml-js-build-tools)
97
       ("opam" ,opam)))
98
    (build-system ocaml-build-system)
99
    (arguments janestreet-arguments)
100
    (home-page "https://github.com/janestreet/typerep")
101
    (synopsis "Typerep is a library for runtime types")
102
    (description "Typerep is a library for runtime types.")
103
    (license license:asl2.0)))
104
105
(define-public ocaml-variantslib
106
  (package
107
    (name "ocaml-variantslib")
108
    (version "113.33.03")
109
    (source (janestreet-origin "variantslib" version
110
              "05vp799vl38fvl98ga5miwbzh09cnnpapi6q6gdvwyqi6w7s919n"))
111
    (native-inputs
112
     `(("js-build-tools" ,ocaml-js-build-tools)
113
       ("opam" ,opam)))
114
    (build-system ocaml-build-system)
115
    (arguments janestreet-arguments)
116
    (home-page "https://github.com/janestreet/variantslib")
117
    (synopsis "OCaml variants as first class values")
118
    (description "OCaml variants as first class values.")
119
    (license license:asl2.0)))
120
121
(define-public ocaml-ppx-sexp-conv
122
  (package
123
    (name "ocaml-ppx-sexp-conv")
124
    (version "113.33.03")
125
    (source (janestreet-origin "ppx_sexp_conv" version
126
              "1rbj6d5dl625gdxih34xcrdvikci6h8i2dl9x3wraa4qrgishiw7"))
127
    (build-system ocaml-build-system)
128
    (native-inputs
129
     `(("js-build-tools" ,ocaml-js-build-tools)
130
       ("opam" ,opam)
131
       ("ppx-core" ,ocaml-ppx-core)))
132
    (propagated-inputs
133
     `(("sexplib" ,ocaml-sexplib)
134
       ("ppx-core" ,ocaml-ppx-core)
135
       ("ppx-type-conv" ,ocaml-ppx-type-conv)
136
       ("ppx-tools" ,ocaml-ppx-tools)))
137
    (arguments janestreet-arguments)
138
    (home-page "https://github.com/janestreet/ppx_sexp_conv")
139
    (synopsis "Generation of S-expression conversion functions from type
140
definitions")
141
    (description "Generation of S-expression conversion functions from type
142
definitions.")
143
    (license license:asl2.0)))
144
145
(define-public ocaml-ppx-variants-conv
146
  (package
147
    (name "ocaml-ppx-variants-conv")
148
    (version "113.33.03")
149
    (source (janestreet-origin "ppx_variants_conv" version
150
              "0vnn2l1118cj72413d3f7frlw6yc09l8f64jlzkzbgb9bxpalx34"))
151
    (build-system ocaml-build-system)
152
    (native-inputs
153
     `(("js-build-tools" ,ocaml-js-build-tools)
154
       ("opam" ,opam)))
155
    (propagated-inputs
156
     `(("ppx-core" ,ocaml-ppx-core)
157
       ("variantslib" ,ocaml-variantslib)
158
       ("ppx-tools" ,ocaml-ppx-tools)
159
       ("ppx-type-conv" ,ocaml-ppx-type-conv)))
160
    (arguments janestreet-arguments)
161
    (home-page "https://github.com/janestreet/ppx_variants_conv")
162
    (synopsis "Generation of accessor and iteration functions for ocaml variant
163
types")
164
    (description "Generation of accessor and iteration functions for ocaml
165
variant types.")
166
    (license license:asl2.0)))
167
168
(define-public ocaml-ppx-here
169
  (package
170
    (name "ocaml-ppx-here")
171
    (version "113.33.03")
172
    (source (janestreet-origin "ppx_here" version
173
              "1ay8lfxi0qg3ib2zkwh4h0vqk3gjmxaz572gzab0bbxyqn3z86v7"))
174
    (build-system ocaml-build-system)
175
    (native-inputs
176
     `(("js-build-tools" ,ocaml-js-build-tools)
177
       ("opam" ,opam)))
178
    (propagated-inputs
179
     `(("ppx-driver" ,ocaml-ppx-driver)
180
       ("ppx-core" ,ocaml-ppx-core)))
181
    (arguments janestreet-arguments)
182
    (home-page "https://github.com/janestreet/ppx_here")
183
    (synopsis "Expands [%here] into its location")
184
    (description "Expands [%here] into its location.")
185
    (license license:asl2.0)))
186
187
(define-public ocaml-ppx-assert
188
  (package
189
    (name "ocaml-ppx-assert")
190
    (version "113.33.03")
191
    (source
192
      (origin
193
        (inherit (janestreet-origin "ppx_assert" version
194
                   "1k5kxmqkibp5fk25pgz81f3c1r4mgvb5byzf6bnmxd24y60wn46p"))
195
        (modules '((guix build utils)))
196
        (snippet
197
         (let ((pattern (string-append "lib/" name)))
198
           `(begin
199
              ;; install.ml contains an invalid reference to the ppx file and
200
              ;; propagates this error to the generated META file.  It
201
              ;; looks for it in the "lib" directory, but it is installed in
202
              ;; "lib/ocaml/site-lib/package".  This substitute does not change
203
              ;; this file for non ppx packages.
204
              (substitute* "install.ml"
205
                ((,pattern) (string-append "lib/ocaml/site-lib/" ,name)))
206
              ;; The standard Makefile would try to install janestreet modules
207
              ;; in OCaml's directory in the store, which is read-only.
208
              (substitute* "Makefile"
209
                (("--prefix")
210
                 "--libdir $(LIBDIR) --prefix"))
211
              (substitute* "install.ml"
212
                           (("lib/ppx_assert")
213
                            "lib/ocaml/site-lib/ppx_assert")))))))
214
    (build-system ocaml-build-system)
215
    (native-inputs
216
     `(("js-build-tools" ,ocaml-js-build-tools)
217
       ("opam" ,opam)))
218
    (propagated-inputs
219
     `(("ppx-compare" ,ocaml-ppx-compare)
220
       ("ppx-core" ,ocaml-ppx-core)
221
       ("ppx-driver" ,ocaml-ppx-driver)
222
       ("ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
223
       ("ppx-tools" ,ocaml-ppx-tools)
224
       ("ppx-type-conv" ,ocaml-ppx-type-conv)
225
       ("ppx-sexplib" ,ocaml-sexplib)
226
       ("ppx-here" ,ocaml-ppx-here)))
227
    (arguments janestreet-arguments)
228
    (home-page "https://github.com/janestreet/ppx_assert")
229
    (synopsis "Assert-like extension nodes that raise useful errors on failure")
230
    (description "Assert-like extension nodes that raise useful errors on failure.")
231
    (license license:asl2.0)))
232
233
(define-public ocaml-ppx-enumerate
234
  (package
235
    (name "ocaml-ppx-enumerate")
236
    (version "113.33.03")
237
    (source (janestreet-origin "ppx_enumerate" version
238
              "15g7yfv9wg2h9r6k6q1zrhygmsl4xrfn25mrb0i4czjjivzmxjh4"))
239
    (build-system ocaml-build-system)
240
    (native-inputs
241
     `(("js-build-tools" ,ocaml-js-build-tools)
242
       ("opam" ,opam)))
243
    (propagated-inputs
244
     `(("ppx-tools" ,ocaml-ppx-tools)
245
       ("ppx-type-conv" ,ocaml-ppx-type-conv)
246
       ("ppx-core" ,ocaml-ppx-core)))
247
    (arguments janestreet-arguments)
248
    (home-page "https://github.com/janestreet/ppx_enumerate")
249
    (synopsis "Generate a list containing all values of a finite type")
250
    (description "Ppx_enumerate is a ppx rewriter which generates a definition
251
for the list of all values of a type (for a type which only has finitely
252
many values).")
253
    (license license:asl2.0)))
254
255
(define-public ocaml-ppx-let
256
  (package
257
    (name "ocaml-ppx-let")
258
    (version "113.33.03")
259
    (source (janestreet-origin "ppx_let" version
260
              "0gd6d3gdaqfwjcs7gaw1qxc30i584q6a86ndaj1bx1q63xqd6yx9"))
261
    (build-system ocaml-build-system)
262
    (native-inputs
263
     `(("js-build-tools" ,ocaml-js-build-tools)
264
       ("opam" ,opam)))
265
    (propagated-inputs
266
     `(("ppx-driver" ,ocaml-ppx-driver)
267
       ("ppx-core" ,ocaml-ppx-core)))
268
    (arguments janestreet-arguments)
269
    (home-page "https://github.com/janestreet/ppx_let")
270
    (synopsis "Monadic let-bindings")
271
    (description "A ppx rewriter for monadic and applicative let bindings,
272
match expressions, and if expressions.")
273
    (license license:asl2.0)))
274
275
(define-public ocaml-ppx-typerep-conv
276
  (package
277
    (name "ocaml-ppx-typerep-conv")
278
    (version "113.33.03")
279
    (source (janestreet-origin "ppx_typerep_conv" version
280
              "0g0xqm9s1b2jjvxb8yp69281q2s3bwz6sibn10fvgcdawpa0rmrg"))
281
    (build-system ocaml-build-system)
282
    (native-inputs
283
     `(("js-build-tools" ,ocaml-js-build-tools)
284
       ("opam" ,opam)))
285
    (propagated-inputs
286
     `(("ppx-tools" ,ocaml-ppx-tools)
287
       ("ppx-type-conv" ,ocaml-ppx-type-conv)
288
       ("ppx-core" ,ocaml-ppx-core)
289
       ("typerep" ,ocaml-typerep)))
290
    (arguments janestreet-arguments)
291
    (home-page "https://github.com/janestreet/ppx_typerep_conv")
292
    (synopsis "Generation of runtime types from type declarations")
293
    (description "Automatic generation of runtime types from type definitions.")
294
    (license license:asl2.0)))
295
296
(define-public ocaml-ppx-sexp-value
297
  (package
298
    (name "ocaml-ppx-sexp-value")
299
    (version "113.33.03")
300
    (source (janestreet-origin "ppx_sexp_value" version
301
              "0m3ag23mbqm0i2pv1dzilfks15ipa5q60mf57a0cd3p0pvarq10g"))
302
    (build-system ocaml-build-system)
303
    (native-inputs
304
     `(("js-build-tools" ,ocaml-js-build-tools)
305
       ("opam" ,opam)))
306
    (propagated-inputs
307
     `(("ppx-driver" ,ocaml-ppx-driver)
308
       ("ppx-here" ,ocaml-ppx-here)
309
       ("ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
310
       ("ppx-tools" ,ocaml-ppx-tools)
311
       ("ppx-core" ,ocaml-ppx-core)))
312
    (arguments janestreet-arguments)
313
    (home-page "https://github.com/janestreet/ppx_sexp_value/")
314
    (synopsis "Simplify building s-expressions from ocaml values")
315
    (description "A ppx rewriter that simplifies building s-expressions from
316
ocaml values.")
317
    (license license:asl2.0)))
318
319
(define-public ocaml-ppx-pipebang
320
  (package
321
    (name "ocaml-ppx-pipebang")
322
    (version "113.33.03")
323
    (source (janestreet-origin "ppx_pipebang" version
324
              "1965c7hymp26ncmjs0pfxi2s5jlj60z2c9b194lgcwxqiav56pcw"))
325
    (build-system ocaml-build-system)
326
    (native-inputs
327
     `(("js-build-tools" ,ocaml-js-build-tools)
328
       ("opam" ,opam)))
329
    (propagated-inputs
330
     `(("ppx-driver" ,ocaml-ppx-driver)
331
       ("ppx-tools" ,ocaml-ppx-tools)
332
       ("ppx-core" ,ocaml-ppx-core)))
333
    (arguments janestreet-arguments)
334
    (home-page "https://github.com/janestreet/ppx_pipebang/")
335
    (synopsis "Inline reverse application operators `|>` and `|!`")
336
    (description "A ppx rewriter that inlines reverse application operators
337
`|>` and `|!`.")
338
    (license license:asl2.0)))
339
340
(define-public ocaml-ppx-bin-prot
341
  (package
342
    (name "ocaml-ppx-bin-prot")
343
    (version "113.33.03")
344
    (source (janestreet-origin "ppx_bin_prot" version
345
              "173kjv36giik11zgfvsbzwfbpr66dm2pcha9vf990jgzh8hqz39h"))
346
    (build-system ocaml-build-system)
347
    (native-inputs
348
     `(("js-build-tools" ,ocaml-js-build-tools)
349
       ("opam" ,opam)))
350
    (propagated-inputs
351
     `(("bin-prot" ,ocaml-bin-prot)
352
       ("ppx-tools" ,ocaml-ppx-tools)
353
       ("ppx-type-conv" ,ocaml-ppx-type-conv)
354
       ("ppx-core" ,ocaml-ppx-core)))
355
    (arguments janestreet-arguments)
356
    (home-page "https://github.com/janestreet/ppx_bin_prot/")
357
    (synopsis "Generation of bin_prot readers and writers from types")
358
    (description "Generation of binary serialization and deserialization
359
functions from type definitions.")
360
    (license license:asl2.0)))
361
362
(define-public ocaml-ppx-fail
363
  (package
364
    (name "ocaml-ppx-fail")
365
    (version "113.33.03")
366
    (source (janestreet-origin "ppx_fail" version
367
              "1dwgad0f05gqp5rnwf9dcasidpfi7q3mrpazsw3a2vijjblbhjgn"))
368
    (build-system ocaml-build-system)
369
    (native-inputs
370
     `(("js-build-tools" ,ocaml-js-build-tools)
371
       ("opam" ,opam)))
372
    (propagated-inputs
373
     `(("ppx-driver" ,ocaml-ppx-driver)
374
       ("ppx-tools" ,ocaml-ppx-tools)
375
       ("ppx-here" ,ocaml-ppx-here)
376
       ("ppx-core" ,ocaml-ppx-core)))
377
    (arguments janestreet-arguments)
378
    (home-page "https://github.com/janestreet/ppx_fail/")
379
    (synopsis "Add location to calls to failwiths")
380
    (description "Syntax extension that makes [failwiths] always include a
381
position.")
382
    (license license:asl2.0)))
383
384
(define-public ocaml-ppx-custom-printf
385
  (package
386
    (name "ocaml-ppx-custom-printf")
387
    (version "113.33.03")
388
    (source (janestreet-origin "ppx_custom_printf" version
389
              "11jlx0n87g2j1vyyp343dibx7lvvwig5j5q0nq0b80kbsq0k6yr8"))
390
    (build-system ocaml-build-system)
391
    (native-inputs
392
     `(("js-build-tools" ,ocaml-js-build-tools)
393
       ("opam" ,opam)))
394
    (propagated-inputs
395
     `(("ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
396
       ("ppx-tools" ,ocaml-ppx-tools)
397
       ("ppx-core" ,ocaml-ppx-core)
398
       ("ppx-driver" ,ocaml-ppx-driver)))
399
    (arguments janestreet-arguments)
400
    (home-page "https://github.com/janestreet/ppx_custom_printf/")
401
    (synopsis "Printf-style format-strings for user-defined string conversion")
402
    (description "Extensions to printf-style format-strings for user-defined
403
string conversion.")
404
    (license license:asl2.0)))
405
406
(define-public ocaml-ppx-sexp-message
407
  (package
408
    (name "ocaml-ppx-sexp-message")
409
    (version "113.33.03")
410
    (source (janestreet-origin "ppx_sexp_message" version
411
              "084w1l3gnyw4ri9vbn7bv9b2xkw1520qczfxpxdarfivdrz8xr68"))
412
    (build-system ocaml-build-system)
413
    (native-inputs
414
     `(("js-build-tools" ,ocaml-js-build-tools)
415
       ("opam" ,opam)))
416
    (propagated-inputs
417
     `(("ppx-driver" ,ocaml-ppx-driver)
418
       ("ppx-here" ,ocaml-ppx-here)
419
       ("ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
420
       ("ppx-tools" ,ocaml-ppx-tools)
421
       ("ppx-core" ,ocaml-ppx-core)))
422
    (arguments janestreet-arguments)
423
    (home-page "https://github.com/janestreet/ppx_sexp_message/")
424
    (synopsis "A ppx rewriter for easy construction of s-expressions")
425
    (description "The aim of ppx_sexp_message is to ease the creation of
426
s-expressions in OCaml.  This is mainly motivated by writing error and debugging
427
messages, where one needs to construct a s-expression based on various element
428
of the context such as function arguments.")
429
    (license license:asl2.0)))
430
431
(define-public ocaml-ppx-fields-conv
432
  (package
433
    (name "ocaml-ppx-fields-conv")
434
    (version "113.33.03")
435
    (source (janestreet-origin "ppx_fields_conv" version
436
              "1vzbdz27g5qhhfs7wx6rjf979q4xyssxqbmp6sc1sxknbghslbdv"))
437
    (build-system ocaml-build-system)
438
    (native-inputs
439
     `(("js-build-tools" ,ocaml-js-build-tools)
440
       ("opam" ,opam)
441
       ("ppx-core" ,ocaml-ppx-core)))
442
    (propagated-inputs
443
     `(("fieldslib" ,ocaml-fieldslib)
444
       ("ppx-tools" ,ocaml-ppx-tools)
445
       ("ppx-core" ,ocaml-ppx-core)
446
       ("ppx-type-conv" ,ocaml-ppx-type-conv)))
447
    (arguments janestreet-arguments)
448
    (home-page "https://github.com/janestreet/ppx_fields_conv/")
449
    (synopsis "Generation of accessor and iteration functions for ocaml records")
450
    (description "Ppx_fields_conv is a ppx rewriter that can be used to define
451
first class values representing record fields, and additional routines, to get
452
and set record fields, iterate and fold over all fields of a record and create
453
new record values.")
454
    (license license:asl2.0)))
455
456
(define-public ocaml-re
457
  (package
458
    (name "ocaml-re")
459
    (version "1.7.1")
460
    (source (origin
461
              (method url-fetch)
462
              (uri (string-append "https://github.com/ocaml/ocaml-re//archive/"
463
                                  version ".tar.gz"))
464
              (sha256
465
               (base32
466
                "1s3rcr76cgm4p1xmaazc58arkg2lz3zfcp1icm00m6s5ccnkh67b"))))
467
    (build-system ocaml-build-system)
468
    (native-inputs `(("ounit" ,ocaml-ounit)))
469
    (home-page "https://github.com/ocaml/ocaml-re/")
470
    (synopsis "Regular expression library for OCaml")
471
    (description "Pure OCaml regular expressions with:
472
enumerate
473
@item Perl-style regular expressions (module Re_perl)
474
@item Posix extended regular expressions (module Re_posix)
475
@item Emacs-style regular expressions (module Re_emacs)
476
@item Shell-style file globbing (module Re_glob)
477
@item Compatibility layer for OCaml's built-in Str module (module Re_str)
478
@end enumerate")
479
    (license license:expat)))
480
481
(define-public ocaml-ppx-expect
482
  (package
483
    (name "ocaml-ppx-expect")
484
    (version "113.33.03")
485
    (source (janestreet-origin "ppx_expect" version
486
              "03sbs4s5i8l9syr45v25f5hzy7msd2b47k2a9wsq9m43d4imgkrc"))
487
    (build-system ocaml-build-system)
488
    (native-inputs
489
     `(("js-build-tools" ,ocaml-js-build-tools)
490
       ("opam" ,opam)))
491
    (propagated-inputs
492
     `(("fieldslib" ,ocaml-fieldslib)
493
       ("ppx-tools" ,ocaml-ppx-tools)
494
       ("ppx-assert" ,ocaml-ppx-assert)
495
       ("ppx-compare" ,ocaml-ppx-compare)
496
       ("ppx-core" ,ocaml-ppx-core)
497
       ("ppx-custom-printf" ,ocaml-ppx-custom-printf)
498
       ("ppx-driver" ,ocaml-ppx-driver)
499
       ("ppx-fields-conv" ,ocaml-ppx-fields-conv)
500
       ("ppx-inline-test" ,ocaml-ppx-inline-test)
501
       ("ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
502
       ("ppx-variants-conv" ,ocaml-ppx-variants-conv)
503
       ("re" ,ocaml-re)
504
       ("sexplib" ,ocaml-sexplib)
505
       ("variantslib" ,ocaml-variantslib)))
506
    (arguments janestreet-arguments)
507
    (home-page "https://github.com/janestreet/ppx_expect/")
508
    (synopsis "Cram like framework for OCaml")
509
    (description "Expect-test is a framework for writing tests in OCaml, similar
510
to Cram.  Expect-tests mimic the existing inline tests framework with the
511
let%expect_test construct.  The body of an expect-test can contain
512
output-generating code, interleaved with %expect extension expressions to denote
513
the expected output.")
514
    (license license:asl2.0)))
515
516
(define-public ocaml-ppx-jane
517
  (package
518
    (name "ocaml-ppx-jane")
519
    (version "113.33.03")
520
    (source (janestreet-origin "ppx_jane" version
521
              "0bjxkhmzgm6x9dcvjwybbccn34khbvyyjimcbaja30fp6qcqk5yl"))
522
    (build-system ocaml-build-system)
523
    (native-inputs
524
     `(("js-build-tools" ,ocaml-js-build-tools)
525
       ("opam" ,opam)))
526
    (propagated-inputs
527
     `(("ppx-assert" ,ocaml-ppx-assert)
528
       ("ppx-bench" ,ocaml-ppx-bench)
529
       ("ppx-bin-prot" ,ocaml-ppx-bin-prot)
530
       ("ppx-compare" ,ocaml-ppx-compare)
531
       ("ppx-custom-printf" ,ocaml-ppx-custom-printf)
532
       ("ppx-deriving" ,ocaml-ppx-deriving)
533
       ("ppx-enumerate" ,ocaml-ppx-enumerate)
534
       ("ppx-expect" ,ocaml-ppx-expect)
535
       ("ppx-fail" ,ocaml-ppx-fail)
536
       ("ppx-fields-conv" ,ocaml-ppx-fields-conv)
537
       ("ppx-here" ,ocaml-ppx-here)
538
       ("ppx-inline-test" ,ocaml-ppx-inline-test)
539
       ("ppx-let" ,ocaml-ppx-let)
540
       ("ppx-pipebang" ,ocaml-ppx-pipebang)
541
       ("ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
542
       ("ppx-sexp-message" ,ocaml-ppx-sexp-message)
543
       ("ppx-sexp-value" ,ocaml-ppx-sexp-value)
544
       ("ppx-typerep-conv" ,ocaml-ppx-typerep-conv)
545
       ("ppx-variants-conv" ,ocaml-ppx-variants-conv)))
546
    (arguments janestreet-arguments)
547
    (home-page "https://github.com/janestreet/ppx_jane/")
548
    (synopsis "Standard Jane Street ppx rewriters")
549
    (description "Ppx_jane is a ppx_driver including all standard ppx rewriters.")
550
    (license license:asl2.0)))
551
552
(define-public ocaml-core-kernel
553
  (package
554
    (name "ocaml-core-kernel")
555
    (version "113.33.03")
556
    (source (janestreet-origin "core_kernel" version
557
               "0fl23jrwivixawhxinbwaw9cabqnzn7fini7dxpxjjvkxdc8ip5y"))
558
    (native-inputs
559
     `(("js-build-tools" ,ocaml-js-build-tools)
560
       ("ppx-jane" ,ocaml-ppx-jane)
561
       ("opam" ,opam)))
562
    (propagated-inputs
563
     `(("bin_prot" ,ocaml-bin-prot)
564
       ("ppx-assert" ,ocaml-ppx-assert)
565
       ("ppx-bench" ,ocaml-ppx-bench)
566
       ("ppx-driver" ,ocaml-ppx-driver)
567
       ("ppx-expect" ,ocaml-ppx-expect)
568
       ("ppx-inline-test" ,ocaml-ppx-inline-test)
569
       ("typerep" ,ocaml-typerep)
570
       ("sexplib" ,ocaml-sexplib)
571
       ("variantslib" ,ocaml-variantslib)
572
       ("result" ,ocaml-result)
573
       ("fieldslib" ,ocaml-fieldslib)))
574
    (build-system ocaml-build-system)
575
    (arguments janestreet-arguments)
576
    (home-page "https://github.com/janestreet/core_kernel/")
577
    (synopsis "Portable standard library for OCaml")
578
    (description "Core is an alternative to the OCaml standard library.
579
580
Core_kernel is the system-independent part of Core. It is aimed for cases when
581
the full Core is not available, such as in Javascript.")
582
    (license license:asl2.0)))
583
584
(define-public ocaml-async-kernel
585
  (package
586
    (name "ocaml-async-kernel")
587
    (version "113.33.03")
588
    (source (janestreet-origin "async_kernel" version
589
              "04bjsaa23j831r09r38x6xx9nhryvp0z5ihickvhxqa4fb2snyvd"))
590
    (native-inputs
591
     `(("oasis" ,ocaml-oasis)
592
       ("js-build-tools" ,ocaml-js-build-tools)
593
       ("ppx-jane" ,ocaml-ppx-jane)
594
       ("opam" ,opam)))
595
    (propagated-inputs
596
     `(("core-kernel" ,ocaml-core-kernel)))
597
    (build-system ocaml-build-system)
598
    (arguments janestreet-arguments)
599
    (home-page "https://github.com/janestreet/async_kernel/")
600
    (synopsis "Monadic concurrency library")
601
    (description "Monadic concurrency library.")
602
    (license license:asl2.0)))
603
604
(define-public ocaml-async-rpc-kernel
605
  (package
606
    (name "ocaml-async-rpc-kernel")
607
    (version "113.33.03")
608
    (source (janestreet-origin "async_rpc_kernel" version
609
             "0y97h9pkb00v7jpf87m8cbb0ffkclj9g26ph6sq97q8dpisnkjwh"))
610
    (native-inputs
611
     `(("oasis" ,ocaml-oasis)
612
       ("js-build-tools" ,ocaml-js-build-tools)
613
       ("ppx-jane" ,ocaml-ppx-jane)
614
       ("opam" ,opam)))
615
    (propagated-inputs
616
     `(("async-kernel" ,ocaml-async-kernel)))
617
    (build-system ocaml-build-system)
618
    (arguments janestreet-arguments)
619
    (home-page "https://github.com/janestreet/async_rpc_kernel/")
620
    (synopsis "Platform-independent core of Async RPC library")
621
    (description "Platform-independent core of Async RPC library.")
622
    (license license:asl2.0)))
623
624
(define-public ocaml-core
625
  (package
626
    (name "ocaml-core")
627
    (version "113.33.03")
628
    (source (janestreet-origin "core" version
629
              "1znll157qg56g9d3247fjibv1hxv3r9wxgr4nhy19j2vzdh6a268"))
630
    (native-inputs
631
     `(("oasis" ,ocaml-oasis)
632
       ("js-build-tools" ,ocaml-js-build-tools)
633
       ("ppx-jane" ,ocaml-ppx-jane)
634
       ("opam" ,opam)))
635
    (propagated-inputs
636
     `(("core-kernel" ,ocaml-core-kernel)))
637
    (build-system ocaml-build-system)
638
    (arguments janestreet-arguments)
639
    (home-page "https://github.com/janestreet/core/")
640
    (synopsis "Alternative to OCaml's standard library")
641
    (description "The Core suite of libraries is an alternative to OCaml's
642
standard library that was developed by Jane Street.")
643
    (license license:asl2.0)))
644
645
(define-public ocaml-async-unix
646
  (package
647
    (name "ocaml-async-unix")
648
    (version "113.33.03")
649
    (source (janestreet-origin "async_unix" version
650
              "1fwl0lfrizllcfjk8hk8m7lsz9ha2jg6qgk4gssfyz377qvpcq4h"))
651
    (native-inputs
652
     `(("oasis" ,ocaml-oasis)
653
       ("js-build-tools" ,ocaml-js-build-tools)
654
       ("ppx-jane" ,ocaml-ppx-jane)
655
       ("opam" ,opam)))
656
    (propagated-inputs
657
     `(("async-kernel" ,ocaml-async-kernel)
658
       ("core" ,ocaml-core)))
659
    (build-system ocaml-build-system)
660
    (arguments janestreet-arguments)
661
    (home-page "https://github.com/janestreet/async_unix")
662
    (synopsis "Monadic concurrency library")
663
    (description "Monadic concurrency library.")
664
    (license license:asl2.0)))
665
666
(define-public ocaml-async-extra
667
  (package
668
    (name "ocaml-async-extra")
669
    (version "113.33.03")
670
    (source (janestreet-origin "async_extra" version
671
              "1si8jgiq5xh5sl9f2b7f9p17p7zx5h1pg557x2cxywi2x7pxqg4f"))
672
    (native-inputs
673
     `(("oasis" ,ocaml-oasis)
674
       ("js-build-tools" ,ocaml-js-build-tools)
675
       ("ppx-jane" ,ocaml-ppx-jane)
676
       ("opam" ,opam)))
677
    (propagated-inputs
678
     `(("async-rpc-kernel" ,ocaml-async-rpc-kernel)
679
       ("async-unix" ,ocaml-async-unix)
680
       ("core" ,ocaml-core)))
681
    (build-system ocaml-build-system)
682
    (arguments janestreet-arguments)
683
    (home-page "https://github.com/janestreet/async_extra")
684
    (synopsis "Monadic concurrency library")
685
    (description "Monadic concurrency library.")
686
    (license license:asl2.0)))
687
688
(define-public ocaml-async
689
  (package
690
    (name "ocaml-async")
691
    (version "113.33.03")
692
    (source (janestreet-origin "async" version
693
              "0210fyhcs12kpmmd26015bgivkfd2wqkyn3c5wd7688d0f872y25"))
694
    (native-inputs
695
     `(("oasis" ,ocaml-oasis)
696
       ("js-build-tools" ,ocaml-js-build-tools)
697
       ("ppx-jane" ,ocaml-ppx-jane)
698
       ("opam" ,opam)))
699
    (propagated-inputs
700
     `(("async-extra" ,ocaml-async-extra)))
701
    (build-system ocaml-build-system)
702
    (arguments janestreet-arguments)
703
    (home-page "https://github.com/janestreet/async")
704
    (synopsis "Monadic concurrency library")
705
    (description "Monadic concurrency library.")
706
    (license license:asl2.0)))
707
708
(define-public ocaml-ocplib-endian
709
  (package
710
    (name "ocaml-ocplib-endian")
711
    (version "1.0")
712
    (source (origin
713
              (method url-fetch)
714
              (uri (string-append "https://github.com/OCamlPro/ocplib-endian/"
715
                                  "archive/" version ".tar.gz"))
716
              (sha256
717
               (base32
718
                "0hwj09rnzjs0m0kazz5h2mgs6p95j0zlga8cda5srnzqmzhniwkn"))
719
              (file-name (string-append name "-" version ".tar.gz"))))
720
    (build-system ocaml-build-system)
721
    (native-inputs `(("cppo" ,ocaml-cppo)))
722
    (home-page "https://github.com/OCamlPro/ocplib-endian")
723
    (synopsis "Optimised functions to read and write int16/32/64 from strings
724
and bigarrays")
725
    (description "Optimised functions to read and write int16/32/64 from strings
726
and bigarrays, based on new primitives added in version 4.01. It works on
727
strings, bytes and bigstring (Bigarrys of chars), and provides submodules for
728
big- and little-endian, with their unsafe counter-parts.")
729
    (license license:lgpl2.1)))
730
731
(define-public ocaml-cstruct
732
  (package
733
    (name "ocaml-cstruct")
734
    (version "2.3.1")
735
    (source (origin
736
              (method url-fetch)
737
              (uri (string-append "https://github.com/mirage/ocaml-cstruct/"
738
                                  "archive/v" version ".tar.gz"))
739
              (sha256
740
               (base32
741
                "15qpdc8421shq4pprdas9jznpva45229wkfqbwcxw9khaiiz7949"))
742
              (file-name (string-append name "-" version ".tar.gz"))))
743
    (build-system ocaml-build-system)
744
    (arguments
745
     `(#:configure-flags
746
       (list "--enable-lwt" "--enable-async")
747
       #:phases
748
       (modify-phases %standard-phases
749
         (add-after 'install 'link-stubs
750
           (lambda* (#:key outputs #:allow-other-keys)
751
             (let* ((out (assoc-ref outputs "out"))
752
                    (stubs (string-append out "/lib/ocaml/site-lib/stubslibs"))
753
                    (lib (string-append out "/lib/ocaml/site-lib/cstruct")))
754
               (mkdir-p stubs)
755
               (symlink (string-append lib "/dllcstruct_stubs.so")
756
                        (string-append stubs "/dllcstruct_stubs.so"))))))))
757
    (native-inputs
758
     `(("ounit" ,ocaml-ounit)
759
       ("ppx-tools" ,ocaml-ppx-tools)
760
       ("camlp4" ,camlp4)))
761
    (propagated-inputs
762
     `(("ocplib-endian" ,ocaml-ocplib-endian)
763
       ("lwt" ,ocaml-lwt)
764
       ("async" ,ocaml-async)
765
       ("sexplib" ,ocaml-sexplib)))
766
    (home-page "https://github.com/mirage/ocaml-cstruct")
767
    (synopsis "Access C structures via a camlp4 extension")
768
    (description "Cstruct is a library and syntax extension to make it easier
769
to access C-like structures directly from OCaml.  It supports both reading and
770
writing to these structures, and they are accessed via the Bigarray module.")
771
    (license license:isc)))
772
773
(define-public ocaml-hex
774
  (package
775
    (name "ocaml-hex")
776
    (version "1.0.0")
777
    (source (origin
778
              (method url-fetch)
779
              (uri (string-append "https://github.com/mirage/ocaml-hex/"
780
                                  "archive/" version ".tar.gz"))
781
              (sha256
782
               (base32
783
                "0s63g0b8gfv2xm6fv6xg7bva8h76b5pcjb0zw3f8cygs0lq9072v"))
784
              (file-name (string-append name "-" version ".tar.gz"))))
785
    (build-system ocaml-build-system)
786
    (propagated-inputs `(("cstruct" ,ocaml-cstruct)))
787
    (home-page "https://github.com/mirage/ocaml-hex/")
788
    (synopsis "Minimal library providing hexadecimal converters")
789
    (description "Minimal library providing hexadecimal converters.")
790
    (license license:isc)))
791
792
(define-public ocaml-ezjsonm
793
  (package
794
    (name "ocaml-ezjsonm")
795
    (version "0.4.3")
796
    (source (origin
797
              (method url-fetch)
798
              (uri (string-append "https://github.com/mirage/ezjsonm/archive/"
799
                                  version ".tar.gz"))
800
              (sha256
801
               (base32
802
                "1kag0z2xlk4rw73a240dmkxh9rj6psxxcxkm7d7z0rrj6hzjajgq"))
803
              (file-name (string-append name "-" version ".tar.gz"))))
804
    (build-system ocaml-build-system)
805
    (native-inputs
806
     `(("alcotest" ,ocaml-alcotest)))
807
    (propagated-inputs
808
     `(("hex" ,ocaml-hex)
809
       ("jsonm" ,ocaml-jsonm)
810
       ("lwt" ,ocaml-lwt)
811
       ("sexplib" ,ocaml-sexplib)))
812
    (arguments
813
     `(#:configure-flags (list "--enable-lwt")
814
       ;; dllcstruct_stubs.so: cannot open shared object file: No such file
815
       ;; or directory. May be fixed?
816
       #:tests? #f))
817
    (home-page "https://github.com/mirage/ezjsonm/")
818
    (synopsis "An easy interface on top of the Jsonm library")
819
    (description "This version provides more convenient (but far less flexible)
820
input and output functions that go to and from [string] values.  This avoids
821
the need to write signal code, which is useful for quick scripts that
822
manipulate JSON.")
823
    (license license:isc)))
824
825
(define-public ocaml-uri
826
  (package
827
    (name "ocaml-uri")
828
    (version "1.9.2")
829
    (source (origin
830
              (method url-fetch)
831
              (uri (string-append "https://github.com/mirage/ocaml-uri/archive/v"
832
                                  version ".tar.gz"))
833
              (sha256
834
               (base32
835
                "02bzrag79prx261rxf9mlak749pwf4flpfl8p012x1xznv9m0clc"))
836
              (file-name (string-append name "-" version ".tar.gz"))))
837
    (build-system ocaml-build-system)
838
    (native-inputs
839
     `(("ounit" ,ocaml-ounit)))
840
    (propagated-inputs
841
     `(("ppx-sexp-conv" ,ocaml-ppx-sexp-conv)
842
       ("re" ,ocaml-re)
843
       ("ppx-deriving" ,ocaml-ppx-deriving)
844
       ("sexplib" ,ocaml-sexplib)
845
       ("stringext" ,ocaml-stringext)))
846
    (home-page "https://github.com/mirage/ocaml-uri")
847
    (synopsis "RFC3986 URI/URL parsing library")
848
    (description "RFC3986 URI/URL parsing library.")
849
    (license license:isc)))
850
851
(define-public ocaml-easy-format
852
  (package
853
    (name "ocaml-easy-format")
854
    (version "1.2.0")
855
    (source (origin
856
              (method url-fetch)
857
              (uri (string-append "https://github.com/mjambon/easy-format/"
858
                                  "archive/v" version ".tar.gz"))
859
              (sha256
860
               (base32
861
                "1zcz682y9figa84k7lgdjcab5qbzk3yy14ygfqp2dhhrvjygm252"))
862
              (file-name (string-append name "-" version ".tar.gz"))))
863
    (build-system ocaml-build-system)
864
    (arguments
865
     `(#:phases
866
       (modify-phases %standard-phases
867
         (delete 'configure))
868
       #:tests? #f))
869
    (home-page "https://github.com/mjambon/easy-format")
870
    (synopsis "High-level and functional interface to the Format module of the
871
OCaml standard library")
872
    (description "High-level and functional interface to the Format module of
873
the OCaml standard library.")
874
    (license license:bsd-3)))
875
876
(define-public ocaml-optcomp
877
  (package
878
    (name "ocaml-optcomp")
879
    (version "1.6")
880
    (source (origin
881
              (method url-fetch)
882
              (uri (string-append "https://github.com/diml/optcomp/archive/"
883
                                  version ".tar.gz"))
884
              (sha256
885
               (base32
886
                "0hhhb2gisah1h22zlg5iszbgqxdd7x85cwd57bd4mfkx9l7dh8jh"))
887
              (file-name (string-append name "-" version ".tar.gz"))))
888
    (build-system ocaml-build-system)
889
    (arguments
890
     `(#:use-make? #t
891
	   #:make-flags
892
       (list (string-append "BUILDFLAGS=\"-cflags -I,"
893
                            (assoc-ref %build-inputs "camlp4")
894
                            "/lib/ocaml/site-lib/camlp4/Camlp4Parsers\""))))
895
    (native-inputs `(("camlp4" ,camlp4)))
896
    (propagated-inputs `(("camlp4" ,camlp4)))
897
    (home-page "https://github.com/diml/optcomp")
898
    (synopsis "Optional compilation with cpp-like directives")
899
    (description "Optional compilation with cpp-like directives.")
900
    (license license:bsd-3)))
901
902
(define-public ocaml-piqilib
903
  (package
904
    (name "ocaml-piqilib")
905
    (version "0.6.13")
906
    (source (origin
907
              (method url-fetch)
908
              (uri (string-append "https://github.com/alavrik/piqi/archive/v"
909
                                  version ".tar.gz"))
910
              (sha256
911
               (base32
912
                "1whqr2bb3gds2zmrzqnv8vqka9928w4lx6mi6g244kmbwb2h8d8l"))
913
              (file-name (string-append name "-" version ".tar.gz"))
914
              (patches (search-patches "ocaml-piqilib-fix-makefile.patch"))))
915
    (build-system ocaml-build-system)
916
    (arguments
917
     `(#:phases
918
       (modify-phases %standard-phases
919
         (replace 'configure
920
           (lambda* (#:key outputs #:allow-other-keys)
921
             (let ((out (assoc-ref outputs "out")))
922
               (substitute* "make/OCamlMakefile"
923
                 (("/bin/sh") (which "bash")))
924
               (zero? (system* "./configure" "--prefix" out "--ocaml-libdir"
925
                               (string-append out "/lib/ocaml/site-lib"))))))
926
       (add-after 'build 'build-ocaml
927
         (lambda* (#:key outputs #:allow-other-keys)
928
           (zero? (system* "make" "ocaml")))) 
929
       (add-after 'install 'install-ocaml
930
         (lambda* (#:key outputs #:allow-other-keys)
931
           (zero? (system* "make" "ocaml-install"))))
932
       (add-after 'install-ocaml 'link-stubs
933
         (lambda* (#:key outputs #:allow-other-keys)
934
           (let* ((out (assoc-ref outputs "out"))
935
                  (stubs (string-append out "/lib/ocaml/site-lib/stubslibs"))
936
                  (lib (string-append out "/lib/ocaml/site-lib/piqilib")))
937
             (mkdir-p stubs)
938
             (symlink (string-append lib "/dllpiqilib_stubs.so")
939
                      (string-append stubs "/dllpiqilib_stubs.so"))))))))
940
    (native-inputs
941
     `(("which" ,which)
942
       ("camlp4" ,camlp4)))
943
    (propagated-inputs
944
     `(("xmlm" ,ocaml-xmlm)
945
       ("ulex" ,ocaml-ulex)
946
       ("optcomp" ,ocaml-optcomp)
947
       ("easy-format" ,ocaml-easy-format)
948
       ("base64" ,ocaml-base64)))
949
    (home-page "http://piqi.org")
950
    (synopsis "Data serialization and conversion library")
951
    (description "Common library used by piqi command-line tool and piqi-ocaml.")
952
    (license license:asl2.0)))
953
954
(define-public ocaml-uuidm
955
  (package
956
    (name "ocaml-uuidm")
957
    (version "0.9.6")
958
    (source (origin
959
              (method url-fetch)
960
              (uri (string-append "http://erratique.ch/software/uuidm/"
961
                                  "releases/uuidm-" version ".tbz"))
962
              (sha256
963
               (base32
964
                "0hz4fdx0x16k0pw9995vkz5d1hmzz6b16wck9li399rcbfnv5jlc"))))
965
    (build-system ocaml-build-system)
966
    (arguments
967
     `(#:tests? #f
968
       #:build-flags
969
       (list "build" "--with-cmdliner" "true")
970
       #:phases
971
       (modify-phases %standard-phases
972
         (delete 'configure))))
973
    (native-inputs
974
     `(("opam" ,opam)))
975
    (propagated-inputs
976
     `(("cmdliner" ,ocaml-cmdliner)
977
       ("topkg" ,ocaml-topkg)))
978
    (home-page "http://erratique.ch/software/uuidm")
979
    (synopsis "Universally unique identifiers (UUIDs) for OCaml")
980
    (description "Uuidm is an OCaml module implementing 128 bits universally
981
unique identifiers version 3, 5 (named based with MD5, SHA-1 hashing) and 4
982
(random based) according to RFC 4122.")
983
    (license license:isc)))
984
985
(define-public ocamlgraph
986
  (package
987
    (name "ocamlgraph")
988
    (version "1.8.7")
989
    (source (origin
990
              (method url-fetch)
991
              (uri (string-append "http://ocamlgraph.lri.fr/download/"
992
                                  "ocamlgraph-" version ".tar.gz"))
993
              (sha256
994
               (base32
995
                "1845r537swjil2fcj7lgbibc2zybfwqqasrd2s7bncajs83cl1nz"))
996
              (patches (search-patches "ocamlgraph-honor-source-date-epoch.patch"))))
997
    (build-system ocaml-build-system)
998
    (arguments
999
     `(#:install-target "install-findlib"
1000
       #:phases
1001
       (modify-phases %standard-phases
1002
         (add-before 'configure 'fix-/bin/sh
1003
           (lambda* (#:key inputs #:allow-other-keys)
1004
             (substitute* "configure"
1005
               (("-/bin/sh") (string-append "-" (assoc-ref inputs "bash")
1006
                                            "/bin/sh"))))))))
1007
    (inputs `(("lablgtk" ,lablgtk)))
1008
    (home-page "http://ocamlgraph.lri.fr/")
1009
    (synopsis "A generic graph library for OCaml")
1010
    (description "A generic graph library for OCaml.")
1011
    (license license:lgpl2.1)))
1012
1013
(define-public ocaml-piqi
1014
  (package
1015
    (name "ocaml-piqi")
1016
    (version "0.7.5")
1017
    (source (origin
1018
              (method url-fetch)
1019
              (uri (string-append "https://github.com/alavrik/piqi-ocaml/"
1020
                                  "archive/v" version ".tar.gz"))
1021
              (sha256
1022
               (base32
1023
                "0ngz6y8i98i5v2ma8nk6mc83pdsmf2z0ks7m3xi6clfg3zqbddrv"))))
1024
    (build-system ocaml-build-system)
1025
    (arguments
1026
     `(#:make-flags
1027
       (list (string-append "DESTDIR=" (assoc-ref %outputs "out")))
1028
       #:phases
1029
       (modify-phases %standard-phases
1030
         (delete 'configure)
1031
         (add-before 'build 'patch-/bin/sh
1032
           (lambda _
1033
             (substitute* "make/OCamlMakefile"
1034
               (("/bin/sh") (which "sh")))
1035
             #t)))))
1036
    (native-inputs
1037
     `(("which" ,which)
1038
       ("protobuf" ,protobuf))) ; for tests
1039
    (propagated-inputs
1040
     `(("piqilib" ,ocaml-piqilib)))
1041
    (home-page "https://github.com/alavrik/piqi-ocaml")
1042
    (synopsis "Protocol serialization system for OCaml")
1043
    (description "Piqi is a multi-format data serialization system for OCaml.
1044
It provides a uniform interface for serializing OCaml data structures to JSON,
1045
XML and Protocol Buffers formats.")
1046
    (license license:asl2.0)))
1047
1048
(define-public bap
1049
  (package
1050
    (name "bap")
1051
    (version "1.1.0")
1052
    (home-page "https://github.com/BinaryAnalysisPlatform/bap")
1053
    (source (origin
1054
              (method url-fetch)
1055
              (uri (string-append home-page "/archive/v" version ".tar.gz"))
1056
              (sha256
1057
               (base32
1058
                "1ms95m4j1qrmy7zqmsn2izh7gq68lnmssl7chyhk977kd3sxj66m"))
1059
              (file-name (string-append name "-" version ".tar.gz"))))
1060
   (build-system ocaml-build-system)
1061
   (native-inputs
1062
    `(("oasis" ,ocaml-oasis)
1063
      ("clang" ,clang)
1064
      ("ounit" ,ocaml-ounit)))
1065
   (propagated-inputs
1066
    `(("core-kernel" ,ocaml-core-kernel)
1067
      ("ppx-driver" ,ocaml-ppx-driver)
1068
      ("uri" ,ocaml-uri)
1069
      ("llvm" ,llvm)
1070
      ("gmp" ,gmp)
1071
      ("clang-runtime" ,clang-runtime)
1072
      ("fileutils" ,ocaml-fileutils)
1073
      ("cmdliner" ,ocaml-cmdliner)
1074
      ("zarith" ,ocaml-zarith)
1075
      ("uuidm" ,ocaml-uuidm)
1076
      ("camlzip" ,camlzip)
1077
      ("frontc" ,ocaml-frontc)
1078
      ("ezjsonm" ,ocaml-ezjsonm)
1079
      ("ocurl" ,ocaml-ocurl)
1080
      ("piqi" ,ocaml-piqi)
1081
      ("ocamlgraph" ,ocamlgraph)
1082
      ("bitstring" ,ocaml-bitstring)
1083
      ("ppx-jane" ,ocaml-ppx-jane)
1084
      ("re" ,ocaml-re)))
1085
   (inputs `(("llvm" ,llvm)))
1086
   (arguments
1087
    `(#:use-make? #t
1088
      #:phases
1089
      (modify-phases %standard-phases
1090
        (replace 'configure
1091
          (lambda* (#:key outputs #:allow-other-keys)
1092
            (zero? (system* "./configure" "--prefix"
1093
                            (assoc-ref outputs "out")
1094
                            "--libdir"
1095
                            (string-append
1096
                              (assoc-ref outputs "out")
1097
                              "/lib/ocaml/site-lib")
1098
                            "--with-llvm-version=3.8"
1099
                            "--with-llvm-config=llvm-config"
1100
                            "--enable-everything"))))
1101
        (add-before 'install 'fix-ocamlpath
1102
          (lambda* (#:key outputs #:allow-other-keys)
1103
            (setenv "OCAMLPATH"
1104
                    (string-append
1105
                      (getenv "OCAMLPATH") ":"
1106
                      (assoc-ref outputs "out")
1107
                      "/lib/ocaml/site-lib"))
1108
            (setenv "PATH"
1109
                    (string-append (getenv "PATH") ":"
1110
                                   (assoc-ref outputs "out") "/bin"))))
1111
        (add-after 'install 'link-stubs
1112
          (lambda* (#:key outputs #:allow-other-keys)
1113
            (let* ((out (assoc-ref outputs "out"))
1114
                   (stubs (string-append out "/lib/ocaml/site-lib/stubslibs"))
1115
                   (lib (string-append out "/lib/ocaml/site-lib/bap-plugin-llvm")))
1116
              (mkdir-p stubs)
1117
              (symlink (string-append lib "/dllllvm_plugin_stubs.so")
1118
                       (string-append stubs "/dllllvm_plugin_stubs.so"))))))))
1119
   (synopsis "Binary Analysis Platform")
1120
   (description "Binary Analysis Platform is a framework for writing program
1121
analysis tools, that target binary files.  The framework consists of a plethora
1122
of libraries, plugins, and frontends.  The libraries provide code reusability,
1123
the plugins facilitate extensibility, and the frontends serve as entry points.")
1124
   (license license:expat)))
1125
1126
(define-public ocaml-camomile
1127
  (package
1128
    (name "ocaml-camomile")
1129
    (version "0.8.5")
1130
    (home-page "https://github.com/yoriyuki/Camomile")
1131
    (source (origin
1132
              (method url-fetch)
1133
              (uri (string-append home-page "/releases/download/rel-" version
1134
                                  "/camomile-" version ".tar.bz2"))
1135
              (sha256
1136
               (base32
1137
                "003ikpvpaliy5hblhckfmln34zqz0mk3y2m1fqvbjngh3h2np045"))))
1138
    (build-system ocaml-build-system)
1139
    (native-inputs `(("camlp4" ,camlp4)))
1140
    (arguments
1141
     `(#:phases
1142
       (modify-phases %standard-phases
1143
         (add-before 'configure 'fix-bin/sh
1144
           (lambda* (#:key #:allow-other-keys)
1145
             (substitute* "configure"
1146
               (("CONFIG_SHELL-/bin/sh")
1147
                (string-append "CONFIG_SHELL-" (which "bash")))))))))
1148
    (synopsis "Comprehensive Unicode library")
1149
    (description "Camomile is a Unicode library for OCaml.  Camomile provides
1150
Unicode character type, UTF-8, UTF-16, UTF-32 strings, conversion to/from about
1151
200 encodings, collation and locale-sensitive case mappings, and more.  The
1152
library is currently designed for Unicode Standard 3.2.")
1153
    (license license:lgpl2.0+))) ; with an exception
1154
1155
(define-public ocaml-zed
1156
  (package
1157
    (name "ocaml-zed")
1158
    (version "1.4")
1159
    (source (origin
1160
              (method url-fetch)
1161
              (uri (string-append "https://github.com/diml/zed/archive/"
1162
                                  version ".tar.gz"))
1163
              (sha256
1164
               (base32
1165
                "0pvfq9ikhbkv4ksn3k3vzs6wiwkihjav3n81lhxm54z9931gfwnz"))))
1166
    (build-system ocaml-build-system)
1167
    (propagated-inputs
1168
     `(("camomile" ,ocaml-camomile)
1169
       ("react" ,ocaml-react)))
1170
    (home-page "https://github.com/diml/zed")
1171
    (synopsis "Abstract engine for text edition in OCaml")
1172
    (description "Zed is an abstract engine for text edition. It can be used to
1173
write text editors, edition widgets, readlines, ...
1174
1175
Zed uses Camomile to fully support the Unicode specification, and implements an
1176
UTF-8 encoded string type with validation, and a rope datastructure to achieve
1177
efficient operations on large Unicode buffers. Zed also features a regular
1178
expression search on ropes.
1179
1180
To support efficient text edition capabilities, Zed provides macro recording
1181
and cursor management facilities.")
1182
    (license license:bsd-3)))
1183
1184
(define-public ocaml-lambda-term
1185
  (package
1186
    (name "ocaml-lambda-term")
1187
    (version "1.10.1")
1188
    (home-page "https://github.com/diml/lambda-term")
1189
    (source (origin
1190
              (method url-fetch)
1191
              (uri (string-append home-page "/archive/" version ".tar.gz"))
1192
              (sha256
1193
               (base32
1194
                "1449glcsavcwbcsxbd7wcjz50y8vvin4zwpmkhq8i6jca3f3sknj"))))
1195
    (build-system ocaml-build-system)
1196
    (propagated-inputs
1197
     `(("zed" ,ocaml-zed)
1198
       ("lwt" ,ocaml-lwt)
1199
       ("react" ,ocaml-react)))
1200
    (arguments
1201
     `(#:phases
1202
       (modify-phases %standard-phases
1203
        (add-after 'install 'link-stubs
1204
          (lambda* (#:key outputs #:allow-other-keys)
1205
            (let* ((out (assoc-ref outputs "out"))
1206
                   (stubs (string-append out "/lib/ocaml/site-lib/stubslibs"))
1207
                   (lib (string-append out "/lib/ocaml/site-lib/lambda-term")))
1208
              (mkdir-p stubs)
1209
              (symlink (string-append lib "/dlllambda-term_stubs.so")
1210
                       (string-append stubs "/dlllambda-term_stubs.so"))))))))
1211
    (synopsis "Terminal manipulation library for OCaml")
1212
    (description "Lambda-term is a cross-platform library for manipulating the
1213
terminal. It provides an abstraction for keys, mouse events, colors, as well as
1214
a set of widgets to write curses-like applications.
1215
1216
The main objective of lambda-term is to provide a higher level functional
1217
interface to terminal manipulation than, for example, ncurses, by providing a
1218
native OCaml interface instead of bindings to a C library.
1219
1220
Lambda-term integrates with zed to provide text edition facilities in console
1221
applications.")
1222
    (license license:bsd-3)))
1223
1224
(define-public ocaml-utop
1225
  (package
1226
    (name "ocaml-utop")
1227
    (version "1.19.3")
1228
    (source (origin
1229
              (method url-fetch)
1230
              (uri (string-append "https://github.com/diml/utop/archive/"
1231
                                  version ".tar.gz"))
1232
              (file-name (string-append name "-" version ".tar.gz"))
1233
              (sha256
1234
               (base32
1235
                "16z02vp9n97iax4fqpbi7v86r75vbabxvnd1rirh8w2miixs1g4x"))))
1236
    (build-system ocaml-build-system)
1237
    (native-inputs
1238
     `(("cppo" ,ocaml-cppo)))
1239
    (propagated-inputs
1240
     `(("lambda-term" ,ocaml-lambda-term)
1241
       ("lwt" ,ocaml-lwt)
1242
       ("react" ,ocaml-react)))
1243
    (home-page "https://github.com/diml/utop")
1244
    (synopsis "Universal toplevel for OCaml")
1245
    (description "utop is an improved toplevel for OCaml.  It can run in a
1246
terminal or in Emacs.  It supports line edition, history, real-time and context
1247
sensitive completion, colors, and more.
1248
1249
It integrates with the tuareg mode in Emacs.")
1250
    (license license:bsd-3)))
1251