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 ocaml-c2newspeak |
| 292 | (package |
| 293 | (name "ocaml-c2newspeak") |
| 294 | (version "1") |
| 295 | (source (origin |
| 296 | (method git-fetch) |
| 297 | (uri (git-reference |
| 298 | (url "https://github.com/airbus-seclab/c2newspeak") |
| 299 | (commit "c97fd380111a49fa7baeb9e49c45238fca627492"))) |
| 300 | (file-name (string-append name "-" version)) |
| 301 | (sha256 |
| 302 | (base32 |
| 303 | "0fxh868s5jraq61mnig9ilhyjzsq4iw32f20zh3982naanp4p8r6")))) |
| 304 | (build-system ocaml-build-system) |
| 305 | (arguments |
| 306 | `(#:test-target "check" |
| 307 | #:tests? #f |
| 308 | #:phases |
| 309 | (modify-phases %standard-phases |
| 310 | (delete 'configure) |
| 311 | (add-after 'install 'install-bin |
| 312 | (lambda* (#:key outputs #:allow-other-keys) |
| 313 | (install-file "bin/c2newspeak" (string-append (assoc-ref outputs "out") "/bin"))))))) |
| 314 | (home-page "https://github.com/airbus-seclab/c2newspeak") |
| 315 | (synopsis "") |
| 316 | (description "") |
| 317 | (license license:lgpl2.1+))) |
| 318 | |
| 319 | (define-public ocaml-bincat |
| 320 | (package |
| 321 | (name "ocaml-bincat") |
| 322 | (version "0.8.1") |
| 323 | (source (origin |
| 324 | (method url-fetch) |
| 325 | (uri (string-append "https://github.com/airbus-seclab/bincat/archive/v" |
| 326 | version ".tar.gz")) |
| 327 | (file-name (string-append name "-" version ".tar.gz")) |
| 328 | (sha256 |
| 329 | (base32 |
| 330 | "1ncwm1h428x1bs4sq7ql1isrkhw0angglsa9hnsvhhw2i1jsdk7j")))) |
| 331 | (build-system ocaml-build-system) |
| 332 | (arguments |
| 333 | `(#:tests? #f; disabled for now |
| 334 | #:validate-runpath? #f; disabled for now |
| 335 | #:make-flags |
| 336 | (list (string-append "PREFIX=" (assoc-ref %outputs "out")) |
| 337 | "LDCONFIG=true" |
| 338 | (string-append "CFLAGS+=-I " (assoc-ref %build-inputs "ocaml") |
| 339 | "/lib/ocaml")) |
| 340 | #:phases |
| 341 | (modify-phases %standard-phases |
| 342 | (delete 'configure) |
| 343 | (add-before 'build 'python-path |
| 344 | (lambda* (#:key outputs #:allow-other-keys) |
| 345 | (setenv "PYTHONPATH" (string-append (getenv "PYTHONPATH") |
| 346 | ":../python:" |
| 347 | (assoc-ref outputs "out") |
| 348 | "/lib/python2.7/site-packages/")) |
| 349 | #t)) |
| 350 | (add-before 'build 'fix-makefiles |
| 351 | (lambda _ |
| 352 | (substitute* "ocaml/src/Makefile" |
| 353 | (("GITVERSION:=.*") "GITVERSION:=0.8.1\n")) |
| 354 | (substitute* "python/Makefile" |
| 355 | (("./setup.py install") "./setup.py install --prefix=$(PREFIX)")) |
| 356 | #t)) |
| 357 | (add-before 'check 'fix-test |
| 358 | (lambda _ |
| 359 | (setenv "PATH" (string-append (getenv "PATH") ":" (getcwd) "/ocaml/src")) |
| 360 | ;; Remove tests that require an armv8 compiler |
| 361 | (substitute* "test/Makefile" |
| 362 | (("eggloader_armv8 eggloader_armv7 eggloader_armv7thumb") "")) |
| 363 | (chmod "test/eggloader_x86" #o755) |
| 364 | #t)) |
| 365 | (add-before 'install 'install-python-dir |
| 366 | (lambda* (#:key outputs #:allow-other-keys) |
| 367 | (mkdir-p (string-append (assoc-ref outputs "out") |
| 368 | "/lib/python2.7/site-packages/"))))))) |
| 369 | (inputs |
| 370 | `(("c2newspeak" ,ocaml-c2newspeak) |
| 371 | ("zarith" ,ocaml-zarith) |
| 372 | ("menhir" ,ocaml-menhir) |
| 373 | ("ocamlgraph" ,ocaml-graph) |
| 374 | ("ocaml-cppo" ,ocaml-cppo) |
| 375 | ("ocaml-ppx-tools" ,ocaml-ppx-tools) |
| 376 | ("gmp" ,gmp))) |
| 377 | (native-inputs |
| 378 | `(("python" ,python-2) |
| 379 | ("pytest" ,python2-pytest) |
| 380 | ("sphinx" ,python2-sphinx) |
| 381 | ("nasm" ,nasm))) |
| 382 | (home-page "https://github.com/airbus-seclab/bincat") |
| 383 | (synopsis "") |
| 384 | (description "") |
| 385 | (license license:lgpl2.1+))) |
| 386 | |
| 387 | (define-public ocaml-ocplib-simplex |
| 388 | (package |
| 389 | (name "ocaml-ocplib-simplex") |
| 390 | (version "0.4") |
| 391 | (source (origin |
| 392 | (method url-fetch) |
| 393 | (uri (string-append "https://github.com/OCamlPro-Iguernlala/" |
| 394 | "ocplib-simplex/archive/v" version ".tar.gz")) |
| 395 | (sha256 |
| 396 | (base32 |
| 397 | "0y6q4bgly7fisdklriww48aknqf2vg4dphr7wwnd1wh80l4anzg1")))) |
| 398 | (build-system gnu-build-system) |
| 399 | (arguments |
| 400 | `(#:tests? #f; Compilation error |
| 401 | #:phases |
| 402 | (modify-phases %standard-phases |
| 403 | (add-after 'unpack 'autoreconf |
| 404 | (lambda _ |
| 405 | (invoke "autoreconf" "-fiv") |
| 406 | #t)) |
| 407 | (add-before 'install 'mkdir |
| 408 | (lambda* (#:key outputs #:allow-other-keys) |
| 409 | (let* ((out (assoc-ref outputs "out")) |
| 410 | (lib (string-append out "/lib"))) |
| 411 | (mkdir-p lib) |
| 412 | #t)))))) |
| 413 | (native-inputs |
| 414 | `(("autoconf" ,autoconf) |
| 415 | ("automake" ,automake) |
| 416 | ("ocaml" ,ocaml) |
| 417 | ("ocaml-findlib" ,ocaml-findlib) |
| 418 | ("which" ,which))) |
| 419 | (home-page "") |
| 420 | (synopsis "") |
| 421 | (description "") |
| 422 | ; lgpl2.1+ with linking exception |
| 423 | (license license:lgpl2.1+))) |
| 424 | |
| 425 | (define-public frama-c |
| 426 | (package |
| 427 | (name "frama-c") |
| 428 | (version "20171101") |
| 429 | (source (origin |
| 430 | (method url-fetch) |
| 431 | (uri (string-append "http://frama-c.com/download/frama-c-Sulfur-" |
| 432 | version ".tar.gz")) |
| 433 | (sha256 |
| 434 | (base32 |
| 435 | "1vwjfqmm1r36gkybsy3a7m89q5zicf4rnz5vlsn9imnpjpl9gjw1")))) |
| 436 | (build-system ocaml-build-system) |
| 437 | (arguments |
| 438 | `(#:tests? #f; for now |
| 439 | #:phases |
| 440 | (modify-phases %standard-phases |
| 441 | (add-before 'configure 'export-shell |
| 442 | (lambda* (#:key inputs #:allow-other-keys) |
| 443 | (setenv "CONFIG_SHELL" (string-append (assoc-ref inputs "bash") |
| 444 | "/bin/sh"))))))) |
| 445 | (inputs |
| 446 | `(("gmp" ,gmp) |
| 447 | ("ocaml-graph" ,ocaml-graph) |
| 448 | ("ocaml-zarith" ,ocaml-zarith))) |
| 449 | (home-page "") |
| 450 | (synopsis "") |
| 451 | (description "") |
| 452 | (license license:lgpl2.1+))) |
| 453 | |
| 454 | (define-public coq-io |
| 455 | (package |
| 456 | (name "coq-io") |
| 457 | (version "3.3.0") |
| 458 | (source (origin |
| 459 | (method url-fetch) |
| 460 | (uri (string-append "https://github.com/coq-io/io/archive/" |
| 461 | version ".tar.gz")) |
| 462 | (file-name (string-append name "-" version ".tar.gz")) |
| 463 | (sha256 |
| 464 | (base32 |
| 465 | "0k1z8kav3wz5n04g3imm1hqjimb9cf12ga5wkj1skz8l5ccjxprw")))) |
| 466 | (build-system gnu-build-system) |
| 467 | (arguments |
| 468 | `(#:tests? #f; no tests |
| 469 | #:make-flags |
| 470 | (list (string-append "COQLIB=" (assoc-ref %outputs "out") "/lib/coq/")) |
| 471 | #:phases |
| 472 | (modify-phases %standard-phases |
| 473 | (replace 'configure |
| 474 | (lambda _ |
| 475 | (invoke "./configure.sh") |
| 476 | #t))))) |
| 477 | (native-inputs |
| 478 | `(("coq" ,coq-8.6))) |
| 479 | (home-page "") |
| 480 | (synopsis "") |
| 481 | (description "") |
| 482 | (license license:lgpl2.1+))) |
| 483 | |
| 484 | (define-public ocaml-optint |
| 485 | (package |
| 486 | (name "ocaml-optint") |
| 487 | (version "0.0.2") |
| 488 | (source |
| 489 | (origin |
| 490 | (method url-fetch) |
| 491 | (uri "https://github.com/dinosaure/optint/releases/download/v0.0.2/optint-v0.0.2.tbz") |
| 492 | (sha256 |
| 493 | (base32 |
| 494 | "1lmb7nycmkr05y93slqi98i1lcs1w4kcngjzjwz7i230qqjpw9w1")))) |
| 495 | (build-system dune-build-system) |
| 496 | (arguments |
| 497 | `(#:test-target ".")) |
| 498 | (home-page "https://github.com/dinosaure/optint") |
| 499 | (synopsis |
| 500 | "Abstract type on integer between x64 and x86 architecture") |
| 501 | (description |
| 502 | "This library provide one module `Optint` which use internally an `int` if you |
| 503 | are in a x64 architecture or an `int32` (boxed value) if you are in a x86 |
| 504 | architecture. This module is __really__ unsafe and does not care some details |
| 505 | (like the sign bit) for any cast. |
| 506 | |
| 507 | ## Goal |
| 508 | |
| 509 | The main difference between an `int` and an `int32` is the second is boxed. |
| 510 | About performance this is not the best. However, you can not ensure to be in an |
| 511 | x64 architecture where you can use directly an `int` instead an `int32` (and |
| 512 | improve performance). |
| 513 | |
| 514 | So, this library provide an abstraction about a real `int32`. In a x64 |
| 515 | architecture, internally, we use a `int` and in a x86 architure, we use a |
| 516 | `int32`. By this way, we ensure to have in any platform 32 free bits in |
| 517 | `Optint.t`.") |
| 518 | (license #f))) |
| 519 | |
| 520 | (define-public ocaml-checkseum |
| 521 | (package |
| 522 | (name "ocaml-checkseum") |
| 523 | (version "0.0.3") |
| 524 | (source |
| 525 | (origin |
| 526 | (method url-fetch) |
| 527 | (uri "https://github.com/dinosaure/checkseum/releases/download/v0.0.3/checkseum-v0.0.3.tbz") |
| 528 | (sha256 |
| 529 | (base32 |
| 530 | "12j45zsvil1ynwx1x8fbddhqacc8r1zf7f6h576y3f3yvbg7l1fm")))) |
| 531 | (build-system dune-build-system) |
| 532 | (propagated-inputs |
| 533 | `(("ocaml-optint" ,ocaml-optint) |
| 534 | ("ocaml-fmt" ,ocaml-fmt) |
| 535 | ("ocaml-rresult" ,ocaml-rresult) |
| 536 | ("ocaml-cmdliner" ,ocaml-cmdliner))) |
| 537 | (native-inputs |
| 538 | `(("ocaml-alcotest" ,ocaml-alcotest))) |
| 539 | (home-page |
| 540 | "https://github.com/dinosaure/checkseum") |
| 541 | (synopsis |
| 542 | "Adler-32, CRC32 and CRC32-C implementation in C and OCaml") |
| 543 | (description |
| 544 | "Checkseum is a library to provide implementation of Adler-32, CRC32 and CRC32-C in C and OCaml. |
| 545 | |
| 546 | This library use the linking trick to choose between the C implementation (checkseum.c) or the OCaml implementation (checkseum.ocaml). |
| 547 | This library is on top of optint to get the best representation of an int32. |
| 548 | ") |
| 549 | (license #f))) |
| 550 | |
| 551 | ; not the latest but imagelib requires 0.7 |
| 552 | (define-public ocaml-decompress |
| 553 | (package |
| 554 | (name "ocaml-decompress") |
| 555 | (version "0.7") |
| 556 | (source |
| 557 | (origin |
| 558 | (method url-fetch) |
| 559 | (uri "https://github.com/mirage/decompress/releases/download/v0.7/decompress-0.7.tbz") |
| 560 | (sha256 |
| 561 | (base32 |
| 562 | "1q96q4bhrlz13c33jj82qn6706m8dbn4azc6yja8lbavpy4q5zpy")))) |
| 563 | (build-system ocaml-build-system) |
| 564 | (arguments |
| 565 | ;; Tets need some path modification |
| 566 | `(#:tests? #f |
| 567 | #:phases |
| 568 | (modify-phases %standard-phases |
| 569 | (delete 'configure) |
| 570 | (replace 'build |
| 571 | (lambda _ |
| 572 | (invoke "ocaml" "pkg/pkg.ml" "build"))) |
| 573 | (add-before 'build 'set-topfind |
| 574 | (lambda* (#:key inputs #:allow-other-keys) |
| 575 | ;; add the line #directory ".." at the top of each file |
| 576 | ;; using #use "topfind";; to be able to find topfind |
| 577 | (let* ((findlib-path (assoc-ref inputs "findlib")) |
| 578 | (findlib-libdir |
| 579 | (string-append findlib-path "/lib/ocaml/site-lib"))) |
| 580 | (substitute* '("pkg/pkg.ml") |
| 581 | (("#use \"topfind\";;" all) |
| 582 | (string-append "#directory \"" findlib-libdir "\"\n" |
| 583 | all)))) |
| 584 | #t))))) |
| 585 | (propagated-inputs |
| 586 | `(("ocaml-optint" ,ocaml-optint) |
| 587 | ("ocaml-checkseum" ,ocaml-checkseum) |
| 588 | ("ocaml-cmdliner" ,ocaml-cmdliner))) |
| 589 | (native-inputs |
| 590 | `(("camlzip" ,camlzip) |
| 591 | ("ocaml-re" ,ocaml-re) |
| 592 | ("ocaml-topkg" ,ocaml-topkg) |
| 593 | ("ocamlbuild" ,ocamlbuild) |
| 594 | ("ocaml-alcotest" ,ocaml-alcotest) |
| 595 | ("opam" ,opam))) |
| 596 | (inputs |
| 597 | `(("zlib" ,zlib))) |
| 598 | (home-page |
| 599 | "https://github.com/mirage/decompress") |
| 600 | (synopsis "Implementation of Zlib in OCaml") |
| 601 | (description |
| 602 | "Decompress is an implementation of Zlib in OCaml |
| 603 | |
| 604 | It provides a pure non-blocking interface to inflate and deflate data flow. |
| 605 | ") |
| 606 | (license #f))) |
| 607 | |
| 608 | (define-public ocaml-imagelib |
| 609 | (package |
| 610 | (name "ocaml-imagelib") |
| 611 | (version "20180522") |
| 612 | (source |
| 613 | (origin |
| 614 | (method url-fetch) |
| 615 | (uri "https://github.com/rlepigre/ocaml-imagelib/archive/ocaml-imagelib_20180522.tar.gz") |
| 616 | (sha256 |
| 617 | (base32 |
| 618 | "06l724fj8yirp5jbf782r2xl3lrcff2i1b3c3pf80kbgngw6kakg")))) |
| 619 | (build-system ocaml-build-system) |
| 620 | (arguments |
| 621 | `(#:tests? #f |
| 622 | #:phases |
| 623 | (modify-phases %standard-phases |
| 624 | (delete 'configure) |
| 625 | (replace 'build |
| 626 | (lambda _ |
| 627 | (invoke "make"))) |
| 628 | (replace 'install |
| 629 | (lambda _ |
| 630 | (invoke "make" "install")))))) |
| 631 | (propagated-inputs |
| 632 | `(("ocaml-decompress" ,ocaml-decompress) |
| 633 | ("which" ,which))) |
| 634 | (native-inputs |
| 635 | `(("ocamlbuild" ,ocamlbuild))) |
| 636 | (home-page "http://lepigre.fr") |
| 637 | (synopsis |
| 638 | "The imagelib library implements image formats such as PNG and PPM") |
| 639 | (description |
| 640 | "The imagelib library implements image formats such as PNG and PPM in |
| 641 | OCaml, relying on only one external dependency: 'decompress'. |
| 642 | |
| 643 | Supported image formats: |
| 644 | - PNG (full implementation of RFC 2083), |
| 645 | - PPM, PGM, PBM, ... (fully supported), |
| 646 | - JPG (only image size natively, conversion to PNG otherwise), |
| 647 | - GIF (only image size natively, conversion to PNG otherwise), |
| 648 | - XCF (only image size natively, conversion to PNG otherwise), |
| 649 | - Other formats rely on 'convert' (imagemagick). |
| 650 | |
| 651 | As imagelib only requires 'decompress', it can be used together with |
| 652 | js_of_ocaml to compile projects to Javascript. Note that some of the |
| 653 | features of imagelib require the convert binary (and thus cannot be |
| 654 | used from Javascript).") |
| 655 | (license #f))) |
| 656 | |
| 657 | |
| 658 | (define-public patoline |
| 659 | (package |
| 660 | (name "patoline") |
| 661 | (version "0.2") |
| 662 | (source (origin |
| 663 | (method url-fetch) |
| 664 | (uri (string-append "https://github.com/patoline/patoline/archive/" |
| 665 | version ".tar.gz")) |
| 666 | (file-name (string-append name "-" version ".tar.gz")) |
| 667 | (sha256 |
| 668 | (base32 |
| 669 | "1qlxcf8k83lcyamyg19838j3f1js068skxgab94axv2gv4ylhhfb")))) |
| 670 | (build-system dune-build-system) |
| 671 | (arguments |
| 672 | `(#:test-target "." |
| 673 | #:phases |
| 674 | (modify-phases %standard-phases |
| 675 | (add-before 'build 'set-dirs |
| 676 | (lambda* (#:key outputs #:allow-other-keys) |
| 677 | (let ((out (assoc-ref outputs "out"))) |
| 678 | (substitute* '("unicodelib/config.ml" |
| 679 | "patconfig/patDefault.ml") |
| 680 | (("/usr/local/share") (string-append out "/share")))) |
| 681 | #t))))) |
| 682 | (propagated-inputs |
| 683 | `(("camlzip" ,camlzip) |
| 684 | ("ocaml-earley" ,ocaml-earley) |
| 685 | ("ocaml-imagelib" ,ocaml-imagelib) |
| 686 | ("ocaml-sqlite3" ,ocaml-sqlite3))) |
| 687 | (inputs |
| 688 | `(("zlib" ,zlib))) |
| 689 | (home-page "") |
| 690 | (synopsis "") |
| 691 | (description "") |
| 692 | (license license:gpl2+))) |
| 693 | |
| 694 | (define-public coq-tlc |
| 695 | (package |
| 696 | (name "coq-tlc") |
| 697 | (version "20181116") |
| 698 | (source (origin |
| 699 | (method git-fetch) |
| 700 | (uri (git-reference |
| 701 | (url "https://gitlab.inria.fr/charguer/tlc") |
| 702 | (commit version))) |
| 703 | (sha256 |
| 704 | (base32 |
| 705 | "1fkb4z92m04wdic4im4fd7dypbr1lnz285f06ci52kxgv2w4bkjz")))) |
| 706 | (build-system gnu-build-system) |
| 707 | (arguments |
| 708 | `(#:tests? #f; no tests |
| 709 | #:phases |
| 710 | (modify-phases %standard-phases |
| 711 | (delete 'configure) |
| 712 | (add-before 'build 'fix-timestamp |
| 713 | (lambda _ |
| 714 | (substitute* "GNUmakefile" |
| 715 | (("\\$\\(shell /bin/date.*") (string-append ,version "\n"))) |
| 716 | #t)) |
| 717 | (add-before 'build 'fix-timestamp |
| 718 | (lambda _ |
| 719 | (substitute* "src/Makefile.coq" |
| 720 | (("/usr/bin/env bash") (which "bash"))) |
| 721 | #t)) |
| 722 | (add-before 'build 'fix-install-dir |
| 723 | (lambda* (#:key outputs #:allow-other-keys) |
| 724 | (substitute* "src/Makefile" |
| 725 | (("TARGET *:=.*") (string-append "TARGET := " (assoc-ref outputs "out") |
| 726 | "/lib/coq/user-contrib/TLC"))) |
| 727 | #t))))) |
| 728 | (native-inputs |
| 729 | `(("coq" ,coq))) |
| 730 | (home-page "") |
| 731 | (synopsis "") |
| 732 | (description "") |
| 733 | (license #f))) |
| 734 |