+(define-public mpfr
+ (package
+ (name "mpfr")
+ (version "3.1.1")
+ (source (origin
+ (method http-fetch)
+ (uri (string-append "http://ftp.gnu.org/gnu/mpfr/mpfr-" version
+ ".tar.xz"))
+ (sha256 (base32
+ "0ym1ylcq803n52qrggxqmkz66gbn8ncc3ybawal31v5y5p1srma9"))))
+ (build-system gnu-build-system)
+ (inputs `(("gmp" ,gmp)))
+ (description "GNU MPFR, a library for multiple-precision floating-point
+arithmetic")
+ (long-description
+ "The GNU MPFR library is a C library for multiple-precision
+floating-point computations with correct rounding. MPFR is based on the GMP
+multiple-precision library.
+
+The main goal of MPFR is to provide a library for multiple-precision
+floating-point computation which is both efficient and has a well-defined
+semantics. It copies the good ideas from the ANSI/IEEE-754 standard for
+double-precision floating-point arithmetic (53-bit mantissa).")
+ (license "LGPLv3+")
+ (home-page "http://www.mpfr.org/")))
+
+(define-public mpc
+ (package
+ (name "mpc")
+ (version "0.9")
+ (source (origin
+ (method http-fetch)
+ (uri (string-append
+ "http://www.multiprecision.org/mpc/download/mpc-"
+ version ".tar.gz"))
+ (sha256 (base32
+ "1b29n3gd9awla1645nmyy8dkhbhs1p0g504y0n94ai8d5x1gwgpx"))))
+ (build-system gnu-build-system)
+ (inputs `(("gmp" ,gmp)
+ ("mpfr" ,mpfr)))
+ (description "GNU MPC, a library for multiprecision complex arithmetic
+with exact rounding")
+ (long-description
+ "GNU MPC is a C library for the arithmetic of complex numbers with
+arbitrarily high precision and correct rounding of the result. It is built
+upon and follows the same principles as GNU MPFR.")
+ (license "LGPLv3+")
+ (home-page "http://mpc.multiprecision.org/")))
+
+(define-public ncurses
+ (let ((post-install-phase
+ '(lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ ;; When building a wide-character (Unicode) build, create backward
+ ;; compatibility links from the the "normal" libraries to the
+ ;; wide-character libraries (e.g. libncurses.so to libncursesw.so).
+ (with-directory-excursion (string-append out "/lib")
+ (for-each (lambda (lib)
+ (define libw.a
+ (string-append "lib" lib "w.a"))
+ (define lib.a
+ (string-append "lib" lib ".a"))
+ (define libw.so.x
+ (string-append "lib" lib "w.so.5"))
+ (define lib.so.x
+ (string-append "lib" lib ".so.5"))
+ (define lib.so
+ (string-append "lib" lib ".so"))
+
+ (when (file-exists? libw.a)
+ (format #t "creating symlinks for `lib~a'~%" lib)
+ (symlink libw.a lib.a)
+ (symlink libw.so.x lib.so.x)
+ (false-if-exception (delete-file lib.so))
+ (call-with-output-file lib.so
+ (lambda (p)
+ (format p "INPUT (-l~aw)~%" lib)))))
+ '("curses" "ncurses" "form" "panel" "menu")))))))
+ (package
+ (name "ncurses")
+ (version "5.9")
+ (source (origin
+ (method http-fetch)
+ (uri (string-append "http://ftp.gnu.org/gnu/ncurses/ncurses-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "0fsn7xis81za62afan0vvm38bvgzg5wfmv1m86flqcj0nj7jjilh"))))
+ (build-system gnu-build-system)
+ (arguments
+ (case-lambda
+ ((system)
+ `(#:configure-flags
+ `("--with-shared" "--without-debug" "--enable-widec"
+
+ ;; By default headers land in an `ncursesw' subdir, which is not
+ ;; what users expect.
+ ,(string-append "--includedir=" (assoc-ref %outputs "out")
+ "/include")
+
+ ;; C++ bindings fail to build on
+ ;; `i386-pc-solaris2.11' with GCC 3.4.3:
+ ;; <http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6395191>.
+ ,,@(if (string=? system "i686-solaris")
+ '("--without-cxx-binding")
+ '()))
+ #:tests? #f ; no "check" target
+ #:phases (alist-cons-after 'install 'post-install
+ ,post-install-phase
+ %standard-phases)))
+ ((system cross-system)
+ (arguments cross-system))))
+ (self-native-input? #t)
+ (description
+ "GNU Ncurses, a free software emulation of curses in SVR4 and more")
+ (long-description
+ "The Ncurses (new curses) library is a free software emulation of curses
+in System V Release 4.0, and more. It uses Terminfo format, supports pads
+and color and multiple highlights and forms characters and function-key
+mapping, and has all the other SYSV-curses enhancements over BSD Curses.
+
+The ncurses code was developed under GNU/Linux. It has been in use for some
+time with OpenBSD as the system curses library, and on FreeBSD and NetBSD as
+an external package. It should port easily to any ANSI/POSIX-conforming
+UNIX. It has even been ported to OS/2 Warp!")
+ (license "X11")
+ (home-page "http://www.gnu.org/software/ncurses/"))))
+
+(define-public readline
+ (package
+ (name "readline")
+ (version "6.2")
+ (source (origin
+ (method http-fetch)
+ (uri (string-append "http://ftp.gnu.org/gnu/readline/readline-"
+ version ".tar.gz"))
+ (sha256
+ (base32
+ "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr"))))
+ (build-system gnu-build-system)
+ (propagated-inputs `(("ncurses" ,ncurses)))
+ (inputs `(("patch/link-ncurses"
+ ,(search-path %load-path
+ "distro/readline-link-ncurses.patch"))))
+ (arguments `(#:patches (list (assoc-ref %build-inputs
+ "patch/link-ncurses"))
+ #:patch-flags '("-p0")))
+ (description "GNU Readline, a library for interactive line editing")
+ (long-description
+ "The GNU Readline library provides a set of functions for use by
+applications that allow users to edit command lines as they are typed in.
+Both Emacs and vi editing modes are available. The Readline library includes
+additional functions to maintain a list of previously-entered command lines,
+to recall and perhaps reedit those lines, and perform csh-like history
+expansion on previous commands.
+
+The history facilites are also placed into a separate library, the History
+library, as part of the build process. The History library may be used
+without Readline in applications which desire its capabilities.")
+ (license "GPLv3+")
+ (home-page "http://savannah.gnu.org/projects/readline/")))
+