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