doc: "filesystem" -> "file system"
[jackhill/guix/guix.git] / gnu / packages / ocaml.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
4 ;;; Copyright © 2015 Andreas Enge <andreas@enge.fr>
5 ;;; Copyright © 2015 David Hashe <david.hashe@dhashe.com>
6 ;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
7 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages ocaml)
25 #:use-module ((guix licenses) #:hide (zlib))
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix svn-download)
29 #:use-module (guix utils)
30 #:use-module (guix build-system gnu)
31 #:use-module (gnu packages)
32 #:use-module (gnu packages gcc)
33 #:use-module (gnu packages gnome)
34 #:use-module (gnu packages gtk)
35 #:use-module (gnu packages base)
36 #:use-module (gnu packages emacs)
37 #:use-module (gnu packages texinfo)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages compression)
40 #:use-module (gnu packages xorg)
41 #:use-module (gnu packages tex)
42 #:use-module (gnu packages ghostscript)
43 #:use-module (gnu packages lynx)
44 #:use-module (gnu packages perl)
45 #:use-module (gnu packages python)
46 #:use-module (gnu packages m4)
47 #:use-module (gnu packages ncurses)
48 #:use-module (gnu packages version-control)
49 #:use-module (gnu packages curl))
50
51 (define-public ocaml
52 (package
53 (name "ocaml")
54 (version "4.02.3")
55 (source (origin
56 (method url-fetch)
57 (uri (string-append
58 "http://caml.inria.fr/pub/distrib/ocaml-"
59 (version-major+minor version)
60 "/ocaml-" version ".tar.xz"))
61 (sha256
62 (base32
63 "1qwwvy8nzd87hk8rd9sm667nppakiapnx4ypdwcrlnav2dz6kil3"))
64 (patches (search-patches "ocaml-CVE-2015-8869.patch"))))
65 (build-system gnu-build-system)
66 (native-search-paths
67 (list (search-path-specification
68 (variable "OCAMLPATH")
69 (files (list (string-append "lib/ocaml"))))))
70 (native-inputs
71 `(("perl" ,perl)
72 ("pkg-config" ,pkg-config)))
73 (inputs
74 `(("libx11" ,libx11)
75 ;; For libiberty, needed for objdump support.
76 ("gcc:lib" ,(canonical-package gcc-4.9) "lib")
77 ("zlib" ,zlib))) ;also needed for objdump support
78 (arguments
79 `(#:modules ((guix build gnu-build-system)
80 (guix build utils)
81 (web server))
82 #:phases
83 (modify-phases %standard-phases
84 (add-after 'unpack 'patch-/bin/sh-references
85 (lambda* (#:key inputs #:allow-other-keys)
86 (let* ((sh (string-append (assoc-ref inputs "bash")
87 "/bin/sh"))
88 (quoted-sh (string-append "\"" sh "\"")))
89 (with-fluids ((%default-port-encoding #f))
90 (for-each (lambda (file)
91 (substitute* file
92 (("\"/bin/sh\"")
93 (begin
94 (format (current-error-port) "\
95 patch-/bin/sh-references: ~a: changing `\"/bin/sh\"' to `~a'~%"
96 file quoted-sh)
97 quoted-sh))))
98 (find-files "." "\\.ml$"))
99 #t))))
100 (replace 'configure
101 (lambda* (#:key outputs #:allow-other-keys)
102 (let* ((out (assoc-ref outputs "out"))
103 (mandir (string-append out "/share/man")))
104 ;; Custom configure script doesn't recognize
105 ;; --prefix=<PREFIX> syntax (with equals sign).
106 (zero? (system* "./configure"
107 "--prefix" out
108 "--mandir" mandir)))))
109 (replace 'build
110 (lambda _
111 (zero? (system* "make" "-j" (number->string
112 (parallel-job-count))
113 "world.opt"))))
114 (delete 'check)
115 (add-after 'install 'check
116 (lambda _
117 (with-directory-excursion "testsuite"
118 (zero? (system* "make" "all")))))
119 (add-before 'check 'prepare-socket-test
120 (lambda _
121 (format (current-error-port)
122 "Spawning local test web server on port 8080~%")
123 (when (zero? (primitive-fork))
124 (run-server (lambda (request request-body)
125 (values '((content-type . (text/plain)))
126 "Hello!"))
127 'http '(#:port 8080)))
128 (let ((file "testsuite/tests/lib-threads/testsocket.ml"))
129 (format (current-error-port)
130 "Patching ~a to use localhost port 8080~%"
131 file)
132 (substitute* file
133 (("caml.inria.fr") "localhost")
134 (("80") "8080")
135 (("HTTP1.0") "HTTP/1.0"))
136 #t))))))
137 (home-page "https://ocaml.org/")
138 (synopsis "The OCaml programming language")
139 (description
140 "OCaml is a general purpose industrial-strength programming language with
141 an emphasis on expressiveness and safety. Developed for more than 20 years at
142 Inria it benefits from one of the most advanced type systems and supports
143 functional, imperative and object-oriented styles of programming.")
144 ;; The compiler is distributed under qpl1.0 with a change to choice of
145 ;; law: the license is governed by the laws of France. The library is
146 ;; distributed under lgpl2.0.
147 (license (list qpl lgpl2.0))))
148
149 (define-public opam
150 (package
151 (name "opam")
152 (version "1.2.2")
153 (source (origin
154 (method url-fetch)
155 ;; Use the '-full' version, which includes all the dependencies.
156 (uri (string-append
157 "https://github.com/ocaml/opam/releases/download/"
158 version "/opam-full-" version ".tar.gz")
159 ;; (string-append "https://github.com/ocaml/opam/archive/"
160 ;; version ".tar.gz")
161 )
162 (sha256
163 (base32
164 "004gwn6rbpcb53y3rpb3v23vk39rp2xmf0liyd5iy12ij8bigrhm"))))
165 (build-system gnu-build-system)
166 (arguments
167 '(;; Sometimes, 'make -jX' would fail right after ./configure with
168 ;; "Fatal error: exception End_of_file".
169 #:parallel-build? #f
170
171 ;; For some reason, 'ocp-build' needs $TERM to be set.
172 #:make-flags `("TERM=screen"
173 ,(string-append "SHELL="
174 (assoc-ref %build-inputs "bash")
175 "/bin/sh"))
176 #:test-target "tests"
177
178 ;; FIXME: There's an obscure test failure:
179 ;; …/_obuild/opam/opam.asm install P1' failed.
180 #:tests? #f
181
182 #:phases (modify-phases %standard-phases
183 (add-before 'build 'pre-build
184 (lambda* (#:key inputs make-flags #:allow-other-keys)
185 (let ((bash (assoc-ref inputs "bash")))
186 (substitute* "src/core/opamSystem.ml"
187 (("\"/bin/sh\"")
188 (string-append "\"" bash "/bin/sh\"")))
189 ;; Build dependencies
190 (zero? (apply system* "make" "lib-ext" make-flags)))))
191 (add-before 'check 'pre-check
192 (lambda _
193 (setenv "HOME" (getcwd))
194 (and (system "git config --global user.email guix@gnu.org")
195 (system "git config --global user.name Guix")))))))
196 (native-inputs
197 `(("git" ,git) ;for the tests
198 ("python" ,python) ;for the tests
199 ("camlp4" ,camlp4)))
200 (inputs
201 `(("ocaml" ,ocaml)
202 ("ncurses" ,ncurses)
203 ("curl" ,curl)))
204 (home-page "http://opam.ocamlpro.com/")
205 (synopsis "Package manager for OCaml")
206 (description
207 "OPAM is a tool to manage OCaml packages. It supports multiple
208 simultaneous compiler installations, flexible package constraints, and a
209 Git-friendly development workflow.")
210
211 ;; The 'LICENSE' file waives some requirements compared to LGPLv3.
212 (license lgpl3)))
213
214 (define-public camlp4
215 (package
216 (name "camlp4")
217 (version "4.02+6")
218 (source (origin
219 (method url-fetch)
220 (uri (string-append "https://github.com/ocaml/camlp4/archive/"
221 version ".tar.gz"))
222 (sha256
223 (base32
224 "0icdfzhsbgf89925gc8gl3fm8z2xzszzlib0v9dj5wyzkyv3a342"))
225 (file-name (string-append name "-" version ".tar.gz"))))
226 (build-system gnu-build-system)
227 (native-inputs `(("ocaml" ,ocaml)
228 ("which" ,which)))
229 (inputs `(("ocaml" ,ocaml)))
230 (arguments
231 '(#:tests? #f ;no documented test target
232 #:phases (modify-phases %standard-phases
233 (replace
234 'configure
235 (lambda* (#:key outputs #:allow-other-keys)
236 ;; This is a home-made 'configure' script.
237 (let ((out (assoc-ref outputs "out")))
238 (zero? (system* "./configure"
239 (string-append "--libdir=" out "/lib")
240 (string-append "--bindir=" out "/bin")
241 (string-append "--pkgdir=" out)))))))))
242 (home-page "https://github.com/ocaml/camlp4")
243 (synopsis "Write parsers in OCaml")
244 (description
245 "Camlp4 is a software system for writing extensible parsers for
246 programming languages. It provides a set of OCaml libraries that are used to
247 define grammars as well as loadable syntax extensions of such grammars.
248 Camlp4 stands for Caml Preprocessor and Pretty-Printer and one of its most
249 important applications is the definition of domain-specific extensions of the
250 syntax of OCaml.")
251
252 ;; This is LGPLv2 with an exception that allows packages statically-linked
253 ;; against the library to be released under any terms.
254 (license lgpl2.0)))
255
256 (define-public camlp5
257 (package
258 (name "camlp5")
259 (version "6.14")
260 (source (origin
261 (method url-fetch)
262 (uri (string-append "http://camlp5.gforge.inria.fr/distrib/src/"
263 name "-" version ".tgz"))
264 (sha256
265 (base32
266 "1ql04iyvclpyy9805kpddc4ndjb5d0qg4shhi2fc6bixi49fvy89"))))
267 (build-system gnu-build-system)
268 (inputs
269 `(("ocaml" ,ocaml)))
270 (arguments
271 `(#:tests? #f ; XXX TODO figure out how to run the tests
272 #:phases
273 (modify-phases %standard-phases
274 (replace 'configure
275 (lambda* (#:key outputs #:allow-other-keys)
276 (let* ((out (assoc-ref outputs "out"))
277 (mandir (string-append out "/share/man")))
278 ;; Custom configure script doesn't recognize
279 ;; --prefix=<PREFIX> syntax (with equals sign).
280 (zero? (system* "./configure"
281 "--prefix" out
282 "--mandir" mandir)))))
283 (replace 'build
284 (lambda _
285 (zero? (system* "make" "-j" (number->string
286 (parallel-job-count))
287 "world.opt")))))))
288 (home-page "http://camlp5.gforge.inria.fr/")
289 (synopsis "Pre-processor Pretty Printer for OCaml")
290 (description
291 "Camlp5 is a Pre-Processor-Pretty-Printer for Objective Caml. It offers
292 tools for syntax (Stream Parsers and Grammars) and the ability to modify the
293 concrete syntax of the language (Quotations, Syntax Extensions).")
294 ;; Most files are distributed under bsd-3, but ocaml_stuff/* is under qpl.
295 (license (list bsd-3 qpl))))
296
297 (define-public hevea
298 (package
299 (name "hevea")
300 (version "2.28")
301 (source (origin
302 (method url-fetch)
303 (uri (string-append "http://hevea.inria.fr/old/"
304 name "-" version ".tar.gz"))
305 (sha256
306 (base32
307 "14fns13wlnpiv9i05841kvi3cq4b9v2sw5x3ff6ziws28q701qnd"))))
308 (build-system gnu-build-system)
309 (inputs
310 `(("ocaml" ,ocaml)))
311 (arguments
312 `(#:tests? #f ; no test suite
313 #:make-flags (list (string-append "PREFIX=" %output))
314 #:phases (modify-phases %standard-phases
315 (delete 'configure)
316 (add-before 'build 'patch-/bin/sh
317 (lambda _
318 (substitute* "_tags"
319 (("/bin/sh") (which "sh")))
320 #t)))))
321 (home-page "http://hevea.inria.fr/")
322 (synopsis "LaTeX to HTML translator")
323 (description
324 "HeVeA is a LaTeX to HTML translator that generates modern HTML 5. It is
325 written in Objective Caml.")
326 (license qpl)))
327
328 (define-public coq
329 (package
330 (name "coq")
331 (version "8.4pl6")
332 (source (origin
333 (method url-fetch)
334 (uri (string-append "https://coq.inria.fr/distrib/V" version
335 "/files/" name "-" version ".tar.gz"))
336 (sha256
337 (base32
338 "1mpbj4yf36kpjg2v2sln12i8dzqn8rag6fd07hslj2lpm4qs4h55"))))
339 (build-system gnu-build-system)
340 (native-inputs
341 `(("texlive" ,texlive)
342 ("hevea" ,hevea)))
343 (inputs
344 `(("ocaml" ,ocaml)
345 ("camlp5" ,camlp5)))
346 (arguments
347 `(#:phases
348 (modify-phases %standard-phases
349 (replace 'configure
350 (lambda* (#:key outputs #:allow-other-keys)
351 (let* ((out (assoc-ref outputs "out"))
352 (mandir (string-append out "/share/man"))
353 (browser "icecat -remote \"OpenURL(%s,new-tab)\""))
354 (zero? (system* "./configure"
355 "--prefix" out
356 "--mandir" mandir
357 "--browser" browser)))))
358 (replace 'build
359 (lambda _
360 (zero? (system* "make" "-j" (number->string
361 (parallel-job-count))
362 "world"))))
363 (delete 'check)
364 (add-after 'install 'check
365 (lambda _
366 (with-directory-excursion "test-suite"
367 (zero? (system* "make"))))))))
368 (home-page "https://coq.inria.fr")
369 (synopsis "Proof assistant for higher-order logic")
370 (description
371 "Coq is a proof assistant for higher-order logic, which allows the
372 development of computer programs consistent with their formal specification.
373 It is developed using Objective Caml and Camlp5.")
374 ;; The code is distributed under lgpl2.1.
375 ;; Some of the documentation is distributed under opl1.0+.
376 (license (list lgpl2.1 opl1.0+))))
377
378 (define-public proof-general
379 (package
380 (name "proof-general")
381 (version "4.2")
382 (source (origin
383 (method url-fetch)
384 (uri (string-append
385 "http://proofgeneral.inf.ed.ac.uk/releases/"
386 "ProofGeneral-" version ".tgz"))
387 (sha256
388 (base32
389 "09qb0myq66fw17v4ziz401ilsb5xlxz1nl2wsp69d0vrfy0bcrrm"))))
390 (build-system gnu-build-system)
391 (native-inputs
392 `(("which" ,which)
393 ("emacs" ,emacs-minimal)
394 ("texinfo" ,texinfo)))
395 (inputs
396 `(("host-emacs" ,emacs)
397 ("perl" ,perl)
398 ("coq" ,coq)))
399 (arguments
400 `(#:tests? #f ; no check target
401 #:make-flags (list (string-append "PREFIX=" %output)
402 (string-append "DEST_PREFIX=" %output))
403 #:modules ((guix build gnu-build-system)
404 (guix build utils)
405 (guix build emacs-utils))
406 #:imported-modules (,@%gnu-build-system-modules
407 (guix build emacs-utils))
408 #:phases
409 (modify-phases %standard-phases
410 (delete 'configure)
411 (add-after 'unpack 'disable-byte-compile-error-on-warn
412 (lambda _
413 (substitute* "Makefile"
414 (("\\(setq byte-compile-error-on-warn t\\)")
415 "(setq byte-compile-error-on-warn nil)"))
416 #t))
417 (add-after 'unpack 'patch-hardcoded-paths
418 (lambda* (#:key inputs outputs #:allow-other-keys)
419 (let ((out (assoc-ref outputs "out"))
420 (coq (assoc-ref inputs "coq"))
421 (emacs (assoc-ref inputs "host-emacs")))
422 (define (coq-prog name)
423 (string-append coq "/bin/" name))
424 (emacs-substitute-variables "coq/coq.el"
425 ("coq-prog-name" (coq-prog "coqtop"))
426 ("coq-compiler" (coq-prog "coqc"))
427 ("coq-dependency-analyzer" (coq-prog "coqdep")))
428 (substitute* "Makefile"
429 (("/sbin/install-info") "install-info"))
430 (substitute* "bin/proofgeneral"
431 (("^PGHOMEDEFAULT=.*" all)
432 (string-append all
433 "PGHOME=$PGHOMEDEFAULT\n"
434 "EMACS=" emacs "/bin/emacs")))
435 #t)))
436 (add-after 'unpack 'clean
437 (lambda _
438 ;; Delete the pre-compiled elc files for Emacs 23.
439 (zero? (system* "make" "clean"))))
440 (add-after 'install 'install-doc
441 (lambda* (#:key make-flags #:allow-other-keys)
442 ;; XXX FIXME avoid building/installing pdf files,
443 ;; due to unresolved errors building them.
444 (substitute* "Makefile"
445 ((" [^ ]*\\.pdf") ""))
446 (zero? (apply system* "make" "install-doc"
447 make-flags)))))))
448 (home-page "http://proofgeneral.inf.ed.ac.uk/")
449 (synopsis "Generic front-end for proof assistants based on Emacs")
450 (description
451 "Proof General is a major mode to turn Emacs into an interactive proof
452 assistant to write formal mathematical proofs using a variety of theorem
453 provers.")
454 (license gpl2+)))
455
456 (define-public lablgtk
457 (package
458 (name "lablgtk")
459 (version "2.18.3")
460 (source
461 (origin
462 (method url-fetch)
463 (uri (string-append "https://forge.ocamlcore.org/frs/download.php/"
464 "1479/lablgtk-2.18.3.tar.gz"))
465 (sha256
466 (base32
467 "1bybn3jafxf4cx25zvn8h2xj9agn1xjbn7j3ywxxqx6az7rfnnwp"))))
468 (build-system gnu-build-system)
469 (native-inputs
470 `(("camlp4" ,camlp4)
471 ("ocaml" ,ocaml)
472 ("pkg-config" ,pkg-config)))
473 ;; FIXME: Add inputs gtkgl-2.0, libpanelapplet-2.0, gtkspell-2.0,
474 ;; and gtk+-quartz-2.0 once available.
475 (inputs
476 `(("gtk+" ,gtk+-2)
477 ("gtksourceview" ,gtksourceview-2)
478 ("libgnomecanvas" ,libgnomecanvas)
479 ("libgnomeui" ,libgnomeui)
480 ("libglade" ,libglade)
481 ("librsvg" ,librsvg)))
482 (arguments
483 `(#:tests? #f ; no check target
484
485 ;; opt: also install cmxa files
486 #:make-flags (list "all" "opt")
487 ;; Occasionally we would get "Error: Unbound module GtkThread" when
488 ;; compiling 'gtkThInit.ml', with 'make -j'. So build sequentially.
489 #:parallel-build? #f
490
491 #:phases
492 (modify-phases %standard-phases
493 (replace 'install
494 (lambda* (#:key inputs outputs #:allow-other-keys)
495 (let ((out (assoc-ref outputs "out"))
496 (ocaml (assoc-ref inputs "ocaml")))
497 ;; Install into the output and not the ocaml directory.
498 (substitute* "config.make"
499 ((ocaml) out))
500 (system* "make" "old-install")
501 #t))))))
502 (home-page "http://lablgtk.forge.ocamlcore.org/")
503 (synopsis "GTK+ bindings for OCaml")
504 (description
505 "LablGtk is an OCaml interface to GTK+ 1.2 and 2.x. It provides
506 a strongly-typed object-oriented interface that is compatible with the
507 dynamic typing of GTK+. Most widgets and methods are available. LablGtk
508 also provides bindings to
509 gdk-pixbuf, the GLArea widget (in combination with LablGL), gnomecanvas,
510 gnomeui, gtksourceview, gtkspell,
511 libglade (and it an generate OCaml code from .glade files),
512 libpanel, librsvg and quartz.")
513 (license lgpl2.1)))
514
515 (define-public unison
516 (package
517 (name "unison")
518 (version "2.48.3")
519 (source
520 (origin
521 (method svn-fetch)
522 (uri (svn-reference
523 (url (string-append "https://webdav.seas.upenn.edu/svn/"
524 "unison/branches/"
525 (version-major+minor version)))
526 (revision 535)))
527 (file-name (string-append name "-" version "-checkout"))
528 (sha256
529 (base32
530 "0486s53wyayicj9f2raj2dvwvk4xyzar219rccc1iczdwixm4x05"))
531 (modules '((guix build utils)
532 (ice-9 rdelim)
533 (ice-9 regex)
534 (srfi srfi-1)))
535 (snippet
536 `(begin
537 ;; The svn revision in the release tarball appears to be
538 ;; artificially manipulated in order to set the desired point
539 ;; version number. Because the point version is calculated during
540 ;; the build, we can offset pointVersionOrigin by the desired
541 ;; point version and write that into "Rev: %d". We do this rather
542 ;; than hardcoding the necessary revision number, for
543 ;; maintainability.
544 (with-atomic-file-replacement "src/mkProjectInfo.ml"
545 (lambda (in out)
546 (let ((pt-ver (string->number (third (string-split ,version #\.))))
547 (pt-rx (make-regexp "^let pointVersionOrigin = ([0-9]+)"))
548 (rev-rx (make-regexp "Rev: [0-9]+")))
549 (let loop ((pt-origin #f))
550 (let ((line (read-line in 'concat)))
551 (cond
552 ((regexp-exec pt-rx line)
553 => (lambda (m)
554 (display line out)
555 (loop (string->number (match:substring m 1)))))
556 ((regexp-exec rev-rx line)
557 => (lambda (m)
558 (format out "~aRev: ~d~a"
559 (match:prefix m)
560 (+ pt-origin pt-ver)
561 (match:suffix m))
562 (dump-port in out))) ;done
563 (else
564 (display line out)
565 (loop pt-origin))))))))
566 ;; Without the '-fix' argument, the html file produced does not
567 ;; have functioning internal hyperlinks.
568 (substitute* "doc/Makefile"
569 (("hevea unison") "hevea -fix unison"))))))
570 (build-system gnu-build-system)
571 (outputs '("out"
572 "doc")) ; 1.9 MiB of documentation
573 (native-inputs
574 `(("ocaml" ,ocaml)
575 ;; For documentation
576 ("ghostscript-gs" ,ghostscript-gs)
577 ("ghostscript" ,ghostscript)
578 ("texlive" ,texlive)
579 ("hevea" ,hevea)
580 ("lynx" ,lynx)))
581 (arguments
582 `(#:parallel-build? #f
583 #:parallel-tests? #f
584 #:test-target "selftest"
585 #:tests? #f ; Tests require writing to $HOME.
586 ; If some $HOME is provided, they fail with the message
587 ; "Fatal error: Skipping some tests -- remove me!"
588 #:phases
589 (modify-phases %standard-phases
590 (delete 'configure)
591 (add-before 'install 'prepare-install
592 (lambda* (#:key outputs #:allow-other-keys)
593 (let* ((out (assoc-ref outputs "out"))
594 (bin (string-append out "/bin")))
595 (mkdir-p bin)
596 (setenv "HOME" out) ; forces correct INSTALLDIR in Makefile
597 #t)))
598 (add-after 'install 'install-fsmonitor
599 (lambda* (#:key outputs #:allow-other-keys)
600 (let* ((out (assoc-ref outputs "out"))
601 (bin (string-append out "/bin")))
602 ;; 'unison-fsmonitor' is used in "unison -repeat watch" mode.
603 (install-file "src/unison-fsmonitor" bin))))
604 (add-after 'install 'install-doc
605 (lambda* (#:key outputs #:allow-other-keys)
606 (let ((doc (string-append (assoc-ref outputs "doc")
607 "/share/doc/unison")))
608 (mkdir-p doc)
609 ;; This file needs write-permissions, because it's
610 ;; overwritten by 'docs' during documentation generation.
611 (chmod "src/strings.ml" #o600)
612 (and (zero? (system* "make" "docs"
613 "TEXDIRECTIVES=\\\\draftfalse"))
614 (begin
615 (for-each (lambda (f)
616 (install-file f doc))
617 (map (lambda (ext)
618 (string-append
619 "doc/unison-manual." ext))
620 ;; Install only html documentation,
621 ;; since the build is currently
622 ;; non-reproducible with the ps, pdf,
623 ;; and dvi docs.
624 '(;;"ps" "pdf" "dvi"
625 "html")))
626 #t))))))))
627 (home-page "https://www.cis.upenn.edu/~bcpierce/unison/")
628 (synopsis "File synchronizer")
629 (description
630 "Unison is a file-synchronization tool. It allows two replicas of
631 a collection of files and directories to be stored on different hosts
632 (or different disks on the same host), modified separately, and then
633 brought up to date by propagating the changes in each replica
634 to the other.")
635 (license gpl3+)))
636
637 (define-public ocaml-findlib
638 (package
639 (name "ocaml-findlib")
640 (version "1.6.1")
641 (source (origin
642 (method url-fetch)
643 (uri (string-append "http://download.camlcity.org/download/"
644 "findlib" "-" version ".tar.gz"))
645 (sha256
646 (base32
647 "02abg1lsnwvjg3igdyb8qjgr5kv1nbwl4gaf8mdinzfii5p82721"))
648 (patches (search-patches "ocaml-findlib-make-install.patch"))))
649 (build-system gnu-build-system)
650 (native-inputs
651 `(("camlp4" ,camlp4)
652 ("m4" ,m4)
653 ("ocaml" ,ocaml)))
654 (arguments
655 `(#:tests? #f ; no test suite
656 #:parallel-build? #f
657 #:make-flags (list "all" "opt")
658 #:phases (modify-phases %standard-phases
659 (replace
660 'configure
661 (lambda* (#:key inputs outputs #:allow-other-keys)
662 (let ((out (assoc-ref outputs "out")))
663 (system*
664 "./configure"
665 "-bindir" (string-append out "/bin")
666 "-config" (string-append out "/etc/ocamfind.conf")
667 "-mandir" (string-append out "/share/man")
668 "-sitelib" (string-append out "/lib/ocaml/site-lib")
669 "-with-toolbox")))))))
670 (home-page "http://projects.camlcity.org/projects/findlib.html")
671 (synopsis "Management tool for OCaml libraries")
672 (description
673 "The \"findlib\" library provides a scheme to manage reusable software
674 components (packages), and includes tools that support this scheme. Packages
675 are collections of OCaml modules for which metainformation can be stored. The
676 packages are kept in the file system hierarchy, but with strict directory
677 structure. The library contains functions to look the directory up that
678 stores a package, to query metainformation about a package, and to retrieve
679 dependency information about multiple packages. There is also a tool that
680 allows the user to enter queries on the command-line. In order to simplify
681 compilation and linkage, there are new frontends of the various OCaml
682 compilers that can directly deal with packages.")
683 (license x11)))