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 git-download)
23
  #:use-module (guix utils)
24
  #:use-module (guix build-system gnu)
25
  #:use-module (guix build-system ocaml)
26
  #:use-module ((guix licenses) #:prefix license:)
27
  #:use-module (gnu packages)
28
  #:use-module (gnu packages assembly)
29
  #:use-module (gnu packages autotools)
30
  #:use-module (gnu packages base)
31
  #:use-module (gnu packages bison)
32
  #:use-module (gnu packages boost)
33
  #:use-module (gnu packages check)
34
  #:use-module (gnu packages emacs)
35
  #:use-module (gnu packages flex)
36
  #:use-module (gnu packages llvm)
37
  #:use-module (gnu packages m4)
38
  #:use-module (gnu packages maths)
39
  #:use-module (gnu packages multiprecision)
40
  #:use-module (gnu packages ocaml)
41
  #:use-module (gnu packages perl)
42
  #:use-module (gnu packages pkg-config)
43
  #:use-module (gnu packages protobuf)
44
  #:use-module (gnu packages python)
45
  #:use-module (gnu packages tex)
46
  #:use-module (gnu packages texinfo)
47
  #:use-module (more packages smt))
48
49
(define (ocaml-forge-uri name version file-number)
50
  (string-append "https://forge.ocamlcore.org/frs/download.php/"
51
                 (number->string file-number) "/" name "-" version
52
                 ".tar.gz"))
53
54
(define-public ocaml-fix
55
  (package
56
    (inherit ocaml)
57
    (version "4.06.0")
58
    (source (origin
59
              (method url-fetch)
60
              (uri (string-append
61
                    "http://caml.inria.fr/pub/distrib/ocaml-"
62
                    (version-major+minor version)
63
                    "/ocaml-" version ".tar.xz"))
64
              (sha256
65
               (base32
66
                "1dy542yfnnw10zvh5s9qzswliq11mg7l0bcyss3501qw3vwvadhj"))))
67
    (arguments
68
     `(#:modules ((guix build gnu-build-system)
69
                  (guix build utils)
70
                  (web server))
71
       #:phases
72
       (modify-phases %standard-phases
73
         (add-after 'unpack 'patch-/bin/sh-references
74
           (lambda* (#:key inputs #:allow-other-keys)
75
             (let* ((sh (string-append (assoc-ref inputs "bash")
76
                                       "/bin/sh"))
77
                    (quoted-sh (string-append "\"" sh "\"")))
78
               (with-fluids ((%default-port-encoding #f))
79
                 (for-each
80
                  (lambda (file)
81
                    (substitute* file
82
                      (("\"/bin/sh\"")
83
                       (begin
84
                         (format (current-error-port) "\
85
patch-/bin/sh-references: ~a: changing `\"/bin/sh\"' to `~a'~%"
86
                                 file quoted-sh)
87
                         quoted-sh))))
88
                  (find-files "." "\\.ml$"))
89
                 #t))))
90
         (replace 'configure
91
           (lambda* (#:key outputs #:allow-other-keys)
92
             (let* ((out (assoc-ref outputs "out"))
93
                    (mandir (string-append out "/share/man")))
94
               ;; Custom configure script doesn't recognize
95
               ;; --prefix=<PREFIX> syntax (with equals sign).
96
               (zero? (system* "./configure"
97
                               "--prefix" out
98
                               "--mandir" mandir)))))
99
         (replace 'build
100
           (lambda _
101
             (zero? (system* "make" "-j1" ;; fails to build otherwise
102
                             "world.opt"))))
103
         (delete 'check)
104
         (add-after 'install 'check
105
           (lambda _
106
             (with-directory-excursion "testsuite"
107
               (zero? (system* "make" "all"))))))))))
