1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
3 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
5 ;;; This file is part of GNU Guix.
7 ;;; GNU Guix is free software; you can redistribute it and/or modify it
8 ;;; under the terms of the GNU General Public License as published by
9 ;;; the Free Software Foundation; either version 3 of the License, or (at
10 ;;; your option) any later version.
12 ;;; GNU Guix is distributed in the hope that it will be useful, but
13 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;;; GNU General Public License for more details.
17 ;;; You should have received a copy of the GNU General Public License
18 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20 (define-module (gnu packages ocaml)
21 #:use-module (guix licenses)
22 #:use-module (guix packages)
23 #:use-module (guix download)
24 #:use-module (guix build-system gnu)
25 #:use-module (gnu packages)
26 #:use-module (gnu packages perl)
27 #:use-module (gnu packages python)
28 #:use-module (gnu packages ncurses)
29 #:use-module (gnu packages version-control)
30 #:use-module (gnu packages curl))
39 "http://caml.inria.fr/pub/distrib/ocaml-4.00/ocaml-"
43 "0yp86napnvbi2jgxr6bk1235bmjdclgzrzgq4mhwv87l7dymr3dl"))))
44 (build-system gnu-build-system)
46 `(#:modules ((guix build gnu-build-system)
49 #:phases (alist-replace
51 (lambda* (#:key outputs #:allow-other-keys)
52 ;; OCaml uses "-prefix <prefix>" rather than the usual
53 ;; "--prefix=<prefix>".
54 (let ((out (assoc-ref outputs "out")))
55 (zero? (system* "./configure" "-prefix" out
57 (string-append out "/share/man")))))
60 (lambda* (#:key outputs #:allow-other-keys)
61 ;; "make" does not do anything, we must use
63 (zero? (system* "make" "world.opt")))
66 (lambda* (#:key outputs #:allow-other-keys)
67 ;; There does not seem to be a "check" or "test" target.
68 (zero? (system "cd testsuite && make all")))
69 (let ((check (assq-ref %standard-phases 'check)))
70 ;; OCaml assumes that "make install" is run before
71 ;; launching the tests.
73 'install 'check-after-install
75 (alist-delete 'check %standard-phases))))))))
76 (inputs `(("perl" ,perl)))
77 (home-page "http://caml.inria.fr/")
78 (synopsis "The OCaml programming language")
80 "OCaml is a general purpose industrial-strength programming language with
81 an emphasis on expressiveness and safety. Developed for more than 20 years at
82 Inria it benefits from one of the most advanced type systems and supports
83 functional, imperative and object-oriented styles of programming.")
84 (license (list qpl gpl2))))
92 ;; Use the '-full' version, which includes all the dependencies.
94 "https://github.com/ocaml/opam/releases/download/"
95 version "/opam-full-" version ".tar.gz")
96 ;; (string-append "https://github.com/ocaml/opam/archive/"
101 "1frzqkx6yn1pnyd9qz3bv3rbwv74bmc1xji8kl41r1dkqzfl3xqv"))))
102 (build-system gnu-build-system)
104 '(;; Sometimes, 'make -jX' would fail right after ./configure with
105 ;; "Fatal error: exception End_of_file".
108 ;; For some reason, 'ocp-build' needs $TERM to be set.
109 #:make-flags '("TERM=screen")
110 #:test-target "tests"
112 ;; FIXME: There's an obscure test failure:
113 ;; …/_obuild/opam/opam.asm install P1' failed.
116 #:phases (alist-cons-before
118 (lambda* (#:key inputs #:allow-other-keys)
119 (let ((bash (assoc-ref inputs "bash")))
120 (substitute* "src/core/opamSystem.ml"
122 (string-append "\"" bash "/bin/sh\"")))))
126 (setenv "HOME" (getcwd))
127 (and (system "git config --global user.email guix@gnu.org")
128 (system "git config --global user.name Guix")))
131 `(("git" ,git) ;for the tests
132 ("python" ,python))) ;for the tests
137 (home-page "http://opam.ocamlpro.com/")
138 (synopsis "Package manager for OCaml")
140 "OPAM is a tool to manage OCaml packages. It supports multiple
141 simultaneous compiler installations, flexible package constraints, and a
142 Git-friendly development workflow.")
144 ;; The 'LICENSE' file waives some requirements compared to LGPLv3.