guix-more/more/packages/ocaml.scm

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