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