gnu: Add zita-resampler.
[jackhill/guix/guix.git] / gnu / packages / scheme.scm
index df4bf7f..803b8d5 100644 (file)
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2015 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
   #:use-module (guix licenses)
   #:use-module (guix packages)
   #:use-module (guix download)
+  #:use-module (guix utils)
   #:use-module (guix build-system gnu)
   #:use-module (gnu packages m4)
   #:use-module (gnu packages multiprecision)
+  #:use-module (gnu packages databases)
   #:use-module (gnu packages emacs)
   #:use-module (gnu packages texinfo)
-  #:use-module (gnu packages elf)
-  #:use-module (gnu packages which)
+  #:use-module (gnu packages base)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages avahi)
   #:use-module (gnu packages libphidget)
   #:use-module (gnu packages glib)
   #:use-module (gnu packages gtk)
   #:use-module (gnu packages libffi)
-  #:use-module (gnu packages libjpeg)
+  #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages image)
+  #:use-module (gnu packages xorg)
   #:use-module (ice-9 match))
 
+(define (mit-scheme-source-directory system version)
+  (string-append "mit-scheme-"
+                 (if (or (string-prefix? "x86_64" system)
+                         (string-prefix? "i686" system))
+                     ""
+                     "c-")
+                 version))
+
 (define-public mit-scheme
   (package
     (name "mit-scheme")
-    (version "9.1.1")
+    (version "9.2")
     (source #f)                                   ; see below
     (build-system gnu-build-system)
     (arguments
         (lambda* (#:key inputs #:allow-other-keys)
           (and (zero? (system* "tar" "xzvf"
                                (assoc-ref inputs "source")))
-               (chdir ,(string-append name "-" version))
+               (chdir ,(mit-scheme-source-directory (%current-system)
+                                                    version))
                (begin
                  ;; Delete these dangling symlinks since they break
                  ;; `patch-shebangs'.
                  (for-each delete-file
-                           (append (find-files "src/lib/lib" "\\.so$")
-                                   (find-files "src/lib" "^ffi-test")))
+                           (append '("src/lib/shim-config.scm")
+                                   (find-files "src/lib/lib" "\\.so$")
+                                   (find-files "src/lib" "^liarc-")
+                                   (find-files "src/compiler" "^make\\.")))
                  (chdir "src")
                  #t)))
         (alist-replace
@@ -76,6 +91,7 @@
        ;; ("texlive-core" ,texlive-core)
        ("texinfo" ,texinfo)
        ("m4" ,m4)
+       ("libx11" ,libx11)
 
        ("source"
 
           (method url-fetch)
           (uri (string-append "mirror://gnu/mit-scheme/stable.pkg/"
                               version "/mit-scheme-"
-                              version "-"
                               (match (%current-system)
-                                ("x86_64-linux" "x86-64")
-                                ("i686-linux" "i386")
-                                (_ "c"))
+                                ("x86_64-linux"
+                                 (string-append version "-x86-64"))
+                                ("i686-linux"
+                                 (string-append version "-i386"))
+                                (_
+                                 (string-append "c-" version)))
                               ".tar.gz"))
           (sha256
            (match (%current-system)
              ("x86_64-linux"
               (base32
-               "1wcxm9hyfc53myvlcn93fyqrnnn4scwkknl9hkbp1cphc6mp291x"))
+               "1skzxxhr0iq96bf0j5m7mvf3i4sppfyfa6gpqn34mwgkw1fx8274"))
              ("i686-linux"
               (base32
-               "0vi760fy550d9db538m0vzbq1mpdncvw9g8bk4lswk0kcdira55z"))
+               "1fmlpnhf5a75db93phajh4ysbdgrgl72v45lk3kznriprl0a7jc6"))
              (_
               (base32
-               "0pclakzwxbqgy6wqwvs6ml62wgby8ba8xzmwzdwhx1v8wv05yw1j"))))))))
+               "0w5ib5vsidihb4hb6fma3sp596ykr8izagm57axvgd6lqzwicsjg"))))))))
+
+    ;; Fails to build on MIPS, see <http://bugs.gnu.org/18221>.
+    (supported-systems (delete "mips64el-linux" %supported-systems))
+
     (home-page "http://www.gnu.org/software/mit-scheme/")
-    (synopsis "Scheme implementation with integrated editor and debugger")
+    (synopsis "Scheme implementation with integrated editor and debugger")
     (description
      "GNU/MIT Scheme is an implementation of the Scheme programming
 language.  It provides an interpreter, a compiler and a debugger.  It also
@@ -167,7 +189,10 @@ features an integrated Emacs-like editor and a large runtime library.")
                                ;; <http://article.gmane.org/gmane.lisp.scheme.bigloo/6126>.
                                ;; "--customgc=no" ; use our libgc
                                (string-append"--mv=" (which "mv"))
-                               (string-append "--rm=" (which "rm"))))))
+                               (string-append "--rm=" (which "rm"))
+                               (string-append "--ldflags=-Wl,-rpath="
+                                              (assoc-ref outputs "out")
+                                              "/lib/bigloo/" ,version)))))
                  (alist-cons-after
                   'install 'install-emacs-modes
                   (lambda* (#:key outputs #:allow-other-keys)
@@ -178,7 +203,7 @@ features an integrated Emacs-like editor and a large runtime library.")
                                       (string-append "EMACSDIR=" dir)))))
                   %standard-phases))))
     (inputs
-     `(("emacs" ,emacs)
+     `(("emacs" ,emacs)                      ;UDE needs the X version of Emacs
 
        ;; Optional APIs for which Bigloo has bindings.
        ("avahi" ,avahi)
@@ -188,7 +213,7 @@ features an integrated Emacs-like editor and a large runtime library.")
     (propagated-inputs
      `(("gmp" ,gmp)))                             ; bigloo.h refers to gmp.h
     (home-page "http://www-sop.inria.fr/indes/fp/Bigloo/")
-    (synopsis "Bigloo, an efficient Scheme compiler")
+    (synopsis "Efficient Scheme compiler")
     (description
      "Bigloo is a Scheme implementation devoted to one goal: enabling
 Scheme based programming style where C(++) is usually
@@ -211,57 +236,29 @@ Scheme and C programs and between Scheme and Java programs.")
              (sha256
               (base32
                "1v2r4ga58kk1sx0frn8qa8ccmjpic9csqzpk499wc95y9c4b1wy3"))
-             (patches (list (search-patch "hop-bigloo-4.0b.patch")))))
+             (patches (list (search-patch "hop-bigloo-4.0b.patch")
+                            (search-patch "hop-linker-flags.patch")))))
     (build-system gnu-build-system)
     (arguments
-     '(#:phases
+     `(#:phases
        (alist-replace
         'configure
-        (lambda* (#:key inputs outputs #:allow-other-keys)
+        (lambda* (#:key outputs #:allow-other-keys)
           (let ((out (assoc-ref outputs "out")))
             (zero?
              (system* "./configure"
-                      (string-append "--prefix=" out)))))
-        (alist-cons-after
-         'strip 'patch-rpath
-         (lambda* (#:key outputs #:allow-other-keys)
-           ;; Patch the RPATH of every installed library to point to $out/lib
-           ;; instead of $TMPDIR.  Note that "patchelf --set-rpath" produces
-           ;; invalid binaries when used before stripping.
-           (let ((out    (assoc-ref outputs "out"))
-                 (tmpdir (getcwd)))
-             (every (lambda (lib)
-                      (let* ((in    (open-pipe* OPEN_READ "patchelf"
-                                                "--print-rpath" lib))
-                             (rpath (read-line in)))
-                        (and (zero? (close-pipe in))
-                             (let ((rpath* (regexp-substitute/global
-                                            #f (regexp-quote tmpdir) rpath
-                                            'pre out 'post)))
-                               (or (equal? rpath rpath*)
-                                   (begin
-                                     (format #t "~a: changing RPATH from `~a' to `~a'~%"
-                                             lib rpath rpath*)
-                                     (zero?
-                                      (system* "patchelf" "--set-rpath"
-                                               rpath* lib))))))))
-                    (append (find-files (string-append out "/bin")
-                                        ".*")
-                            (find-files (string-append out "/lib")
-                                        "\\.so$")))))
-         %standard-phases))
-       #:tests? #f                                ; no test suite
-       #:modules ((guix build gnu-build-system)
-                  (guix build utils)
-                  (ice-9 popen)
-                  (ice-9 regex)
-                  (ice-9 rdelim)
-                  (srfi srfi-1))))
+                      (string-append "--prefix=" out)
+                      (string-append "--blflags="
+                                     ;; user flags completely override useful
+                                     ;; default flags, so repeat them here.
+                                     "-copt \\$(CPICFLAGS) -L\\$(BUILDLIBDIR) "
+                                     "-ldopt -Wl,-rpath," out "/lib")))))
+        %standard-phases)
+       #:tests? #f))                                ; no test suite
     (inputs `(("bigloo" ,bigloo)
-              ("which" ,which)
-              ("patchelf" ,patchelf)))
+              ("which" ,which)))
     (home-page "http://hop.inria.fr/")
-    (synopsis "A multi-tier programming language for the Web 2.0")
+    (synopsis "Multi-tier programming language for the Web 2.0")
     (description
      "HOP is a multi-tier programming language for the Web 2.0 and the
 so-called diffuse Web.  It is designed for programming interactive web
@@ -273,14 +270,14 @@ mashups, office (web agendas, mail clients, ...), etc.")
 (define-public chicken
   (package
     (name "chicken")
-    (version "4.8.0.3")
+    (version "4.9.0.1")
     (source (origin
              (method url-fetch)
-             (uri (string-append "http://code.call-cc.org/releases/4.8.0/chicken-"
+             (uri (string-append "http://code.call-cc.org/releases/4.9.0/chicken-"
                                  version ".tar.gz"))
              (sha256
               (base32
-               "1hwrnc2dhgbnz3mlpcb4qvg76kwsfzqylw24gxyy91jmygk1853a"))))
+               "0598mar1qswfd8hva9nqs88zjn02lzkqd8fzdd21dz1nki1prpq4"))))
     (build-system gnu-build-system)
     (arguments
      `(#:modules ((guix build gnu-build-system)
@@ -336,18 +333,17 @@ implementation techniques and as an expository tool.")
 (define-public racket
   (package
     (name "racket")
-    (version "5.3.4")
+    (version "6.1.1")
     (source (origin
              (method url-fetch)
-             (uri (list (string-append "http://download.racket-lang.org/installers/"
-                                       version "/racket/racket-" version
-                                       "-src-unix.tgz")
+             (uri (list (string-append "http://mirror.racket-lang.org/installers/"
+                                       version "/racket-" version "-src.tgz")
                         (string-append
                          "http://mirror.informatik.uni-tuebingen.de/mirror/racket/"
                          version "/racket/racket-" version "-src-unix.tgz")))
              (sha256
-              ;; XXX: Used to be 1xhnx3yd74zrvn6sfcqmk57kxj51cwvm660dwiaxr1qxnm5lq0v7.
-              (base32 "0yrdmpdvzf092869y6zjjjxl6j2kypgiv7qrfkv7lj8w01pbh7sd"))))
+              (base32
+               "0xfsfdqkngz0xw2lqmc7bsznwx25cw91l9fjhp7abrr05m96j0h9"))))
     (build-system gnu-build-system)
     (arguments
      '(#:phases
@@ -361,7 +357,9 @@ implementation techniques and as an expository tool.")
                        (lib "pango")
                        (lib "libjpeg")
                        (lib "gtk")
-                       (lib "gdk-pixbuf")))))
+                       (lib "gdk-pixbuf")
+                       (lib "fontconfig")
+                       (lib "sqlite")))))         ;to build the doc
          (alist-cons-before
           'configure 'pre-configure
           (lambda* (#:key inputs #:allow-other-keys)
@@ -396,8 +394,10 @@ implementation techniques and as an expository tool.")
               ("cairo" ,cairo)
               ("pango" ,pango)
               ("libjpeg" ,libjpeg-8)
+              ("fontconfig" ,fontconfig)
               ("gdk-pixbuf" ,gdk-pixbuf)
-              ("gtk" ,gtk+-2)))
+              ("gtk" ,gtk+-2)
+              ("sqlite" ,sqlite)))                ;needed to build the doc
     (home-page "http://racket-lang.org")
     (synopsis "Implementation of Scheme and related languages")
     (description
@@ -406,3 +406,83 @@ R6RS) and related languages, such as Typed Racket.  It features a compiler and
 a virtual machine with just-in-time native compilation, as well as a large set
 of libraries.")
     (license lgpl2.0+)))
