You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

78 lines
3.3 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu packages ocaml)
  19. #:use-module (guix licenses)
  20. #:use-module (guix packages)
  21. #:use-module (guix download)
  22. #:use-module (guix build-system gnu)
  23. #:use-module (gnu packages)
  24. #:use-module (gnu packages perl))
  25. (define-public ocaml
  26. (package
  27. (name "ocaml")
  28. (version "4.00.1")
  29. (source (origin
  30. (method url-fetch)
  31. (uri (string-append
  32. "http://caml.inria.fr/pub/distrib/ocaml-4.00/ocaml-"
  33. version ".tar.gz"))
  34. (sha256
  35. (base32
  36. "0yp86napnvbi2jgxr6bk1235bmjdclgzrzgq4mhwv87l7dymr3dl"))))
  37. (build-system gnu-build-system)
  38. (arguments
  39. `(#:modules ((guix build gnu-build-system)
  40. (guix build utils)
  41. (srfi srfi-1))
  42. #:phases (alist-replace
  43. 'configure
  44. (lambda* (#:key outputs #:allow-other-keys)
  45. ;; OCaml uses "-prefix <prefix>" rather than the usual
  46. ;; "--prefix=<prefix>".
  47. (let ((out (assoc-ref outputs "out")))
  48. (zero? (system* "./configure" "-prefix" out))))
  49. (alist-replace
  50. 'build
  51. (lambda* (#:key outputs #:allow-other-keys)
  52. ;; "make" does not do anything, we must use
  53. ;; "make world.opt".
  54. (zero? (system* "make" "world.opt")))
  55. (alist-replace
  56. 'check-after-install
  57. (lambda* (#:key outputs #:allow-other-keys)
  58. ;; There does not seem to be a "check" or "test" target.
  59. (zero? (system "cd testsuite && make all")))
  60. (let ((check (assq-ref %standard-phases 'check)))
  61. ;; OCaml assumes that "make install" is run before
  62. ;; launching the tests.
  63. (alist-cons-after
  64. 'install 'check-after-install
  65. check
  66. (alist-delete 'check %standard-phases))))))))
  67. (inputs `(("perl" ,perl)))
  68. (home-page "http://caml.inria.fr/")
  69. (synopsis "The OCaml programming language")
  70. (description
  71. "OCaml is a general purpose industrial-strength programming language with
  72. an emphasis on expressiveness and safety. Developed for more than 20 years at
  73. Inria it benefits from one of the most advanced type systems and supports
  74. functional, imperative and object-oriented styles of programming.")
  75. (license (list qpl gpl2))))