gnu: pari-gp: Update to 2.5.4.
[jackhill/guix/guix.git] / gnu / packages / python.scm
CommitLineData
a01b6da7
NK
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
3;;; Copyright © 2013 Ludovic Courtès <ludo@gnu.org>
af807dea 4;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
a01b6da7
NK
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
9;;; under the terms of the GNU General Public License as published by
10;;; the Free Software Foundation; either version 3 of the License, or (at
11;;; your option) any later version.
12;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
14;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;;; GNU General Public License for more details.
17;;;
18;;; You should have received a copy of the GNU General Public License
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
1ffa7090 21(define-module (gnu packages python)
5ace6e2f 22 #:use-module ((guix licenses) #:select (bsd-3 psfl x11))
3fdc99da 23 #:use-module (gnu packages)
1ffa7090 24 #:use-module (gnu packages compression)
3fdc99da
CR
25 #:use-module (gnu packages gdbm)
26 #:use-module (gnu packages readline)
1ffa7090 27 #:use-module (gnu packages openssl)
fd982732 28 #:use-module (gnu packages patchelf)
a01b6da7
NK
29 #:use-module (guix packages)
30 #:use-module (guix download)
acc26ff1
CR
31 #:use-module (guix build-system gnu)
32 #:use-module (guix build-system python))
a01b6da7
NK
33
34(define-public python
35 (package
36 (name "python")
af807dea 37 (version "2.7.5")
a01b6da7
NK
38 (source
39 (origin
40 (method url-fetch)
41 (uri (string-append "http://www.python.org/ftp/python/"
42 version "/Python-" version ".tar.xz"))
43 (sha256
44 (base32
af807dea 45 "1c8xan2dlsqfq8q82r3mhl72v3knq3qyn71fjq89xikx2smlqg7k"))))
a01b6da7 46 (build-system gnu-build-system)
3fdc99da 47 (arguments
af807dea
AE
48 `(#:tests? #f
49;; 258 tests OK.
50;; 103 tests failed:
51;; test_bz2 test_distutils test_file test_file2k test_popen2
52;; test_shutil test_signal test_site test_slice test_smtplib
53;; test_smtpnet test_socket test_socketserver test_softspace
54;; test_sort test_sqlite test_ssl test_startfile test_str
55;; test_strftime test_string test_stringprep test_strop test_strptime
56;; test_strtod test_struct test_structmembers test_structseq
57;; test_subprocess test_sunaudiodev test_sundry test_symtable
58;; test_syntax test_sys test_sys_setprofile test_sys_settrace
59;; test_sysconfig test_tarfile test_tcl test_telnetlib test_tempfile
60;; test_textwrap test_thread test_threaded_import
61;; test_threadedtempfile test_threading test_threading_local
62;; test_threadsignals test_time test_timeout test_tk test_tokenize
63;; test_tools test_trace test_traceback test_transformer
64;; test_ttk_guionly test_ttk_textonly test_tuple test_typechecks
65;; test_ucn test_unary test_undocumented_details test_unicode
66;; test_unicode_file test_unicodedata test_univnewlines
67;; test_univnewlines2k test_unpack test_urllib test_urllib2
68;; test_urllib2_localnet test_urllib2net test_urllibnet test_urlparse
69;; test_userdict test_userlist test_userstring test_uu test_uuid
70;; test_wait3 test_wait4 test_warnings test_wave test_weakref
71;; test_weakset test_whichdb test_winreg test_winsound test_with
72;; test_wsgiref test_xdrlib test_xml_etree test_xml_etree_c
73;; test_xmllib test_xmlrpc test_xpickle test_xrange test_zipfile
74;; test_zipfile64 test_zipimport test_zipimport_support test_zlib
75;; 31 tests skipped:
76;; test_aepack test_al test_applesingle test_ascii_formatd test_bsddb
77;; test_bsddb185 test_bsddb3 test_cd test_cl test_codecmaps_cn
78;; test_codecmaps_hk test_codecmaps_jp test_codecmaps_kr
79;; test_codecmaps_tw test_ctypes test_curses test_dl test_gdb test_gl
80;; test_imageop test_imgfile test_ioctl test_kqueue
81;; test_linuxaudiodev test_macos test_macostools test_msilib
82;; test_multiprocessing test_ossaudiodev test_pep277
83;; test_scriptpackages
84;; 7 skips unexpected on linux2:
85;; test_ascii_formatd test_bsddb test_bsddb3 test_ctypes test_gdb
86;; test_ioctl test_multiprocessing
87;; One of the typical errors:
88;; test_unicode
89;; test test_unicode crashed -- <type 'exceptions.OSError'>: [Errno 2] No such file or directory
90 #:test-target "test"
3fdc99da
CR
91 #:configure-flags
92 (let ((bz2 (assoc-ref %build-inputs "bzip2"))
93 (gdbm (assoc-ref %build-inputs "gdbm"))
94 (openssl (assoc-ref %build-inputs "openssl"))
95 (readline (assoc-ref %build-inputs "readline"))
96 (zlib (assoc-ref %build-inputs "zlib")))
fd982732
LC
97 (list "--enable-shared" ; allow embedding
98 (string-append "CPPFLAGS="
3fdc99da
CR
99 "-I" bz2 "/include "
100 "-I" gdbm "/include "
101 "-I" openssl "/include "
102 "-I" readline "/include "
103 "-I" zlib "/include")
104 (string-append "LDFLAGS="
105 "-L" bz2 "/lib "
106 "-L" gdbm "/lib "
107 "-L" openssl "/lib "
108 "-L" readline "/lib "
fd982732
LC
109 "-L" zlib "/lib")))
110
111 #:modules ((guix build gnu-build-system)
112 (guix build utils)
3309e3a1 113 (guix build rpath)
fd982732 114 (srfi srfi-26))
3309e3a1
LC
115 #:imported-modules ((guix build gnu-build-system)
116 (guix build utils)
117 (guix build rpath))
fd982732
LC
118
119 #:phases
120 (alist-cons-after
121 'strip 'add-lib-to-runpath
122 (lambda* (#:key outputs #:allow-other-keys)
fd982732
LC
123 (let* ((out (assoc-ref outputs "out"))
124 (lib (string-append out "/lib")))
125 ;; Add LIB to the RUNPATH of all the executables.
126 (with-directory-excursion out
127 (for-each (cut augment-rpath <> lib)
128 (find-files "bin" ".*")))))
129 %standard-phases)))
a01b6da7 130 (inputs
3fdc99da
CR
131 `(("bzip2" ,bzip2)
132 ("gdbm" ,gdbm)
a01b6da7 133 ("openssl" ,openssl)
3fdc99da 134 ("readline" ,readline)
fd982732 135 ("zlib" ,zlib)
3309e3a1 136 ("patchelf" ,patchelf))) ; for (guix build rpath)
9be8d7c8
LC
137 (native-search-paths
138 (list (search-path-specification
139 (variable "PYTHONPATH")
140 (directories '("lib/python2.7/site-packages")))))
a01b6da7
NK
141 (home-page "http://python.org")
142 (synopsis
143 "Python, a high-level dynamically-typed programming language")
144 (description
145 "Python is a remarkably powerful dynamic programming language that
146is used in a wide variety of application domains. Some of its key
147distinguishing features include: clear, readable syntax; strong
148introspection capabilities; intuitive object orientation; natural
149expression of procedural code; full modularity, supporting hierarchical
150packages; exception-based error handling; and very high level dynamic
151data types.")
152 (license psfl)))
acc26ff1
CR
153
154(define-public pytz
155 (package
156 (name "pytz")
157 (version "2013b")
158 (source
159 (origin
160 (method url-fetch)
161 (uri (string-append "https://launchpad.net/pytz/main/" version
162 "/+download/pytz-" version ".tar.bz2"))
163 (sha256
164 (base32
165 "19giwgfcrg0nr1gdv49qnmf2jb2ilkcfc7qyqvfpz4dp0p64ksv5"))))
166 (build-system python-build-system)
167 (home-page "https://launchpad.net/pytz")
168 (synopsis "The Python timezone library.")
169 (description
170 "This library allows accurate and cross platform timezone calculations
171using Python 2.4 or higher and provides access to the Olson timezone database.")
172 (license x11)))
5ace6e2f
CR
173
174(define-public babel
175 (package
176 (name "babel")
177 (version "0.9.6")
178 (source
179 (origin
180 (method url-fetch)
181 (uri (string-append "http://ftp.edgewall.com/pub/babel/Babel-"
182 version ".tar.gz"))
183 (sha256
184 (base32
185 "03vmr54jq5vf3qw6kpdv7cdk7x7i2jhzyf1mawv2gk8zrxg0hfja"))))
186 (build-system python-build-system)
187 (inputs
188 `(("pytz" ,pytz)))
189 (home-page "http://babel.edgewall.org/")
190 (synopsis
191 "Tools for internationalizing Python applications")
192 (description
193 "Babel is composed of two major parts:
194- tools to build and work with gettext message catalogs
195- a Python interface to the CLDR (Common Locale Data Repository), providing
196access to various locale display names, localized number and date formatting,
197etc. ")
198 (license bsd-3)))