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