ocaml.scm
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2017-2019 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 dune) |
25 | #:use-module (guix build-system gnu) |
26 | #:use-module (guix build-system ocaml) |
27 | #:use-module ((guix licenses) #:prefix license:) |
28 | #:use-module (gnu packages) |
29 | #:use-module (gnu packages assembly) |
30 | #:use-module (gnu packages autotools) |
31 | #:use-module (gnu packages base) |
32 | #:use-module (gnu packages bison) |
33 | #:use-module (gnu packages boost) |
34 | #:use-module (gnu packages check) |
35 | #:use-module (gnu packages compression) |
36 | #:use-module (gnu packages coq) |
37 | #:use-module (gnu packages emacs) |
38 | #:use-module (gnu packages flex) |
39 | #:use-module (gnu packages llvm) |
40 | #:use-module (gnu packages m4) |
41 | #:use-module (gnu packages maths) |
42 | #:use-module (gnu packages multiprecision) |
43 | #:use-module (gnu packages ocaml) |
44 | #:use-module (gnu packages perl) |
45 | #:use-module (gnu packages pkg-config) |
46 | #:use-module (gnu packages protobuf) |
47 | #:use-module (gnu packages python) |
48 | #:use-module (gnu packages python-xyz) |
49 | #:use-module (gnu packages sphinx) |
50 | #:use-module (gnu packages tex) |
51 | #:use-module (gnu packages texinfo) |
52 | #:use-module (more packages smt) |
53 | #:use-module (ice-9 match)) |
54 | |
55 | (define (ocaml-forge-uri name version file-number) |
56 | (string-append "https://forge.ocamlcore.org/frs/download.php/" |
57 | (number->string file-number) "/" name "-" version |
58 | ".tar.gz")) |
59 | |
60 | (define-public proof-general2 |
61 | (package |
62 | (name "proof-general2") |
63 | (version "4.4") |
64 | (source (origin |
65 | (method url-fetch) |
66 | (uri (string-append |
67 | "https://github.com/ProofGeneral/PG/archive/v" |
68 | version ".tar.gz")) |
69 | (file-name (string-append name "-" version ".tar.gz")) |
70 | (sha256 |
71 | (base32 |
72 | "0zif2fv6mm4pv75nh10q3p37n293495rvx470bx7ma382zc3d8hv")))) |
73 | (build-system gnu-build-system) |
74 | (native-inputs |
75 | `(("which" ,which) |
76 | ("emacs" ,emacs-minimal) |
77 | ("texinfo" ,texinfo))) |
78 | (inputs |
79 | `(("host-emacs" ,emacs) |
80 | ("perl" ,perl) |
81 | ("coq" ,coq))) |
82 | (arguments |
83 | `(#:tests? #f ; no check target |
84 | #:make-flags (list (string-append "PREFIX=" %output) |
85 | (string-append "DEST_PREFIX=" %output) |
86 | "-j1") |
87 | #:modules ((guix build gnu-build-system) |
88 | (guix build utils) |
89 | (guix build emacs-utils)) |
90 | #:imported-modules (,@%gnu-build-system-modules |
91 | (guix build emacs-utils)) |
92 | #:phases |
93 | (modify-phases %standard-phases |
94 | (delete 'configure) |
95 | (add-after 'unpack 'disable-byte-compile-error-on-warn |
96 | (lambda _ |
97 | (substitute* "Makefile" |
98 | (("\\(setq byte-compile-error-on-warn t\\)") |
99 | "(setq byte-compile-error-on-warn nil)")) |
100 | #t)) |
101 | (add-after 'unpack 'patch-hardcoded-paths |
102 | (lambda* (#:key inputs outputs #:allow-other-keys) |
103 | (let ((out (assoc-ref outputs "out")) |
104 | (coq (assoc-ref inputs "coq")) |
105 | (emacs (assoc-ref inputs "host-emacs"))) |
106 | (define (coq-prog name) |
107 | (string-append coq "/bin/" name)) |
108 | (substitute* "pgshell/pgshell.el" |
109 | (("/bin/sh") (which "sh"))) |
110 | ;(emacs-substitute-variables "coq/coq.el" |
111 | ; ("coq-prog-name" (coq-prog "coqtop")) |
112 | ; ("coq-compiler" (coq-prog "coqc")) |
113 | ; ("coq-dependency-analyzer" (coq-prog "coqdep"))) |
114 | (substitute* "Makefile" |
115 | (("/sbin/install-info") "install-info")) |
116 | (substitute* "bin/proofgeneral" |
117 | (("^PGHOMEDEFAULT=.*" all) |
118 | (string-append all |
119 | "PGHOME=$PGHOMEDEFAULT\n" |
120 | "EMACS=" emacs "/bin/emacs"))) |
121 | #t)))))) |
122 | ;(add-after 'unpack 'clean |
123 | ; (lambda _ |
124 | ; ;; Delete the pre-compiled elc files for Emacs 23. |
125 | ; (zero? (system* "make" "clean")))) |
126 | ;(add-after 'install 'install-doc |
127 | ; (lambda* (#:key make-flags #:allow-other-keys) |
128 | ; ;; XXX FIXME avoid building/installing pdf files, |
129 | ; ;; due to unresolved errors building them. |
130 | ; (substitute* "Makefile" |
131 | ; ((" [^ ]*\\.pdf") "")) |
132 | ; (zero? (apply system* "make" "install-doc" |
133 | ; make-flags))))))) |
134 | (home-page "http://proofgeneral.inf.ed.ac.uk/") |
135 | (synopsis "Generic front-end for proof assistants based on Emacs") |
136 | (description |
137 | "Proof General is a major mode to turn Emacs into an interactive proof |
138 | assistant to write formal mathematical proofs using a variety of theorem |
139 | provers.") |
140 | (license license:gpl2+))) |
141 | |
142 | (define-public coq-8.6 |
143 | (package |
144 | (inherit coq) |
145 | (name "coq") |
146 | (version "8.6.1") |
147 | (source (origin |
148 | (method url-fetch) |
149 | (uri (string-append "https://github.com/coq/coq/archive/V" |
150 | version ".tar.gz")) |
151 | (file-name (string-append name "-" version ".tar.gz")) |
152 | (sha256 |
153 | (base32 |
154 | "02nm5sn79hrb9fdmkhyclk80jydadf4jcafmr3idwr5h4z56qbms")))) |
155 | (arguments |
156 | `(#:phases |
157 | (modify-phases %standard-phases |
158 | (add-before 'configure 'fix-latest-ocaml |
159 | (lambda* (#:key inputs #:allow-other-keys) |
160 | (substitute* "Makefile.build" |
161 | (("MLINCLUDES=") (string-append |
162 | "MLINCLUDES=-I " |
163 | (assoc-ref inputs "ocaml-num") |
164 | "/lib/ocaml/site-lib "))) |
165 | (substitute* "configure.ml" |
166 | (("CAMLFLAGS=") "CAMLFLAGS=-unsafe-string -package num ")) |
167 | (substitute* "ide/ideutils.ml" |
168 | (("String.blit") "Bytes.blit")) |
169 | (substitute* "tools/coqmktop.ml" |
170 | (("nums") (string-append (assoc-ref inputs "ocaml-num") |
171 | "/lib/ocaml/site-lib/nums")) |
172 | (("\"-linkall\"") "\"-linkall\" :: \"-package\" :: \"num\"")) |
173 | #t)) |
174 | (replace 'configure |
175 | (lambda* (#:key outputs #:allow-other-keys) |
176 | (let* ((out (assoc-ref outputs "out")) |
177 | (mandir (string-append out "/share/man")) |
178 | (browser "icecat -remote \"OpenURL(%s,new-tab)\"")) |
179 | (invoke "./configure" |
180 | "-prefix" out |
181 | "-mandir" mandir |
182 | "-browser" browser |
183 | "-coqide" "opt")) |
184 | #t)) |
185 | (replace 'build |
186 | (lambda* (#:key inputs #:allow-other-keys) |
187 | (invoke "make" "-j" (number->string |
188 | (parallel-job-count)) |
189 | "world") |
190 | #t)) |
191 | (delete 'check) |
192 | (add-after 'install 'check |
193 | (lambda _ |
194 | (with-directory-excursion "test-suite" |
195 | (invoke "make")) |
196 | #t))))) |
197 | (native-inputs '()) |
198 | (inputs |
199 | `(("lablgtk" ,lablgtk) |
200 | ("python" ,python-2) |
201 | ("camlp5" ,camlp5) |
202 | ("ocaml-num" ,ocaml-num))))) |
203 | |
204 | (define-public coq-8.7 |
205 | (package |
206 | (inherit coq) |
207 | (name "coq") |
208 | (version "8.7.2") |
209 | (source (origin |
210 | (method url-fetch) |
211 | (uri (string-append "https://github.com/coq/coq/archive/V" |
212 | version ".tar.gz")) |
213 | (file-name (string-append name "-" version ".tar.gz")) |
214 | (sha256 |
215 | (base32 |
216 | "1lkqvs7ayzv5kkg26y837pg0d6r2b5hbjxl71ba93f39kybw69gg")))) |
217 | (arguments |
218 | `(#:phases |
219 | (modify-phases %standard-phases |
220 | (replace 'configure |
221 | (lambda* (#:key outputs #:allow-other-keys) |
222 | (let* ((out (assoc-ref outputs "out")) |
223 | (mandir (string-append out "/share/man")) |
224 | (browser "icecat -remote \"OpenURL(%s,new-tab)\"")) |
225 | (invoke "./configure" |
226 | "-prefix" out |
227 | "-mandir" mandir |
228 | "-browser" browser |
229 | "-coqide" "opt")) |
230 | #t)) |
231 | (replace 'build |
232 | (lambda* (#:key inputs #:allow-other-keys) |
233 | (substitute* "ide/ideutils.ml" |
234 | (("Bytes.unsafe_to_string read_string") "read_string")) |
235 | (invoke "make" "-j" (number->string |
236 | (parallel-job-count)) |
237 | (string-append |
238 | "USERFLAGS=-I " |
239 | (assoc-ref inputs "ocaml-num") |
240 | "/lib/ocaml/site-lib") |
241 | "world") |
242 | #t)) |
243 | (delete 'check) |
244 | (add-after 'install 'check |
245 | (lambda _ |
246 | (with-directory-excursion "test-suite" |
247 | ;; These two tests fail. |
248 | ;; This one fails because the output is not formatted as expected. |
249 | (delete-file-recursively "coq-makefile/timing") |
250 | ;; This one fails because we didn't build coqtop.byte. |
251 | (delete-file-recursively "coq-makefile/findlib-package") |
252 | (invoke "make")) |
253 | #t))))))) |
254 | |
255 | (define-public coq-8.8 |
256 | (package |
257 | (inherit coq) |
258 | (name "coq") |
259 | (version "8.8.2") |
260 | (source (origin |
261 | (method url-fetch) |
262 | (uri (string-append "https://github.com/coq/coq/archive/V" |
263 | version ".tar.gz")) |
264 | (file-name (string-append name "-" version ".tar.gz")) |
265 | (sha256 |
266 | (base32 |
267 | "0i2hs0i6rp27cy8zd0mx7jscqw5cx2y0diw0pxgij66s3yr47y7r")))) |
268 | (native-inputs |
269 | `(("ocaml-ounit" ,ocaml-ounit) |
270 | ,@(package-native-inputs coq))))) |
271 | |
272 | (define-public coq-bignums-8.7 |
273 | (package |
274 | (inherit coq-bignums) |
275 | (name "coq-bignums") |
276 | (version "8.7.0") |
277 | (source (origin |
278 | (method url-fetch) |
279 | (uri (string-append "https://github.com/coq/bignums/archive/V" |
280 | version ".tar.gz")) |
281 | (file-name (string-append name "-" version ".tar.gz")) |
282 | (sha256 |
283 | (base32 |
284 | "03iw9jiwq9jx45gsvp315y3lxr8m9ksppmcjvxs5c23qnky6zqjx")))) |
285 | (native-inputs |
286 | `(("ocaml" ,ocaml) |
287 | ("coq-8.7" ,coq-8.7))) |
288 | (inputs |
289 | `(("camlp5" ,camlp5))))) |
290 | |
291 | (define-public ppsimpl |
292 | (package |
293 | (name "ppsimpl") |
294 | (version "8.7") |
295 | (source (origin |
296 | (method git-fetch) |
297 | (uri (git-reference |
298 | (url "https://scm.gforge.inria.fr/anonscm/git/ppsimpl/ppsimpl.git") |
299 | (commit "86255a47568df58767d1d8e0b9e2da31cf73a5fc"))) |
300 | (file-name (string-append name "-" version)) |
301 | (sha256 |
302 | (base32 |
303 | "0h509w43j2wd2pyx04k3xfd0bsbmqscwqvhf8whzc3cxzl4j6vvq")))) |
304 | ;(uri "https://gforge.inria.fr/frs/download.php/file/37615/ppsimpl-09-07-2018.tar.gz") |
305 | ;(sha256 |
306 | ; (base32 |
307 | ; "010zgskc1wd5v6wmmyxaapvwxjlgbdqqiks2dvf6llx03b07ak59")))) |
308 | (build-system gnu-build-system) |
309 | (arguments |
310 | `(#:test-target "test" |
311 | #:configure-flags |
312 | (list "-R" (string-append (assoc-ref %build-inputs "compcert") "/lib/coq/user-contrib/compcert") "compcert") |
313 | #:make-flags (list "COQC=coqc -R src PP -I src" |
314 | (string-append |
315 | "COQLIBINSTALL=" |
316 | (assoc-ref %outputs "out") |
317 | "/lib/coq/user-contrib")))) |
318 | (inputs |
319 | `(("coq-bignums-8.7" ,coq-bignums-8.7) |
320 | ("compcert" ,compcert))) |
321 | (native-inputs |
322 | `(("coq-8.7" ,coq-8.7) |
323 | ("ocaml" ,ocaml) |
324 | ("ocaml-findlib" ,ocaml-findlib) |
325 | ("camlp4" ,camlp4) |
326 | ("camlp5" ,camlp5) |
327 | ("which" ,which))) |
328 | (home-page "") |
329 | (synopsis "") |
330 | (description "") |
331 | ;; No declared license -> all rights reserved |
332 | (license #f))) |
333 | |
334 | (define-public compcert |
335 | (package |
336 | (name "compcert") |
337 | (version "3.5") |
338 | (source (origin |
339 | (method url-fetch) |
340 | (uri (string-append "http://compcert.inria.fr/release/compcert-" |
341 | version ".tgz")) |
342 | (sha256 |
343 | (base32 |
344 | "02dmd4iw6b5i38svaycjsywlpmg0kaypc01vxi6ndyywx6giz80y")))) |
345 | (build-system gnu-build-system) |
346 | (arguments |
347 | `(#:phases |
348 | (modify-phases %standard-phases |
349 | (replace 'configure |
350 | (lambda* (#:key outputs #:allow-other-keys) |
351 | (let ((system ,(match (or (%current-target-system) (%current-system)) |
352 | ("x86_64-linux" "x86_64-linux") |
353 | ("i686-linux" "x86_32-linux") |
354 | ("armhf-linux" "arm-linux")))) |
355 | (format #t "Building for ~a~%" system) |
356 | (invoke "./configure" system "-prefix" |
357 | (assoc-ref outputs "out"))) |
358 | #t)) |
359 | (add-after 'install 'install-lib |
360 | (lambda* (#:key outputs #:allow-other-keys) |
361 | (for-each |
362 | (lambda (file) |
363 | (install-file |
364 | file |
365 | (string-append |
366 | (assoc-ref outputs "out") |
367 | "/lib/coq/user-contrib/compcert/" (dirname file)))) |
368 | (find-files "." ".*.vo$")) |
369 | #t))) |
370 | #:tests? #f)) |
371 | (native-inputs |
372 | `(("ocaml" ,ocaml) |
373 | ("ocaml-findlib" ,ocaml-findlib); for menhir --suggest-menhirlib |
374 | ("coq" ,coq))) |
375 | (inputs |
376 | `(("menhir" ,ocaml-menhir))) |
377 | (home-page "http://compcert.inria.fr") |
378 | (synopsis "Certified C compiler") |
379 | (description "CompCert is a certified (with coq) C compiler. Warning: this |
380 | package is not free software!") |
381 | ;; actually the "INRIA Non-Commercial License Agreement" |
382 | ;; a non-free license. |
383 | (license (license:non-copyleft "file:///LICENSE")))) |
384 | |
385 | (define-public ocaml-c2newspeak |
386 | (package |
387 | (name "ocaml-c2newspeak") |
388 | (version "1") |
389 | (source (origin |
390 | (method git-fetch) |
391 | (uri (git-reference |
392 | (url "https://github.com/airbus-seclab/c2newspeak") |
393 | (commit "c97fd380111a49fa7baeb9e49c45238fca627492"))) |
394 | (file-name (string-append name "-" version)) |
395 | (sha256 |
396 | (base32 |
397 | "0fxh868s5jraq61mnig9ilhyjzsq4iw32f20zh3982naanp4p8r6")))) |
398 | (build-system ocaml-build-system) |
399 | (arguments |
400 | `(#:test-target "check" |
401 | #:tests? #f |
402 | #:phases |
403 | (modify-phases %standard-phases |
404 | (delete 'configure) |
405 | (add-after 'install 'install-bin |
406 | (lambda* (#:key outputs #:allow-other-keys) |
407 | (install-file "bin/c2newspeak" (string-append (assoc-ref outputs "out") "/bin"))))))) |
408 | (home-page "https://github.com/airbus-seclab/c2newspeak") |
409 | (synopsis "") |
410 | (description "") |
411 | (license license:lgpl2.1+))) |
412 | |
413 | (define-public ocaml-bincat |
414 | (package |
415 | (name "ocaml-bincat") |
416 | (version "0.8.1") |
417 | (source (origin |
418 | (method url-fetch) |
419 | (uri (string-append "https://github.com/airbus-seclab/bincat/archive/v" |
420 | version ".tar.gz")) |
421 | (file-name (string-append name "-" version ".tar.gz")) |
422 | (sha256 |
423 | (base32 |
424 | "1ncwm1h428x1bs4sq7ql1isrkhw0angglsa9hnsvhhw2i1jsdk7j")))) |
425 | (build-system ocaml-build-system) |
426 | (arguments |
427 | `(#:tests? #f; disabled for now |
428 | #:validate-runpath? #f; disabled for now |
429 | #:make-flags |
430 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) |
431 | "LDCONFIG=true" |
432 | (string-append "CFLAGS+=-I " (assoc-ref %build-inputs "ocaml") |
433 | "/lib/ocaml")) |
434 | #:phases |
435 | (modify-phases %standard-phases |
436 | (delete 'configure) |
437 | (add-before 'build 'python-path |
438 | (lambda* (#:key outputs #:allow-other-keys) |
439 | (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") |
440 | ":../python:" |
441 | (assoc-ref outputs "out") |
442 | "/lib/python2.7/site-packages/")) |
443 | #t)) |
444 | (add-before 'build 'fix-makefiles |
445 | (lambda _ |
446 | (substitute* "ocaml/src/Makefile" |
447 | (("GITVERSION:=.*") "GITVERSION:=0.8.1\n")) |
448 | (substitute* "python/Makefile" |
449 | (("./setup.py install") "./setup.py install --prefix=$(PREFIX)")) |
450 | #t)) |
451 | (add-before 'check 'fix-test |
452 | (lambda _ |
453 | (setenv "PATH" (string-append (getenv "PATH") ":" (getcwd) "/ocaml/src")) |
454 | ;; Remove tests that require an armv8 compiler |
455 | (substitute* "test/Makefile" |
456 | (("eggloader_armv8 eggloader_armv7 eggloader_armv7thumb") "")) |
457 | (chmod "test/eggloader_x86" #o755) |
458 | #t)) |
459 | (add-before 'install 'install-python-dir |
460 | (lambda* (#:key outputs #:allow-other-keys) |
461 | (mkdir-p (string-append (assoc-ref outputs "out") |
462 | "/lib/python2.7/site-packages/"))))))) |
463 | (inputs |
464 | `(("c2newspeak" ,ocaml-c2newspeak) |
465 | ("zarith" ,ocaml-zarith) |
466 | ("menhir" ,ocaml-menhir) |
467 | ("ocamlgraph" ,ocaml-graph) |
468 | ("ocaml-cppo" ,ocaml-cppo) |
469 | ("ocaml-ppx-tools" ,ocaml-ppx-tools) |
470 | ("gmp" ,gmp))) |
471 | (native-inputs |
472 | `(("python" ,python-2) |
473 | ("pytest" ,python2-pytest) |
474 | ("sphinx" ,python2-sphinx) |
475 | ("nasm" ,nasm))) |
476 | (home-page "https://github.com/airbus-seclab/bincat") |
477 | (synopsis "") |
478 | (description "") |
479 | (license license:lgpl2.1+))) |
480 | |
481 | (define-public ocaml-ocplib-simplex |
482 | (package |
483 | (name "ocaml-ocplib-simplex") |
484 | (version "0.4") |
485 | (source (origin |
486 | (method url-fetch) |
487 | (uri (string-append "https://github.com/OCamlPro-Iguernlala/" |
488 | "ocplib-simplex/archive/v" version ".tar.gz")) |
489 | (sha256 |
490 | (base32 |
491 | "0y6q4bgly7fisdklriww48aknqf2vg4dphr7wwnd1wh80l4anzg1")))) |
492 | (build-system gnu-build-system) |
493 | (arguments |
494 | `(#:tests? #f; Compilation error |
495 | #:phases |
496 | (modify-phases %standard-phases |
497 | (add-after 'unpack 'autoreconf |
498 | (lambda _ |
499 | (invoke "autoreconf" "-fiv") |
500 | #t)) |
501 | (add-before 'install 'mkdir |
502 | (lambda* (#:key outputs #:allow-other-keys) |
503 | (let* ((out (assoc-ref outputs "out")) |
504 | (lib (string-append out "/lib"))) |
505 | (mkdir-p lib) |
506 | #t)))))) |
507 | (native-inputs |
508 | `(("autoconf" ,autoconf) |
509 | ("automake" ,automake) |
510 | ("ocaml" ,ocaml) |
511 | ("ocaml-findlib" ,ocaml-findlib) |
512 | ("which" ,which))) |
513 | (home-page "") |
514 | (synopsis "") |
515 | (description "") |
516 | ; lgpl2.1+ with linking exception |
517 | (license license:lgpl2.1+))) |
518 | |
519 | (define-public frama-c |
520 | (package |
521 | (name "frama-c") |
522 | (version "20171101") |
523 | (source (origin |
524 | (method url-fetch) |
525 | (uri (string-append "http://frama-c.com/download/frama-c-Sulfur-" |
526 | version ".tar.gz")) |
527 | (sha256 |
528 | (base32 |
529 | "1vwjfqmm1r36gkybsy3a7m89q5zicf4rnz5vlsn9imnpjpl9gjw1")))) |
530 | (build-system ocaml-build-system) |
531 | (arguments |
532 | `(#:tests? #f; for now |
533 | #:phases |
534 | (modify-phases %standard-phases |
535 | (add-before 'configure 'export-shell |
536 | (lambda* (#:key inputs #:allow-other-keys) |
537 | (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash") |
538 | "/bin/sh"))))))) |
539 | (inputs |
540 | `(("gmp" ,gmp) |
541 | ("ocaml-graph" ,ocaml-graph) |
542 | ("ocaml-zarith" ,ocaml-zarith))) |
543 | (home-page "") |
544 | (synopsis "") |
545 | (description "") |
546 | (license license:lgpl2.1+))) |
547 | |
548 | (define-public coq-io |
549 | (package |
550 | (name "coq-io") |
551 | (version "3.3.0") |
552 | (source (origin |
553 | (method url-fetch) |
554 | (uri (string-append "https://github.com/coq-io/io/archive/" |
555 | version ".tar.gz")) |
556 | (file-name (string-append name "-" version ".tar.gz")) |
557 | (sha256 |
558 | (base32 |
559 | "0k1z8kav3wz5n04g3imm1hqjimb9cf12ga5wkj1skz8l5ccjxprw")))) |
560 | (build-system gnu-build-system) |
561 | (arguments |
562 | `(#:tests? #f; no tests |
563 | #:make-flags |
564 | (list (string-append "COQLIB=" (assoc-ref %outputs "out") "/lib/coq/")) |
565 | #:phases |
566 | (modify-phases %standard-phases |
567 | (replace 'configure |
568 | (lambda _ |
569 | (invoke "./configure.sh") |
570 | #t))))) |
571 | (native-inputs |
572 | `(("coq" ,coq-8.6))) |
573 | (home-page "") |
574 | (synopsis "") |
575 | (description "") |
576 | (license license:lgpl2.1+))) |
577 | |
578 | (define-public ocaml-optint |
579 | (package |
580 | (name "ocaml-optint") |
581 | (version "0.0.2") |
582 | (source |
583 | (origin |
584 | (method url-fetch) |
585 | (uri "https://github.com/dinosaure/optint/releases/download/v0.0.2/optint-v0.0.2.tbz") |
586 | (sha256 |
587 | (base32 |
588 | "1lmb7nycmkr05y93slqi98i1lcs1w4kcngjzjwz7i230qqjpw9w1")))) |
589 | (build-system dune-build-system) |
590 | (arguments |
591 | `(#:test-target ".")) |
592 | (home-page "https://github.com/dinosaure/optint") |
593 | (synopsis |
594 | "Abstract type on integer between x64 and x86 architecture") |
595 | (description |
596 | "This library provide one module `Optint` which use internally an `int` if you |
597 | are in a x64 architecture or an `int32` (boxed value) if you are in a x86 |
598 | architecture. This module is __really__ unsafe and does not care some details |
599 | (like the sign bit) for any cast. |
600 | |
601 | ## Goal |
602 | |
603 | The main difference between an `int` and an `int32` is the second is boxed. |
604 | About performance this is not the best. However, you can not ensure to be in an |
605 | x64 architecture where you can use directly an `int` instead an `int32` (and |
606 | improve performance). |
607 | |
608 | So, this library provide an abstraction about a real `int32`. In a x64 |
609 | architecture, internally, we use a `int` and in a x86 architure, we use a |
610 | `int32`. By this way, we ensure to have in any platform 32 free bits in |
611 | `Optint.t`.") |
612 | (license #f))) |
613 | |
614 | (define-public ocaml-checkseum |
615 | (package |
616 | (name "ocaml-checkseum") |
617 | (version "0.0.3") |
618 | (source |
619 | (origin |
620 | (method url-fetch) |
621 | (uri "https://github.com/dinosaure/checkseum/releases/download/v0.0.3/checkseum-v0.0.3.tbz") |
622 | (sha256 |
623 | (base32 |
624 | "12j45zsvil1ynwx1x8fbddhqacc8r1zf7f6h576y3f3yvbg7l1fm")))) |
625 | (build-system dune-build-system) |
626 | (propagated-inputs |
627 | `(("ocaml-optint" ,ocaml-optint) |
628 | ("ocaml-fmt" ,ocaml-fmt) |
629 | ("ocaml-rresult" ,ocaml-rresult) |
630 | ("ocaml-cmdliner" ,ocaml-cmdliner))) |
631 | (native-inputs |
632 | `(("ocaml-alcotest" ,ocaml-alcotest))) |
633 | (home-page |
634 | "https://github.com/dinosaure/checkseum") |
635 | (synopsis |
636 | "Adler-32, CRC32 and CRC32-C implementation in C and OCaml") |
637 | (description |
638 | "Checkseum is a library to provide implementation of Adler-32, CRC32 and CRC32-C in C and OCaml. |
639 | |
640 | This library use the linking trick to choose between the C implementation (checkseum.c) or the OCaml implementation (checkseum.ocaml). |
641 | This library is on top of optint to get the best representation of an int32. |
642 | ") |
643 | (license #f))) |
644 | |
645 | ; not the latest but imagelib requires 0.7 |
646 | (define-public ocaml-decompress |
647 | (package |
648 | (name "ocaml-decompress") |
649 | (version "0.7") |
650 | (source |
651 | (origin |
652 | (method url-fetch) |
653 | (uri "https://github.com/mirage/decompress/releases/download/v0.7/decompress-0.7.tbz") |
654 | (sha256 |
655 | (base32 |
656 | "1q96q4bhrlz13c33jj82qn6706m8dbn4azc6yja8lbavpy4q5zpy")))) |
657 | (build-system ocaml-build-system) |
658 | (arguments |
659 | ;; Tets need some path modification |
660 | `(#:tests? #f |
661 | #:phases |
662 | (modify-phases %standard-phases |
663 | (delete 'configure) |
664 | (replace 'build |
665 | (lambda _ |
666 | (invoke "ocaml" "pkg/pkg.ml" "build"))) |
667 | (add-before 'build 'set-topfind |
668 | (lambda* (#:key inputs #:allow-other-keys) |
669 | ;; add the line #directory ".." at the top of each file |
670 | ;; using #use "topfind";; to be able to find topfind |
671 | (let* ((findlib-path (assoc-ref inputs "findlib")) |
672 | (findlib-libdir |
673 | (string-append findlib-path "/lib/ocaml/site-lib"))) |
674 | (substitute* '("pkg/pkg.ml") |
675 | (("#use \"topfind\";;" all) |
676 | (string-append "#directory \"" findlib-libdir "\"\n" |
677 | all)))) |
678 | #t))))) |
679 | (propagated-inputs |
680 | `(("ocaml-optint" ,ocaml-optint) |
681 | ("ocaml-checkseum" ,ocaml-checkseum) |
682 | ("ocaml-cmdliner" ,ocaml-cmdliner))) |
683 | (native-inputs |
684 | `(("camlzip" ,camlzip) |
685 | ("ocaml-re" ,ocaml-re) |
686 | ("ocaml-topkg" ,ocaml-topkg) |
687 | ("ocamlbuild" ,ocamlbuild) |
688 | ("ocaml-alcotest" ,ocaml-alcotest) |
689 | ("opam" ,opam))) |
690 | (inputs |
691 | `(("zlib" ,zlib))) |
692 | (home-page |
693 | "https://github.com/mirage/decompress") |
694 | (synopsis "Implementation of Zlib in OCaml") |
695 | (description |
696 | "Decompress is an implementation of Zlib in OCaml |
697 | |
698 | It provides a pure non-blocking interface to inflate and deflate data flow. |
699 | ") |
700 | (license #f))) |
701 | |
702 | (define-public ocaml-imagelib |
703 | (package |
704 | (name "ocaml-imagelib") |
705 | (version "20180522") |
706 | (source |
707 | (origin |
708 | (method url-fetch) |
709 | (uri "https://github.com/rlepigre/ocaml-imagelib/archive/ocaml-imagelib_20180522.tar.gz") |
710 | (sha256 |
711 | (base32 |
712 | "06l724fj8yirp5jbf782r2xl3lrcff2i1b3c3pf80kbgngw6kakg")))) |
713 | (build-system ocaml-build-system) |
714 | (arguments |
715 | `(#:tests? #f |
716 | #:phases |
717 | (modify-phases %standard-phases |
718 | (delete 'configure) |
719 | (replace 'build |
720 | (lambda _ |
721 | (invoke "make"))) |
722 | (replace 'install |
723 | (lambda _ |
724 | (invoke "make" "install")))))) |
725 | (propagated-inputs |
726 | `(("ocaml-decompress" ,ocaml-decompress) |
727 | ("which" ,which))) |
728 | (native-inputs |
729 | `(("ocamlbuild" ,ocamlbuild))) |
730 | (home-page "http://lepigre.fr") |
731 | (synopsis |
732 | "The imagelib library implements image formats such as PNG and PPM") |
733 | (description |
734 | "The imagelib library implements image formats such as PNG and PPM in |
735 | OCaml, relying on only one external dependency: 'decompress'. |
736 | |
737 | Supported image formats: |
738 | - PNG (full implementation of RFC 2083), |
739 | - PPM, PGM, PBM, ... (fully supported), |
740 | - JPG (only image size natively, conversion to PNG otherwise), |
741 | - GIF (only image size natively, conversion to PNG otherwise), |
742 | - XCF (only image size natively, conversion to PNG otherwise), |
743 | - Other formats rely on 'convert' (imagemagick). |
744 | |
745 | As imagelib only requires 'decompress', it can be used together with |
746 | js_of_ocaml to compile projects to Javascript. Note that some of the |
747 | features of imagelib require the convert binary (and thus cannot be |
748 | used from Javascript).") |
749 | (license #f))) |
750 | |
751 | |
752 | (define-public patoline |
753 | (package |
754 | (name "patoline") |
755 | (version "0.2") |
756 | (source (origin |
757 | (method url-fetch) |
758 | (uri (string-append "https://github.com/patoline/patoline/archive/" |
759 | version ".tar.gz")) |
760 | (file-name (string-append name "-" version ".tar.gz")) |
761 | (sha256 |
762 | (base32 |
763 | "1qlxcf8k83lcyamyg19838j3f1js068skxgab94axv2gv4ylhhfb")))) |
764 | (build-system dune-build-system) |
765 | (arguments |
766 | `(#:test-target "." |
767 | #:phases |
768 | (modify-phases %standard-phases |
769 | (add-before 'build 'set-dirs |
770 | (lambda* (#:key outputs #:allow-other-keys) |
771 | (let ((out (assoc-ref outputs "out"))) |
772 | (substitute* '("unicodelib/config.ml" |
773 | "patconfig/patDefault.ml") |
774 | (("/usr/local/share") (string-append out "/share")))) |
775 | #t))))) |
776 | (propagated-inputs |
777 | `(("camlzip" ,camlzip) |
778 | ("ocaml-earley" ,ocaml-earley) |
779 | ("ocaml-imagelib" ,ocaml-imagelib) |
780 | ("ocaml-sqlite3" ,ocaml-sqlite3))) |
781 | (inputs |
782 | `(("zlib" ,zlib))) |
783 | (home-page "") |
784 | (synopsis "") |
785 | (description "") |
786 | (license license:gpl2+))) |
787 | |
788 | (define-public coq-tlc |
789 | (package |
790 | (name "coq-tlc") |
791 | (version "20181116") |
792 | (source (origin |
793 | (method git-fetch) |
794 | (uri (git-reference |
795 | (url "https://gitlab.inria.fr/charguer/tlc") |
796 | (commit version))) |
797 | (sha256 |
798 | (base32 |
799 | "1fkb4z92m04wdic4im4fd7dypbr1lnz285f06ci52kxgv2w4bkjz")))) |
800 | (build-system gnu-build-system) |
801 | (arguments |
802 | `(#:tests? #f; no tests |
803 | #:phases |
804 | (modify-phases %standard-phases |
805 | (delete 'configure) |
806 | (add-before 'build 'fix-timestamp |
807 | (lambda _ |
808 | (substitute* "GNUmakefile" |
809 | (("\\$\\(shell /bin/date.*") (string-append ,version "\n"))) |
810 | #t)) |
811 | (add-before 'build 'fix-timestamp |
812 | (lambda _ |
813 | (substitute* "src/Makefile.coq" |
814 | (("/usr/bin/env bash") (which "bash"))) |
815 | #t)) |
816 | (add-before 'build 'fix-install-dir |
817 | (lambda* (#:key outputs #:allow-other-keys) |
818 | (substitute* "src/Makefile" |
819 | (("TARGET *:=.*") (string-append "TARGET := " (assoc-ref outputs "out") |
820 | "/lib/coq/user-contrib/TLC"))) |
821 | #t))))) |
822 | (native-inputs |
823 | `(("coq" ,coq))) |
824 | (home-page "") |
825 | (synopsis "") |
826 | (description "") |
827 | (license #f))) |
828 |