diff --git a/gnu/packages/ghc.scm b/gnu/packages/ghc.scm
new file mode 100644
index 0000000..1a3d308
--- /dev/null
+++ b/gnu/packages/ghc.scm
@@ -0,0 +1,114 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2013 Nikita Karetnikov
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see .
+
+(define-module (gnu packages ghc)
+ #:use-module ((guix licenses) #:select (bsd-style))
+ #:use-module (guix packages)
+ #:use-module (guix download)
+ #:use-module (guix build-system gnu)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages bootstrap)
+ #:use-module (gnu packages libffi)
+ #:use-module (gnu packages multiprecision)
+ #:use-module (gnu packages ncurses)
+ #:use-module (gnu packages patchelf)
+ #:use-module (gnu packages perl))
+
+(define-public ghc-7.0.1-bin
+ (package
+ (name "ghc-bin")
+ ;; 7.0.2--7.6.3
+ (version "7.0.1")
+ (source
+ (origin
+ (method url-fetch)
+ ;; XXX: Support other platforms.
+ (uri (string-append "http://www.haskell.org/ghc/dist/"
+ version "/ghc-" version
+ "-i386-unknown-linux.tar.bz2"))
+ (sha256
+ (base32
+ "1cc9ih3h804gj53vf1xabg4155m6bz5r468mjsv54kckmabgsmav"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:modules ((guix build gnu-build-system)
+ (guix build utils)
+ (srfi srfi-1))
+ #:phases (alist-cons-before
+ 'configure 'pre-configure
+ (lambda _
+ (let ((gmp (string-append (assoc-ref %build-inputs "gmp")
+ "/lib"))
+ (linker (string-append
+ (assoc-ref %build-inputs "libc")
+ ,(glibc-dynamic-linker)))
+ (libffi (string-append
+ (assoc-ref %build-inputs "libffi")
+ "/lib"))
+ (ncurses (string-append
+ (assoc-ref %build-inputs "ncurses")
+ "/lib"))
+ (patchelf (which "patchelf"))
+ (pwd (which "pwd"))
+ (sh (which "sh")))
+ (begin (substitute* '("configure"
+ "mk/config.mk.in"
+ "utils/ghc-pkg/ghc.mk"
+
+ ;; Fails with a "string contains
+ ;; #\nul character" error.
+ "inplace/bin/ghc-cabal"
+
+ "inplace/bin/mkdirhier"
+ "utils/ghc-pkg/ghc.mk")
+ (("/bin/sh") sh)
+ (("/usr/local/bin/bash") sh)
+ (("utils/ghc-pwd/ghc-pwd") pwd))
+
+ (every (lambda (file)
+ (zero?
+ (system* patchelf
+ "--set-interpreter" linker
+ "--set-rpath"
+ (string-append gmp ":" ncurses)
+ file)))
+ (filter executable-file?
+ (find-files "utils" "")))
+
+ (zero? (system* patchelf
+ "--set-interpreter" linker
+ "--set-rpath"
+ (string-append gmp ":" libffi)
+ "inplace/bin/ghc-cabal")))))
+
+ (alist-delete 'build %standard-phases))
+ #:tests? #f))
+ (inputs
+ `(("gmp" ,gmp-4.3)
+ ("libc" ,glibc)
+ ("libffi" ,libffi-3.0)
+ ("ncurses" ,ncurses)
+ ("patchelf" ,patchelf)
+ ("perl" ,perl)))
+ (home-page "http://www.haskell.org/ghc/")
+ (synopsis "Haskell compiler and interactive environment")
+ (description
+ "This is a binary distribution of GHC, a compiler and interactive
+environment for the Haskell functional programming language.")
+ (license (bsd-style "file://LICENSE"
+ "See LICENSE in the distribution."))))
diff --git a/gnu/packages/libffi.scm b/gnu/packages/libffi.scm
index e4a2761..dbc41c3 100644
--- a/gnu/packages/libffi.scm
+++ b/gnu/packages/libffi.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013 Ludovic Courtès
+;;; Copyright © 2013 Nikita Karetnikov
;;;
;;; This file is part of GNU Guix.
;;;
@@ -71,3 +72,16 @@ conversions for values passed between the two languages.")
;; See .
(license expat))))
+(define-public libffi-3.0
+ (package (inherit libffi)
+ (name "libffi")
+ (version "3.0.10")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append "ftp://sourceware.org/pub/libffi/"
+ name "-" version ".tar.gz"))
+ (sha256
+ (base32 "0bs97dgvqrbzc9zv9y2ff5flfvbmfyc68dpnxvm6mdcygq1bj7ph"))))
+ (arguments `(#:phases (alist-delete 'post-install %standard-phases)))))
diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm
index 16383d1..f8553c8 100644
--- a/gnu/packages/multiprecision.scm
+++ b/gnu/packages/multiprecision.scm
@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2012, 2013 Ludovic Courtès
+;;; Copyright © 2013 Nikita Karetnikov
;;;
;;; This file is part of GNU Guix.
;;;
@@ -65,9 +66,20 @@ emphasis on speed.
GMP is faster than any other bignum library. The advantage for GMP increases
with the operand sizes for many operations, since GMP uses asymptotically
faster algorithms.")
- (license lgpl3+)
+ (license (list gpl3+ lgpl3+))
(home-page "http://gmplib.org/")))
+(define-public gmp-4.3
+ (package (inherit gmp)
+ (version "4.3.2")
+ (source
+ (origin
+ (method url-fetch)
+ (uri
+ (string-append "mirror://gnu/gmp/gmp-" version ".tar.bz2"))
+ (sha256
+ (base32 "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck"))))))
+
(define-public mpfr
(package
(name "mpfr")