108
109
(define-public proof-general2
110
  (package
111
    (name "proof-general2")
112
    (version "4.4")
113
    (source (origin
114
              (method url-fetch)
115
              (uri (string-append
116
                    "https://github.com/ProofGeneral/PG/archive/v"
117
                    version ".tar.gz"))
118
              (file-name (string-append name "-" version ".tar.gz"))
119
              (sha256
120
               (base32
121
                "0zif2fv6mm4pv75nh10q3p37n293495rvx470bx7ma382zc3d8hv"))))
122
    (build-system gnu-build-system)
123
    (native-inputs
124
     `(("which" ,which)
125
       ("emacs" ,emacs-minimal)
126
       ("texinfo" ,texinfo)))
127
    (inputs
128
     `(("host-emacs" ,emacs)
129
       ("perl" ,perl)
130
       ("coq" ,coq)))
131
    (arguments
132
     `(#:tests? #f  ; no check target
133
       #:make-flags (list (string-append "PREFIX=" %output)
134
                          (string-append "DEST_PREFIX=" %output)
135
                          "-j1")
136
       #:modules ((guix build gnu-build-system)
137
                  (guix build utils)
138
                  (guix build emacs-utils))
139
       #:imported-modules (,@%gnu-build-system-modules
140
                           (guix build emacs-utils))
141
       #:phases
142
       (modify-phases %standard-phases
143
         (delete 'configure)
144
         (add-after 'unpack 'disable-byte-compile-error-on-warn
145
                    (lambda _
146
                      (substitute* "Makefile"
147
                        (("\\(setq byte-compile-error-on-warn t\\)")
148
                         "(setq byte-compile-error-on-warn nil)"))
149
                      #t))
150
         (add-after 'unpack 'patch-hardcoded-paths
151
                    (lambda* (#:key inputs outputs #:allow-other-keys)
152
                      (let ((out   (assoc-ref outputs "out"))
153
                            (coq   (assoc-ref inputs "coq"))
154
                            (emacs (assoc-ref inputs "host-emacs")))
155
                        (define (coq-prog name)
156
                          (string-append coq "/bin/" name))
157
                        (substitute* "pgshell/pgshell.el"
158
                          (("/bin/sh") (which "sh")))
159
                        ;(emacs-substitute-variables "coq/coq.el"
160
                        ;  ("coq-prog-name"           (coq-prog "coqtop"))
161
                        ;  ("coq-compiler"            (coq-prog "coqc"))
162
                        ;  ("coq-dependency-analyzer" (coq-prog "coqdep")))
163
                        (substitute* "Makefile"
164
                          (("/sbin/install-info") "install-info"))
165
                        (substitute* "bin/proofgeneral"
166
                          (("^PGHOMEDEFAULT=.*" all)
167
                           (string-append all
168
                                          "PGHOME=$PGHOMEDEFAULT\n"
169
                                          "EMACS=" emacs "/bin/emacs")))
170
                        #t))))))
171
         ;(add-after 'unpack 'clean
172
         ;           (lambda _
173
         ;             ;; Delete the pre-compiled elc files for Emacs 23.
174
         ;             (zero? (system* "make" "clean"))))
175
         ;(add-after 'install 'install-doc
176
         ;           (lambda* (#:key make-flags #:allow-other-keys)
177
         ;             ;; XXX FIXME avoid building/installing pdf files,
178
         ;             ;; due to unresolved errors building them.
179
         ;             (substitute* "Makefile"
180
         ;               ((" [^ ]*\\.pdf") ""))
181
         ;             (zero? (apply system* "make" "install-doc"
182
         ;                           make-flags)))))))
183
    (home-page "http://proofgeneral.inf.ed.ac.uk/")
184
    (synopsis "Generic front-end for proof assistants based on Emacs")
185
    (description
186
     "Proof General is a major mode to turn Emacs into an interactive proof
187
assistant to write formal mathematical proofs using a variety of theorem
188
provers.")
189
    (license license:gpl2+)))
190
191
(define-public ocaml-build
192
  (package
193
    (name "ocaml-build")
194
    (version "0.11.0")
195
    (source (origin
196
              (method url-fetch)
197
              (uri (string-append "https://github.com/ocaml/ocamlbuild/archive/"
198
                                  version ".tar.gz"))
199
              (file-name (string-append name "-" version ".tar.gz"))
200
              (sha256
201
               (base32
202
                "1vh30731gv1brr4ljfzd6m5lni44ifyb1w8hwir81ff9874fs5qp"))))
203
    (build-system gnu-build-system)
204
    (arguments
205
     `(#:test-target "test"
206
       #:tests? #f; FIXME: tests fail to find Findlib
207
       #:make-flags
208
       (list (string-append "OCAMLBUILD_PREFIX=" (assoc-ref %outputs "out"))
209
             (string-append "OCAMLBUILD_BINDIR=" (assoc-ref %outputs "out") "/bin")
210
             (string-append "OCAMLBUILD_LIBDIR=" (assoc-ref %outputs "out") "/lib")
211
             (string-append "OCAMLBUILD_MANDIR=" (assoc-ref %outputs "out") "/share/man"))
212
       #:phases
213
       (modify-phases %standard-phases
214
         (delete 'bootstrap)
215
         (delete 'configure)
216
         ;(replace 'configure
217
         ;  (lambda* (#:key outputs #:allow-other-keys)
218
         ;    (let ((out (assoc-ref %outputs "out")))
219
         ;      (zero? (system* "make" "-f" "configure.make" "all")))))
220
         (add-before 'build 'findlib-environment
221
           (lambda* (#:key outputs #:allow-other-keys)
222
             (let* ((out (assoc-ref outputs "out")))
223
               (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib"))
224
               (setenv "OCAMLFIND_LDCONF" "ignore")
225
               #t))))))
226
    (native-inputs
227
     `(("ocaml" ,ocaml-fix)))
228
    (home-page "")
229
    (synopsis "")
230
    (description "")
231
    (license license:lgpl2.1+)))
232
233
(define-public camlp4-fix
234
  (package
235
    (inherit camlp4)
236
    (name "camlp4")
237
    (version "4.06+1")
238
    (source (origin
239
              (method url-fetch)
240
              (uri (string-append "https://github.com/ocaml/camlp4/archive/"
241
								  version ".tar.gz"))
242
              (file-name (string-append name "-" version ".tar.gz"))
243
              (sha256
244
               (base32
245
			    "08mrp8jjaayv0s50kmhjkafxqykff5dq3073hrl7ylx0km253k5i"))))
246
    (inputs `(("ocaml" ,ocaml-fix)))
247
    (native-inputs
248
     `(("ocaml" ,ocaml-fix)
249
       ("which" ,which)
250
       ("build" ,ocaml-build)))))
251
252
(define-public ocaml-findlib-fix
253
  (package
254
    (inherit ocaml-findlib)
255
    (version "1.7.3")
256
    (source (origin
257
              (method url-fetch)
258
              (uri (string-append "http://download.camlcity.org/download/findlib-"
259
                                  version ".tar.gz"))
260
              (sha256
261
               (base32
262
                "12xx8si1qv3xz90qsrpazjjk4lc1989fzm97rsmc4diwla7n15ni"))))
263
    (arguments
264
      (substitute-keyword-arguments (package-arguments ocaml-findlib)
265
        ((#:phases phases)
266
          `(modify-phases ,phases
267
            (add-before 'build 'fix-findlib-makefile
268
              (lambda* (#:key outputs #:allow-other-keys)
269
                (substitute* "src/findlib/Makefile"
270
                  (("\\$\\(prefix\\)\\$\\(OCAML_CORE_STDLIB\\)")
271
                   (string-append (assoc-ref outputs "out") "/lib/ocaml/site-lib")))
272
                #t))))))
273
    (native-inputs
274
     `(("camlp4" ,camlp4-fix)
275
       ("ocaml" ,ocaml-fix)
276
       ("m4" ,m4)))))
277
278
(define-public camlp5-fix
279
  (package
280
    (inherit camlp5)
281
    (name "camlp5")
282
    (version "7.03")
283
    (source (origin
284
              (method url-fetch)
285
              (uri (string-append "https://github.com/camlp5/camlp5/archive/rel"
286
                                  (string-delete #\. version) ".tar.gz"))
287
              (sha256
288
               (base32
289
                "06pj7l75r586gngam7nspd1a13ay7cj2bjh035z64w4fgaahlgf1"))))
290
    (inputs
291
     `(("ocaml" ,ocaml-fix)))))
292
293
(define-public lablgtk-fix
294
  (package
295
    (inherit lablgtk)
296
    (version "2.18.6")
297
    (source (origin
298
              (method url-fetch)
299
              (uri (ocaml-forge-uri "lablgtk" version 1726))
300
              (sha256
301
               (base32
302
                "1y38fdvswy6hmppm65qvgdk4pb3ghhnvz7n4ialf46340r1s5p2d"))))
303
    (arguments
304
     `(#:tests? #f ; no check target
305
306
       ;; opt: also install cmxa files
307
       #:make-flags (list "all" "opt"
308
                          "OCAMLFIND=ocamlfind"
309
                          "OCAMLLDCONF=ld.conf"
310
                          (string-append "FINDLIBDIR="
311
                                         (assoc-ref %outputs "out")
312
                                         "/lib/ocaml"))
313
       ;; Occasionally we would get "Error: Unbound module GtkThread" when
314
       ;; compiling 'gtkThInit.ml', with 'make -j'.  So build sequentially.
315
       #:parallel-build? #f
316
317
       #:phases
318
         (modify-phases %standard-phases
319
           (add-before 'install 'prepare-install
320
             (lambda* (#:key inputs outputs #:allow-other-keys)
321
               (let ((out (assoc-ref outputs "out"))
322
                     (ocaml (assoc-ref inputs "ocaml")))
323
                 ;; Install into the output and not the ocaml directory.
324
                 (mkdir-p (string-append out "/lib/ocaml"))
325
                 (substitute* "config.make"
326
                   ((ocaml) out))
327
                 #t))))))
328
    (home-page "http://lablgtk.forge.ocamlcore.org/")
329
    (native-inputs
330
     `(("ocaml" ,ocaml-fix)
331
       ("build" ,ocaml-build)
332
       ("camlp4" ,camlp4-fix)
333
       ("findlib" ,ocaml-findlib-fix)
334
       ("pkg-config" ,pkg-config)))))
335
336
(define-public ocaml-menhir-fix
337
  (package
338
    (inherit ocaml-menhir)
339
    (version "20170607")
340
    (name "ocaml-menhir-fix")
341
    (source (origin
342
              (method url-fetch)
343
              (uri (string-append
344
                    "http://gallium.inria.fr/~fpottier/menhir/"
345
                    "menhir-" version ".tar.gz"))
346
              (sha256
347
               (base32
348
                "0qffci9qxgfabzyalx851q994yykl4n9ylr4vbplsm6is1padjh0"))))
349
    (inputs
350
     `(("ocaml" ,ocaml-fix)
351
       ("ocamlbuild" ,ocaml-build)))))
352
353
(define-public ocaml-num
354
  (package
355
    (name "ocaml-num")
356
    (version "1.1")
357
    (source (origin
358
              (method url-fetch)
359
              (uri (string-append "https://github.com/ocaml/num/archive/v"
360
                                  version ".tar.gz"))
361
              (file-name (string-append name "-" version ".tar.gz"))
362
              (sha256
363
               (base32
364
                "1xlkd0svc0mgq5s7nrm2rjrsvg15i9wxqkc1kvwjp6sv8vv8bb04"))))
365
    (build-system ocaml-build-system)
366
    (arguments
367
     `(#:ocaml ,ocaml-fix
368
       #:findlib ,ocaml-findlib-fix
369
       #:phases
370
       (modify-phases %standard-phases
371
         (delete 'configure)
372
         (add-before 'build 'fix-makefile
373
           (lambda* (#:key outputs #:allow-other-keys)
374
             ;; This package supposes we install to the same directory as
375
             ;; the ocaml package.
376
             (substitute* "src/META"
377
               (("\"\\^\"") (string-append "\"" (assoc-ref outputs "out")
378
                                           "/lib/ocaml/site-lib\"")))
379
             (substitute* "src/Makefile"
380
               (("\\) \\$\\(STDLIBDIR\\)")
381
                (string-append ") " (assoc-ref outputs "out")
382
                               "/lib/ocaml/site-lib")))
383
             #t)))))
384
    (home-page "https://github.com/ocaml/num")
385
    (synopsis "")
386
    (description "")
387
    (license license:lgpl2.1+))); with linking exception
388
389
(define-public coq-fix
390
  (package
391
    (inherit coq)
392
    (native-inputs
393
     `(("ocamlbuild" ,ocaml-build)
394
       ("hevea" ,hevea)
395
       ("texlive" ,texlive)))
396
    (inputs
397
     `(("lablgtk" ,lablgtk-fix)
398
       ("python" ,python-2)
399
       ("camlp5" ,camlp5-fix)
400
       ;; ocaml-num was removed from the ocaml package in 4.06.
401
       ("ocaml-num" ,ocaml-num)))
402
    (arguments
403
     `(#:ocaml ,ocaml-fix
404
       #:findlib ,ocaml-findlib-fix
405
       #:phases
406
       (modify-phases %standard-phases
407
         (replace 'configure
408
           (lambda* (#:key outputs #:allow-other-keys)
409
             (let* ((out (assoc-ref outputs "out"))
410
                    (mandir (string-append out "/share/man"))
411
                    (browser "icecat -remote \"OpenURL(%s,new-tab)\""))
412
               (invoke "./configure"
413
                       "-prefix" out
414
                       "-mandir" mandir
415
                       "-browser" browser
416
                       "-coqide" "opt"))
417
             #t))
418
         (replace 'build
419
           (lambda* (#:key inputs #:allow-other-keys)
420
             (substitute* "ide/ideutils.ml"
421
               (("Bytes.unsafe_to_string read_string") "read_string"))
422
             (invoke "make" "-j" (number->string
423
                                  (parallel-job-count))
424
                     (string-append
425
                       "USERFLAGS=-I "
426
                       (assoc-ref inputs "ocaml-num")
427
                       "/lib/ocaml/site-lib")
428
                     "world")
429
             #t))
430
         (delete 'check)
431
         (add-after 'install 'check
432
           (lambda _
433
             (with-directory-excursion "test-suite"
434
               ;; These two tests fail.
435
               ;; This one fails because the output is not formatted as expected.
436
               (delete-file-recursively "coq-makefile/timing")
437
               ;; This one fails because we didn't build coqtop.byte.
438
               (delete-file-recursively "coq-makefile/findlib-package")
439
               (invoke "make"))
440
             #t)))))))
441
442
(define-public compcert
443
  (package
444
    (name "compcert")
445
    (version "3.2")
446
    (source (origin
447
              (method url-fetch)
448
              (uri (string-append "http://compcert.inria.fr/release/compcert-"
449
                                  version ".tgz"))
450
              (sha256
451
               (base32
452
                "11q4121s0rxva63njjwya7syfx9w0p4hzr6avh8s57vfbrcakc93"))))
453
    (build-system gnu-build-system)
454
    (arguments
455
     `(#:phases
456
       (modify-phases %standard-phases
457
         (replace 'configure
458
           (lambda* (#:key outputs #:allow-other-keys)
459
             (zero? (system* "./configure" "x86_64-linux" "-prefix"
460
                             (assoc-ref outputs "out"))))))
461
       #:tests? #f))
462
    (native-inputs
463
     `(("ocaml" ,ocaml-fix)
464
       ("coq" ,coq-fix)))
465
    (inputs
466
     `(("menhir" ,ocaml-menhir-fix)))
467
    (home-page "http://compcert.inria.fr")
468
    (synopsis "Certified C compiler")
469
    (description "CompCert is a certified (with coq) C compiler.  Warning: this
470
package is not free software!")
471
    ;; actually the "INRIA Non-Commercial License Agreement"
472
    ;; a non-free license.
473
    (license (license:non-copyleft "file:///LICENSE"))))
474
475
(define-public cubicle
476
  (package
477
    (name "cubicle")
478
    (version "1.1.1")
479
    (source (origin
480
              (method url-fetch)
481
              (uri (string-append "http://cubicle.lri.fr/cubicle-"
482
                                  version ".tar.gz"))
483
              (sha256
484
               (base32
485
                "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h"))))
486
    (build-system gnu-build-system)
487
    (native-inputs
488
     `(("ocaml" ,ocaml)
489
       ("which" ,which)))
490
    (propagated-inputs
491
     `(("z3" ,z3)))
492
    (arguments
493
     `(#:configure-flags (list "--with-z3")
494
       #:tests? #f
495
       #:phases
496
       (modify-phases %standard-phases
497
         (add-before 'configure 'configure-for-release
498
           (lambda _
499
             (substitute* "Makefile.in"
500
               (("SVNREV=") "#SVNREV="))))
501
         (add-before 'configure 'fix-/bin/sh
502
           (lambda _
503
             (substitute* "configure"
504
               (("/bin/sh") (which "sh")))))
505
         (add-before 'configure 'fix-smt-z3wrapper.ml
506
           (lambda _
507
             (substitute* "Makefile.in"
508
               (("\\\\n") "")))))))
509
    (home-page "http://cubicle.lri.fr/")
510
    (synopsis "Model checker for array-based systems")
511
    (description "Cubicle is an open source model checker for verifying safety
512
properties of array-based systems.  This is a syntactically restricted class of
513
parametrized transition systems with states represented as arrays indexed by an
514
arbitrary number of processes.  Cache coherence protocols and mutual exclusion
515
algorithms are typical examples of such systems.")
516
    (license license:asl2.0)))
517
518
(define-public ocaml-c2newspeak
519
  (package
520
    (name "ocaml-c2newspeak")
521
    (version "1")
522
    (source (origin
523
              (method git-fetch)
524
              (uri (git-reference
525
                     (url "https://github.com/airbus-seclab/c2newspeak")
526
                     (commit "c97fd380111a49fa7baeb9e49c45238fca627492")))
527
              (file-name (string-append name "-" version))
528
              (sha256
529
               (base32
530
                "0fxh868s5jraq61mnig9ilhyjzsq4iw32f20zh3982naanp4p8r6"))))
531
    (build-system ocaml-build-system)
532
    (arguments
533
     `(#:test-target "check"
534
       #:tests? #f
535
       #:phases
536
       (modify-phases %standard-phases
537
         (delete 'configure)
538
         (add-after 'install 'install-bin
539
           (lambda* (#:key outputs #:allow-other-keys)
540
             (install-file "bin/c2newspeak" (string-append (assoc-ref outputs "out") "/bin")))))))
541
    (home-page "https://github.com/airbus-seclab/c2newspeak")
542
    (synopsis "")
543
    (description "")
544
    (license license:lgpl2.1+)))
545
546
(define-public ocaml-bincat
547
  (package
548
    (name "ocaml-bincat")
549
    (version "0.8.1")
550
    (source (origin
551
              (method url-fetch)
552
              (uri (string-append "https://github.com/airbus-seclab/bincat/archive/v"
553
                                  version ".tar.gz"))
554
              (file-name (string-append name "-" version ".tar.gz"))
555
              (sha256
556
               (base32
557
                "1ncwm1h428x1bs4sq7ql1isrkhw0angglsa9hnsvhhw2i1jsdk7j"))))
558
    (build-system ocaml-build-system)
559
    (arguments
560
     `(#:tests? #f; disabled for now
561
       #:validate-runpath? #f; disabled for now
562
       #:make-flags
563
       (list (string-append "PREFIX=" (assoc-ref %outputs "out"))
564
             "LDCONFIG=true"
565
             (string-append "CFLAGS+=-I " (assoc-ref %build-inputs "ocaml")
566
                            "/lib/ocaml"))
567
       #:phases
568
       (modify-phases %standard-phases
569
         (delete 'configure)
570
         (add-before 'build 'python-path
571
           (lambda* (#:key outputs #:allow-other-keys)
572
             (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH")
573
                                                 ":../python:"
574
                                                 (assoc-ref outputs "out")
575
                                                 "/lib/python2.7/site-packages/"))
576
             #t))
577
         (add-before 'build 'fix-makefiles
578
           (lambda _
579
             (substitute* "ocaml/src/Makefile"
580
               (("GITVERSION:=.*") "GITVERSION:=0.8.1\n"))
581
             (substitute* "python/Makefile"
582
               (("./setup.py install") "./setup.py install --prefix=$(PREFIX)"))
583
             #t))
584
         (add-before 'check 'fix-test
585
           (lambda _
586
             (setenv "PATH" (string-append (getenv "PATH") ":" (getcwd) "/ocaml/src"))
587
             ;; Remove tests that require an armv8 compiler
588
             (substitute* "test/Makefile"
589
               (("eggloader_armv8 eggloader_armv7 eggloader_armv7thumb") ""))
590
             (chmod "test/eggloader_x86" #o755)
591
             #t))
592
         (add-before 'install 'install-python-dir
593
           (lambda* (#:key outputs #:allow-other-keys)
594
             (mkdir-p (string-append (assoc-ref outputs "out")
595
                                     "/lib/python2.7/site-packages/")))))))
596
    (inputs
597
     `(("c2newspeak" ,ocaml-c2newspeak)
598
       ("zarith" ,ocaml-zarith)
599
       ("menhir" ,ocaml-menhir)
600
       ("ocamlgraph" ,ocaml-graph)
601
       ("ocaml-cppo" ,ocaml-cppo)
602
       ("ocaml-ppx-tools" ,ocaml-ppx-tools)
603
       ("gmp" ,gmp)))
604
    (native-inputs
605
     `(("python" ,python-2)
606
       ("pytest" ,python2-pytest)
607
       ("sphinx" ,python2-sphinx)
608
       ("nasm" ,nasm)))
609
    (home-page "https://github.com/airbus-seclab/bincat")
610
    (synopsis "")
611
    (description "")
612
    (license license:lgpl2.1+)))
613
614
(define-public ocaml-ocplib-simplex
615
  (package
616
    (name "ocaml-ocplib-simplex")
617
    (version "0.4")
618
    (source (origin
619
              (method url-fetch)
620
              (uri (string-append "https://github.com/OCamlPro-Iguernlala/"
621
                                  "ocplib-simplex/archive/v" version ".tar.gz"))
622
              (sha256
623
               (base32
624
                "0y6q4bgly7fisdklriww48aknqf2vg4dphr7wwnd1wh80l4anzg1"))))
625
    (build-system gnu-build-system)
626
    (arguments
627
     `(#:tests? #f; Compilation error
628
       #:phases
629
       (modify-phases %standard-phases
630
         (add-after 'unpack 'autoreconf
631
           (lambda _
632
             (invoke "autoreconf" "-fiv")
633
             #t))
634
         (add-before 'install 'mkdir
635
           (lambda* (#:key outputs #:allow-other-keys)
636
             (let* ((out (assoc-ref outputs "out"))
637
                    (lib (string-append out "/lib")))
638
               (mkdir-p lib)
639
               #t))))))
640
    (native-inputs
641
     `(("autoconf" ,autoconf)
642
       ("automake" ,automake)
643
       ("ocaml" ,ocaml)
644
       ("ocaml-findlib" ,ocaml-findlib)
645
       ("which" ,which)))
646
    (home-page "")
647
    (synopsis "")
648
    (description "")
649
    ; lgpl2.1+ with linking exception
650
    (license license:lgpl2.1+)))
651
652
(define-public frama-c
653
  (package
654
    (name "frama-c")
655
    (version "20171101")
656
    (source (origin
657
              (method url-fetch)
658
              (uri (string-append "http://frama-c.com/download/frama-c-Sulfur-"
659
                                  version ".tar.gz"))
660
              (sha256
661
               (base32
662
                "1vwjfqmm1r36gkybsy3a7m89q5zicf4rnz5vlsn9imnpjpl9gjw1"))))
663
    (build-system ocaml-build-system)
664
    (arguments
665
     `(#:tests? #f; for now
666
       #:phases
667
       (modify-phases %standard-phases
668
         (add-before 'configure 'export-shell
669
           (lambda* (#:key inputs #:allow-other-keys)
670
             (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash")
671
                                                   "/bin/sh")))))))
672
    (inputs
673
     `(("gmp" ,gmp)
674
       ("ocaml-graph" ,ocaml-graph)
675
       ("ocaml-zarith" ,ocaml-zarith)))
676
    (home-page "")
677
    (synopsis "")
678
    (description "")
679
    (license license:lgpl2.1+)))
680