+
+(define-public gambit-c
+  (package
+    (name "gambit-c")
+    (version "4.7.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "http://www.iro.umontreal.ca/~gambit/download/gambit/v"
+             (version-major+minor version) "/source/gambc-v"
+             (string-map (lambda (c) (if (char=? c #\.) #\_ c)) version)
+             ".tgz"))
+       (sha256
+        (base32 "0y2pklh4k65yrmxv63ass76xckrk9wqimbdad2gha35v2mi7blhs"))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:configure-flags
+       ;; According to the ./configure script, this makes the build slower and
+       ;; use >= 1 GB memory, but makes Gambit much faster.
+       '("--enable-single-host")
+       #:phases
+       (alist-cons-before
+        'check 'fix-tests
+        (lambda _
+          (substitute* '("tests/makefile")
+            ;; '-:' is how run-time options are set.  'tl' sets some terminal
+            ;; option, which makes it fail in our build environment.  It
+            ;; recommends using 'd-' as a solution, which sets the REPL
+            ;; interaction channel to stdin/stdout.
+            (("gsi -:tl") "gsi -:d-,tl")))
+        %standard-phases)))
+    (home-page "http://www.iro.umontreal.ca/~gambit/")
+    (synopsis "Efficient Scheme interpreter and compiler")
+    (description
+     "Gambit consists of two main programs: gsi, the Gambit Scheme
+interpreter, and gsc, the Gambit Scheme compiler.  The interpreter contains
+the complete execution and debugging environment.  The compiler is the
+interpreter extended with the capability of generating executable files.  The
+compiler can produce standalone executables or compiled modules which can be
+loaded at run time.  Interpreted code and compiled code can be freely
+mixed.")
+    ;; Dual license.
+    (license (list lgpl2.1+ asl2.0))))
+
+(define-public chibi-scheme
+  (package
+    (name "chibi-scheme")
+    (version "0.7.3")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "https://github.com/ashinn/chibi-scheme/archive/"
+                           version ".tar.gz"))
+       (sha256
+        (base32 "16wppf4qzr0748iyp0m89gidsfgq9s6x3gw4xggym91waw4fh742"))
+       (file-name (string-append "chibi-scheme-" version ".tar.gz"))))
+    (build-system gnu-build-system)
+    (arguments
+     `(#:phases
+       (alist-delete
+        'configure
+        (alist-cons-before
+         'build 'set-cc
+         (lambda _
+           (setenv "CC" "gcc"))
+         %standard-phases))
+       #:make-flags (let ((out (assoc-ref %outputs "out")))
+                      (list (string-append "PREFIX=" out)
+                            (string-append "LDFLAGS=-Wl,-rpath=" out "/lib")))
+       #:test-target "test"))
+    (home-page "https://code.google.com/p/chibi-scheme/")
+    (synopsis "Small embeddable Scheme implementation")
+    (description
+     "Chibi-Scheme is a very small library with no external dependencies
+intended for use as an extension and scripting language in C programs.  In
+addition to support for lightweight VM-based threads, each VM itself runs in
+an isolated heap allowing multiple VMs to run simultaneously in different OS
+threads.")
+    (license bsd-3)))