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 'configure) |
215 | ;(replace 'configure |
216 | ; (lambda* (#:key outputs #:allow-other-keys) |
217 | ; (let ((out (assoc-ref %outputs "out"))) |
218 | ; (zero? (system* "make" "-f" "configure.make" "all"))))) |
219 | (add-before 'build 'findlib-environment |
220 | (lambda* (#:key outputs #:allow-other-keys) |
221 | (let* ((out (assoc-ref outputs "out"))) |
222 | (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib")) |
223 | (setenv "OCAMLFIND_LDCONF" "ignore") |
224 | #t)))))) |
225 | (native-inputs |
226 | `(("ocaml" ,ocaml-fix))) |
227 | (home-page "") |
228 | (synopsis "") |
229 | (description "") |
230 | (license license:lgpl2.1+))) |
231 | |
232 | (define-public camlp4-fix |
233 | (package |
234 | (inherit camlp4) |
235 | (name "camlp4") |
236 | (version "4.06+1") |
237 | (source (origin |
238 | (method url-fetch) |
239 | (uri (string-append "https://github.com/ocaml/camlp4/archive/" |
240 | version ".tar.gz")) |
241 | (file-name (string-append name "-" version ".tar.gz")) |
242 | (sha256 |
243 | (base32 |
244 | "08mrp8jjaayv0s50kmhjkafxqykff5dq3073hrl7ylx0km253k5i")))) |
245 | (inputs `(("ocaml" ,ocaml-fix))) |
246 | (native-inputs |
247 | `(("ocaml" ,ocaml-fix) |
248 | ("which" ,which) |
249 | ("build" ,ocaml-build))))) |
250 | |
251 | (define-public ocaml-findlib-fix |
252 | (package |
253 | (inherit ocaml-findlib) |
254 | (version "1.7.3") |
255 | (source (origin |
256 | (method url-fetch) |
257 | (uri (string-append "http://download.camlcity.org/download/findlib-" |
258 | version ".tar.gz")) |
259 | (sha256 |
260 | (base32 |
261 | "12xx8si1qv3xz90qsrpazjjk4lc1989fzm97rsmc4diwla7n15ni")))) |
262 | (arguments |
263 | (substitute-keyword-arguments (package-arguments ocaml-findlib) |
264 | ((#:phases phases) |
265 | `(modify-phases ,phases |
266 | (add-before 'build 'fix-findlib-makefile |
267 | (lambda* (#:key outputs #:allow-other-keys) |
268 | (substitute* "src/findlib/Makefile" |
269 | (("\\$\\(prefix\\)\\$\\(OCAML_CORE_STDLIB\\)") |
270 | (string-append (assoc-ref outputs "out") "/lib/ocaml/site-lib"))) |
271 | #t)))))) |
272 | (native-inputs |
273 | `(("camlp4" ,camlp4-fix) |
274 | ("ocaml" ,ocaml-fix) |
275 | ("m4" ,m4))))) |
276 | |
277 | (define-public camlp5-fix |
278 | (package |
279 | (inherit camlp5) |
280 | (name "camlp5") |
281 | (version "7.03") |
282 | (source (origin |
283 | (method url-fetch) |
284 | (uri (string-append "https://github.com/camlp5/camlp5/archive/rel" |
285 | (string-delete #\. version) ".tar.gz")) |
286 | (sha256 |
287 | (base32 |
288 | "06pj7l75r586gngam7nspd1a13ay7cj2bjh035z64w4fgaahlgf1")))) |
289 | (inputs |
290 | `(("ocaml" ,ocaml-fix))))) |
291 | |
292 | (define-public lablgtk-fix |
293 | (package |
294 | (inherit lablgtk) |
295 | (version "2.18.6") |
296 | (source (origin |
297 | (method url-fetch) |
298 | (uri (ocaml-forge-uri "lablgtk" version 1726)) |
299 | (sha256 |
300 | (base32 |
301 | "1y38fdvswy6hmppm65qvgdk4pb3ghhnvz7n4ialf46340r1s5p2d")))) |
302 | (arguments |
303 | `(#:tests? #f ; no check target |
304 | |
305 | ;; opt: also install cmxa files |
306 | #:make-flags (list "all" "opt" |
307 | "OCAMLFIND=ocamlfind" |
308 | "OCAMLLDCONF=ld.conf" |
309 | (string-append "FINDLIBDIR=" |
310 | (assoc-ref %outputs "out") |
311 | "/lib/ocaml")) |
312 | ;; Occasionally we would get "Error: Unbound module GtkThread" when |
313 | ;; compiling 'gtkThInit.ml', with 'make -j'. So build sequentially. |
314 | #:parallel-build? #f |
315 | |
316 | #:phases |
317 | (modify-phases %standard-phases |
318 | (add-before 'install 'prepare-install |
319 | (lambda* (#:key inputs outputs #:allow-other-keys) |
320 | (let ((out (assoc-ref outputs "out")) |
321 | (ocaml (assoc-ref inputs "ocaml"))) |
322 | ;; Install into the output and not the ocaml directory. |
323 | (mkdir-p (string-append out "/lib/ocaml")) |
324 | (substitute* "config.make" |
325 | ((ocaml) out)) |
326 | #t)))))) |
327 | (home-page "http://lablgtk.forge.ocamlcore.org/") |
328 | (native-inputs |
329 | `(("ocaml" ,ocaml-fix) |
330 | ("build" ,ocaml-build) |
331 | ("camlp4" ,camlp4-fix) |
332 | ("findlib" ,ocaml-findlib-fix) |
333 | ("pkg-config" ,pkg-config))))) |
334 | |
335 | (define-public ocaml-menhir-fix |
336 | (package |
337 | (inherit ocaml-menhir) |
338 | (version "20170607") |
339 | (name "ocaml-menhir-fix") |
340 | (source (origin |
341 | (method url-fetch) |
342 | (uri (string-append |
343 | "http://gallium.inria.fr/~fpottier/menhir/" |
344 | "menhir-" version ".tar.gz")) |
345 | (sha256 |
346 | (base32 |
347 | "0qffci9qxgfabzyalx851q994yykl4n9ylr4vbplsm6is1padjh0")))) |
348 | (inputs |
349 | `(("ocaml" ,ocaml-fix) |
350 | ("ocamlbuild" ,ocaml-build))))) |
351 | |
352 | (define-public ocaml-num |
353 | (package |
354 | (name "ocaml-num") |
355 | (version "1.1") |
356 | (source (origin |
357 | (method url-fetch) |
358 | (uri (string-append "https://github.com/ocaml/num/archive/v" |
359 | version ".tar.gz")) |
360 | (file-name (string-append name "-" version ".tar.gz")) |
361 | (sha256 |
362 | (base32 |
363 | "1xlkd0svc0mgq5s7nrm2rjrsvg15i9wxqkc1kvwjp6sv8vv8bb04")))) |
364 | (build-system ocaml-build-system) |
365 | (arguments |
366 | `(#:ocaml ,ocaml-fix |
367 | #:findlib ,ocaml-findlib-fix |
368 | #:phases |
369 | (modify-phases %standard-phases |
370 | (delete 'configure) |
371 | (add-before 'build 'fix-makefile |
372 | (lambda* (#:key outputs #:allow-other-keys) |
373 | ;; This package supposes we install to the same directory as |
374 | ;; the ocaml package. |
375 | (substitute* "src/Makefile" |
376 | (("\\) \\$\\(STDLIBDIR\\)") |
377 | (string-append ") " (assoc-ref outputs "out") |
378 | "/lib/ocaml/site-lib")))))))) |
379 | (home-page "https://github.com/ocaml/num") |
380 | (synopsis "") |
381 | (description "") |
382 | (license license:lgpl2.1+))); with linking exception |
383 | |
384 | (define-public coq-fix |
385 | (package |
386 | (inherit coq) |
387 | (native-inputs |
388 | `(("ocamlbuild" ,ocaml-build) |
389 | ("hevea" ,hevea) |
390 | ("texlive" ,texlive))) |
391 | (inputs |
392 | `(("lablgtk" ,lablgtk-fix) |
393 | ("python" ,python-2) |
394 | ("camlp5" ,camlp5-fix) |
395 | ;; ocaml-num was removed from the ocaml package in 4.06. |
396 | ("num" ,ocaml-num))) |
397 | (arguments |
398 | `(#:ocaml ,ocaml-fix |
399 | #:findlib ,ocaml-findlib-fix |
400 | #:phases |
401 | (modify-phases %standard-phases |
402 | (replace 'configure |
403 | (lambda* (#:key outputs #:allow-other-keys) |
404 | (let* ((out (assoc-ref outputs "out")) |
405 | (mandir (string-append out "/share/man")) |
406 | (browser "icecat -remote \"OpenURL(%s,new-tab)\"")) |
407 | (zero? (system* "./configure" |
408 | "-prefix" out |
409 | "-mandir" mandir |
410 | "-browser" browser |
411 | "-coqide" "opt"))))) |
412 | (replace 'build |
413 | (lambda* (#:key inputs #:allow-other-keys) |
414 | (substitute* "ide/ideutils.ml" |
415 | (("Bytes.unsafe_to_string read_string") "read_string")) |
416 | (zero? (system* "make" "-j" (number->string |
417 | (parallel-job-count)) |
418 | (string-append |
419 | "USERFLAGS=-I " |
420 | (assoc-ref inputs "num") |
421 | "/lib/ocaml/site-lib") |
422 | "world")))) |
423 | (delete 'check) |
424 | (add-after 'install 'check |
425 | (lambda _ |
426 | (with-directory-excursion "test-suite" |
427 | ;; These two tests fail. |
428 | ;; This one fails because the output is not formatted as expected. |
429 | (delete-file-recursively "coq-makefile/timing") |
430 | ;; This one fails because we didn't build coqtop.byte. |
431 | (delete-file-recursively "coq-makefile/findlib-package") |
432 | (zero? (system* "make")))))))))) |
433 | |
434 | (define-public compcert |
435 | (package |
436 | (name "compcert") |
437 | (version "3.2") |
438 | (source (origin |
439 | (method url-fetch) |
440 | (uri (string-append "http://compcert.inria.fr/release/compcert-" |
441 | version ".tgz")) |
442 | (sha256 |
443 | (base32 |
444 | "11q4121s0rxva63njjwya7syfx9w0p4hzr6avh8s57vfbrcakc93")))) |
445 | (build-system gnu-build-system) |
446 | (arguments |
447 | `(#:phases |
448 | (modify-phases %standard-phases |
449 | (replace 'configure |
450 | (lambda* (#:key outputs #:allow-other-keys) |
451 | (zero? (system* "./configure" "x86_64-linux" "-prefix" |
452 | (assoc-ref outputs "out")))))) |
453 | #:tests? #f)) |
454 | (native-inputs |
455 | `(("ocaml" ,ocaml-fix) |
456 | ("coq" ,coq-fix))) |
457 | (inputs |
458 | `(("menhir" ,ocaml-menhir-fix))) |
459 | (home-page "http://compcert.inria.fr") |
460 | (synopsis "Certified C compiler") |
461 | (description "CompCert is a certified (with coq) C compiler. Warning: this |
462 | package is not free software!") |
463 | ;; actually the "INRIA Non-Commercial License Agreement" |
464 | ;; a non-free license. |
465 | (license (license:non-copyleft "file:///LICENSE")))) |
466 | |
467 | (define-public cubicle |
468 | (package |
469 | (name "cubicle") |
470 | (version "1.1.1") |
471 | (source (origin |
472 | (method url-fetch) |
473 | (uri (string-append "http://cubicle.lri.fr/cubicle-" |
474 | version ".tar.gz")) |
475 | (sha256 |
476 | (base32 |
477 | "1sny9c4fm14k014pk62ibpwbrjjirkx8xmhs9jg7q1hk7y7x3q2h")))) |
478 | (build-system gnu-build-system) |
479 | (native-inputs |
480 | `(("ocaml" ,ocaml) |
481 | ("which" ,which))) |
482 | (propagated-inputs |
483 | `(("z3" ,z3))) |
484 | (arguments |
485 | `(#:configure-flags (list "--with-z3") |
486 | #:tests? #f |
487 | #:phases |
488 | (modify-phases %standard-phases |
489 | (add-before 'configure 'configure-for-release |
490 | (lambda _ |
491 | (substitute* "Makefile.in" |
492 | (("SVNREV=") "#SVNREV=")))) |
493 | (add-before 'configure 'fix-/bin/sh |
494 | (lambda _ |
495 | (substitute* "configure" |
496 | (("/bin/sh") (which "sh"))))) |
497 | (add-before 'configure 'fix-smt-z3wrapper.ml |
498 | (lambda _ |
499 | (substitute* "Makefile.in" |
500 | (("\\\\n") ""))))))) |
501 | (home-page "http://cubicle.lri.fr/") |
502 | (synopsis "Model checker for array-based systems") |
503 | (description "Cubicle is an open source model checker for verifying safety |
504 | properties of array-based systems. This is a syntactically restricted class of |
505 | parametrized transition systems with states represented as arrays indexed by an |
506 | arbitrary number of processes. Cache coherence protocols and mutual exclusion |
507 | algorithms are typical examples of such systems.") |
508 | (license license:asl2.0))) |
509 | |
510 | (define-public ocaml-c2newspeak |
511 | (package |
512 | (name "ocaml-c2newspeak") |
513 | (version "1") |
514 | (source (origin |
515 | (method git-fetch) |
516 | (uri (git-reference |
517 | (url "https://github.com/airbus-seclab/c2newspeak") |
518 | (commit "c97fd380111a49fa7baeb9e49c45238fca627492"))) |
519 | (file-name (string-append name "-" version)) |
520 | (sha256 |
521 | (base32 |
522 | "0fxh868s5jraq61mnig9ilhyjzsq4iw32f20zh3982naanp4p8r6")))) |
523 | (build-system ocaml-build-system) |
524 | (arguments |
525 | `(#:test-target "check" |
526 | #:tests? #f |
527 | #:phases |
528 | (modify-phases %standard-phases |
529 | (delete 'configure) |
530 | (add-after 'install 'install-bin |
531 | (lambda* (#:key outputs #:allow-other-keys) |
532 | (install-file "bin/c2newspeak" (string-append (assoc-ref outputs "out") "/bin"))))))) |
533 | (home-page "https://github.com/airbus-seclab/c2newspeak") |
534 | (synopsis "") |
535 | (description "") |
536 | (license license:lgpl2.1+))) |
537 | |
538 | (define-public ocaml-bincat |
539 | (package |
540 | (name "ocaml-bincat") |
541 | (version "0.8.1") |
542 | (source (origin |
543 | (method url-fetch) |
544 | (uri (string-append "https://github.com/airbus-seclab/bincat/archive/v" |
545 | version ".tar.gz")) |
546 | (file-name (string-append name "-" version ".tar.gz")) |
547 | (sha256 |
548 | (base32 |
549 | "1ncwm1h428x1bs4sq7ql1isrkhw0angglsa9hnsvhhw2i1jsdk7j")))) |
550 | (build-system ocaml-build-system) |
551 | (arguments |
552 | `(#:tests? #f; disabled for now |
553 | #:validate-runpath? #f; disabled for now |
554 | #:make-flags |
555 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) |
556 | "LDCONFIG=true" |
557 | (string-append "CFLAGS+=-I " (assoc-ref %build-inputs "ocaml") |
558 | "/lib/ocaml")) |
559 | #:phases |
560 | (modify-phases %standard-phases |
561 | (delete 'configure) |
562 | (add-before 'build 'python-path |
563 | (lambda* (#:key outputs #:allow-other-keys) |
564 | (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") |
565 | ":../python:" |
566 | (assoc-ref outputs "out") |
567 | "/lib/python2.7/site-packages/")) |
568 | #t)) |
569 | (add-before 'build 'fix-makefiles |
570 | (lambda _ |
571 | (substitute* "ocaml/src/Makefile" |
572 | (("GITVERSION:=.*") "GITVERSION:=0.8.1\n")) |
573 | (substitute* "python/Makefile" |
574 | (("./setup.py install") "./setup.py install --prefix=$(PREFIX)")) |
575 | #t)) |
576 | (add-before 'check 'fix-test |
577 | (lambda _ |
578 | (setenv "PATH" (string-append (getenv "PATH") ":" (getcwd) "/ocaml/src")) |
579 | ;; Remove tests that require an armv8 compiler |
580 | (substitute* "test/Makefile" |
581 | (("eggloader_armv8 eggloader_armv7 eggloader_armv7thumb") "")) |
582 | (chmod "test/eggloader_x86" #o755) |
583 | #t)) |
584 | (add-before 'install 'install-python-dir |
585 | (lambda* (#:key outputs #:allow-other-keys) |
586 | (mkdir-p (string-append (assoc-ref outputs "out") |
587 | "/lib/python2.7/site-packages/"))))))) |
588 | (inputs |
589 | `(("c2newspeak" ,ocaml-c2newspeak) |
590 | ("zarith" ,ocaml-zarith) |
591 | ("menhir" ,ocaml-menhir) |
592 | ("ocamlgraph" ,ocaml-graph) |
593 | ("ocaml-cppo" ,ocaml-cppo) |
594 | ("ocaml-ppx-tools" ,ocaml-ppx-tools) |
595 | ("gmp" ,gmp))) |
596 | (native-inputs |
597 | `(("python" ,python-2) |
598 | ("pytest" ,python2-pytest) |
599 | ("sphinx" ,python2-sphinx) |
600 | ("nasm" ,nasm))) |
601 | (home-page "https://github.com/airbus-seclab/bincat") |
602 | (synopsis "") |
603 | (description "") |
604 | (license license:lgpl2.1+))) |
605 | |
606 | (define-public ocaml-ocplib-simplex |
607 | (package |
608 | (name "ocaml-ocplib-simplex") |
609 | (version "0.4") |
610 | (source (origin |
611 | (method url-fetch) |
612 | (uri (string-append "https://github.com/OCamlPro-Iguernlala/" |
613 | "ocplib-simplex/archive/v" version ".tar.gz")) |
614 | (sha256 |
615 | (base32 |
616 | "0y6q4bgly7fisdklriww48aknqf2vg4dphr7wwnd1wh80l4anzg1")))) |
617 | (build-system gnu-build-system) |
618 | (arguments |
619 | `(#:tests? #f; Compilation error |
620 | #:phases |
621 | (modify-phases %standard-phases |
622 | (add-after 'unpack 'autoreconf |
623 | (lambda _ |
624 | (invoke "autoreconf" "-fiv") |
625 | #t)) |
626 | (add-before 'install 'mkdir |
627 | (lambda* (#:key outputs #:allow-other-keys) |
628 | (let* ((out (assoc-ref outputs "out")) |
629 | (lib (string-append out "/lib"))) |
630 | (mkdir-p lib) |
631 | #t)))))) |
632 | (native-inputs |
633 | `(("autoconf" ,autoconf) |
634 | ("automake" ,automake) |
635 | ("ocaml" ,ocaml) |
636 | ("ocaml-findlib" ,ocaml-findlib) |
637 | ("which" ,which))) |
638 | (home-page "") |
639 | (synopsis "") |
640 | (description "") |
641 | ; lgpl2.1+ with linking exception |
642 | (license license:lgpl2.1+))) |
643 | |
644 | (define-public frama-c |
645 | (package |
646 | (name "frama-c") |
647 | (version "20171101") |
648 | (source (origin |
649 | (method url-fetch) |
650 | (uri (string-append "http://frama-c.com/download/frama-c-Sulfur-" |
651 | version ".tar.gz")) |
652 | (sha256 |
653 | (base32 |
654 | "1vwjfqmm1r36gkybsy3a7m89q5zicf4rnz5vlsn9imnpjpl9gjw1")))) |
655 | (build-system ocaml-build-system) |
656 | (arguments |
657 | `(#:tests? #f; for now |
658 | #:phases |
659 | (modify-phases %standard-phases |
660 | (add-before 'configure 'export-shell |
661 | (lambda* (#:key inputs #:allow-other-keys) |
662 | (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash") |
663 | "/bin/sh"))))))) |
664 | (inputs |
665 | `(("gmp" ,gmp) |
666 | ("ocaml-graph" ,ocaml-graph) |
667 | ("ocaml-zarith" ,ocaml-zarith))) |
668 | (home-page "") |
669 | (synopsis "") |
670 | (description "") |
671 | (license license:lgpl2.1+))) |
672 | |
673 | (define-public coq-8.8 |
674 | (package |
675 | (inherit coq) |
676 | (name "coq") |
677 | (version "8.8.0") |
678 | (source (origin |
679 | (method url-fetch) |
680 | (uri (string-append "https://github.com/coq/coq/archive/V" |
681 | version ".tar.gz")) |
682 | (file-name (string-append name "-" version ".tar.gz")) |
683 | (sha256 |
684 | (base32 |
685 | "0g96k2x6lbddlmkmdaczvcpb2gwqi1ydbq9bv4gf9q38kv9w3xya")))))) |
686 |