ocaml: prepare for ocaml-4.05
more/packages/ocaml.scm
32 | 32 | #:use-module (gnu packages emacs) | |
33 | 33 | #:use-module (gnu packages flex) | |
34 | 34 | #:use-module (gnu packages llvm) | |
35 | + | #:use-module (gnu packages m4) | |
35 | 36 | #:use-module (gnu packages maths) | |
36 | 37 | #:use-module (gnu packages multiprecision) | |
37 | 38 | #:use-module (gnu packages ocaml) | |
… | |||
81 | 82 | "/lib/ocaml/site-lib")) | |
82 | 83 | #:phases (modify-phases %standard-phases (delete 'configure)))) | |
83 | 84 | ||
85 | + | (define-public ocaml-fix | |
86 | + | (package | |
87 | + | (inherit ocaml) | |
88 | + | (version "4.05.0") | |
89 | + | (source (origin | |
90 | + | (method url-fetch) | |
91 | + | (uri (string-append | |
92 | + | "http://caml.inria.fr/pub/distrib/ocaml-" | |
93 | + | (version-major+minor version) | |
94 | + | "/ocaml-" version ".tar.xz")) | |
95 | + | (sha256 | |
96 | + | (base32 | |
97 | + | "1y9fw1ci9pwnbbrr9nwr8cq8vypcxwdf4akvxard3mxl2jx2g984")))) | |
98 | + | (arguments | |
99 | + | `(#:modules ((guix build gnu-build-system) | |
100 | + | (guix build utils) | |
101 | + | (web server)) | |
102 | + | #:phases | |
103 | + | (modify-phases %standard-phases | |
104 | + | (add-after 'unpack 'patch-/bin/sh-references | |
105 | + | (lambda* (#:key inputs #:allow-other-keys) | |
106 | + | (let* ((sh (string-append (assoc-ref inputs "bash") | |
107 | + | "/bin/sh")) | |
108 | + | (quoted-sh (string-append "\"" sh "\""))) | |
109 | + | (with-fluids ((%default-port-encoding #f)) | |
110 | + | (for-each | |
111 | + | (lambda (file) | |
112 | + | (substitute* file | |
113 | + | (("\"/bin/sh\"") | |
114 | + | (begin | |
115 | + | (format (current-error-port) "\ | |
116 | + | patch-/bin/sh-references: ~a: changing `\"/bin/sh\"' to `~a'~%" | |
117 | + | file quoted-sh) | |
118 | + | quoted-sh)))) | |
119 | + | (find-files "." "\\.ml$")) | |
120 | + | #t)))) | |
121 | + | (replace 'configure | |
122 | + | (lambda* (#:key outputs #:allow-other-keys) | |
123 | + | (let* ((out (assoc-ref outputs "out")) | |
124 | + | (mandir (string-append out "/share/man"))) | |
125 | + | ;; Custom configure script doesn't recognize | |
126 | + | ;; --prefix=<PREFIX> syntax (with equals sign). | |
127 | + | (zero? (system* "./configure" | |
128 | + | "--prefix" out | |
129 | + | "--mandir" mandir))))) | |
130 | + | (replace 'build | |
131 | + | (lambda _ | |
132 | + | (zero? (system* "make" "-j1" ;; fails to build otherwise | |
133 | + | "world.opt")))) | |
134 | + | (delete 'check) | |
135 | + | (add-after 'install 'check | |
136 | + | (lambda _ | |
137 | + | (with-directory-excursion "testsuite" | |
138 | + | (zero? (system* "make" "all")))))))))) | |
139 | + | ||
84 | 140 | (define-public ocaml-zed | |
85 | 141 | (package | |
86 | 142 | (name "ocaml-zed") | |
… | |||
260 | 316 | provers.") | |
261 | 317 | (license license:gpl2+))) | |
262 | 318 | ||
319 | + | (define-public ocaml-findlib-fix | |
320 | + | (package | |
321 | + | (inherit ocaml-findlib) | |
322 | + | (native-inputs | |
323 | + | `(("camlp4" ,camlp4) | |
324 | + | ("ocaml" ,ocaml-fix) | |
325 | + | ("m4" ,m4))))) | |
326 | + | ||
327 | + | (define-public ocaml-build | |
328 | + | (package | |
329 | + | (name "ocaml-build") | |
330 | + | (version "0.11.0") | |
331 | + | (source (origin | |
332 | + | (method url-fetch) | |
333 | + | (uri (string-append "https://github.com/ocaml/ocamlbuild/archive/" | |
334 | + | version ".tar.gz")) | |
335 | + | (file-name (string-append name "-" version ".tar.gz")) | |
336 | + | (sha256 | |
337 | + | (base32 | |
338 | + | "1vh30731gv1brr4ljfzd6m5lni44ifyb1w8hwir81ff9874fs5qp")))) | |
339 | + | (build-system gnu-build-system) | |
340 | + | (arguments | |
341 | + | `(#:test-target "test" | |
342 | + | #:tests? #f; FIXME: tests fail to find Findlib | |
343 | + | #:make-flags | |
344 | + | (list (string-append "OCAMLBUILD_PREFIX=" (assoc-ref %outputs "out")) | |
345 | + | (string-append "OCAMLBUILD_BINDIR=" (assoc-ref %outputs "out") "/bin") | |
346 | + | (string-append "OCAMLBUILD_LIBDIR=" (assoc-ref %outputs "out") "/lib") | |
347 | + | (string-append "OCAMLBUILD_MANDIR=" (assoc-ref %outputs "out") "/share/man")) | |
348 | + | #:phases | |
349 | + | (modify-phases %standard-phases | |
350 | + | (delete 'configure) | |
351 | + | ;(replace 'configure | |
352 | + | ; (lambda* (#:key outputs #:allow-other-keys) | |
353 | + | ; (let ((out (assoc-ref %outputs "out"))) | |
354 | + | ; (zero? (system* "make" "-f" "configure.make" "all"))))) | |
355 | + | (add-before 'build 'findlib-environment | |
356 | + | (lambda* (#:key outputs #:allow-other-keys) | |
357 | + | (let* ((out (assoc-ref outputs "out"))) | |
358 | + | (setenv "OCAMLFIND_DESTDIR" (string-append out "/lib/ocaml/site-lib")) | |
359 | + | (setenv "OCAMLFIND_LDCONF" "ignore") | |
360 | + | #t)))))) | |
361 | + | (native-inputs | |
362 | + | `(("ocaml" ,ocaml-fix) | |
363 | + | ("findlib" ,ocaml-findlib-fix))) | |
364 | + | (home-page "") | |
365 | + | (synopsis "") | |
366 | + | (description "") | |
367 | + | (license license:lgpl2.1+))) | |
368 | + | ||
263 | 369 | (define-public ocaml-menhir-fix | |
264 | 370 | (package | |
265 | 371 | (inherit ocaml-menhir) | |
… | |||
272 | 378 | "menhir-" version ".tar.gz")) | |
273 | 379 | (sha256 | |
274 | 380 | (base32 | |
275 | - | "0qffci9qxgfabzyalx851q994yykl4n9ylr4vbplsm6is1padjh0")))))) | |
381 | + | "0qffci9qxgfabzyalx851q994yykl4n9ylr4vbplsm6is1padjh0")))) | |
382 | + | (inputs | |
383 | + | `(("ocaml" ,ocaml-fix) | |
384 | + | ("ocamlbuild" ,ocaml-build))))) | |
276 | 385 | ||
277 | 386 | (define-public compcert | |
278 | 387 | (package | |
… | |||
295 | 404 | (assoc-ref outputs "out")))))) | |
296 | 405 | #:tests? #f)) | |
297 | 406 | (native-inputs | |
298 | - | `(("ocaml" ,ocaml) | |
407 | + | `(("ocaml" ,ocaml-fix) | |
299 | 408 | ("coq" ,coq-fix))) | |
300 | 409 | (inputs | |
301 | 410 | `(("menhir" ,ocaml-menhir-fix))) |