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