summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorCyril Roelandt <tipecaml@gmail.com>2013-04-06 00:28:39 +0200
committerCyril Roelandt <tipecaml@gmail.com>2013-04-07 15:32:39 +0200
commit4f7d8d7ee4c3a2f92cd12d7e1e2a03725f406012 (patch)
treec7e38e4be4068ccc6824ade7a87037154302f2d6 /gnu
parent0f41c26f9b9c981d5d5ecaa8c2ccda4f4c6ab147 (diff)
gnu: Python: fix the compilation of some modules from the standard library.
This commit enables the bz2, dbm, readline, ssl and zlib modules. * gnu/packages/gdbm.scm: Enable the compatibility mode. * gnu/packages/python.scm: Enable a few modules from the standard library. * gnu/packages/patches/python-fix-dbm.patch: New file. * Makefile.am: Add it.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/packages/gdbm.scm1
-rw-r--r--gnu/packages/patches/python-fix-dbm.patch20
-rw-r--r--gnu/packages/python.scm33
3 files changed, 51 insertions, 3 deletions
diff --git a/gnu/packages/gdbm.scm b/gnu/packages/gdbm.scm
index 588b732b02..76733dba65 100644
--- a/gnu/packages/gdbm.scm
+++ b/gnu/packages/gdbm.scm
@@ -34,6 +34,7 @@
(sha256
(base32
"0h9lfzdjc2yl849y0byg51h6xfjg0y7vg9jnsw3gpfwlbd617y13"))))
+ (arguments `(#:configure-flags '("--enable-libgdbm-compat")))
(build-system gnu-build-system)
(home-page "http://www.gnu.org/software/gdbm/")
(synopsis "GNU dbm key/value database library")
diff --git a/gnu/packages/patches/python-fix-dbm.patch b/gnu/packages/patches/python-fix-dbm.patch
new file mode 100644
index 0000000000..29e4521f3f
--- /dev/null
+++ b/gnu/packages/patches/python-fix-dbm.patch
@@ -0,0 +1,20 @@
+This patch allows the dbm module to be built using the compatibility mode of
+gdbm. It will not be needed any more with Python 2.7.4.
+--- setup.py 2013-04-06 00:53:37.000000000 +0200
++++ setup.py.new 2013-04-06 19:55:05.000000000 +0200
+@@ -1158,10 +1158,14 @@
+ for cand in dbm_order:
+ if cand == "ndbm":
+ if find_file("ndbm.h", inc_dirs, []) is not None:
+- # Some systems have -lndbm, others don't
++ # Some systems have -lndbm, some have -lgdbm_compat,
++ # others have no particular linker flags.
+ if self.compiler.find_library_file(lib_dirs,
+ 'ndbm'):
+ ndbm_libs = ['ndbm']
++ elif self.compiler.find_library_file(lib_dirs,
++ 'gdbm_compat'):
++ ndbm_libs = ['gdbm_compat']
+ else:
+ ndbm_libs = []
+ print "building dbm using ndbm"
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 52b11e4197..3f941642fc 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -19,7 +19,10 @@
(define-module (gnu packages python)
#:use-module ((guix licenses) #:select (psfl))
+ #:use-module (gnu packages)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages gdbm)
+ #:use-module (gnu packages readline)
#:use-module (gnu packages openssl)
#:use-module (guix packages)
#:use-module (guix download)
@@ -38,11 +41,35 @@
(base32
"11f9aw855lrmknr6c82gm1ijr3n0smc6idyp94y7774yivjnplv1"))))
(build-system gnu-build-system)
- (arguments `(#:tests? #f)) ; XXX: some tests fail
+ (arguments
+ `(#:tests? #f ; XXX: some tests fail
+ #:patches (list (assoc-ref %build-inputs "patch-dbm"))
+ #:patch-flags '("-p0")
+ #:configure-flags
+ (let ((bz2 (assoc-ref %build-inputs "bzip2"))
+ (gdbm (assoc-ref %build-inputs "gdbm"))
+ (openssl (assoc-ref %build-inputs "openssl"))
+ (readline (assoc-ref %build-inputs "readline"))
+ (zlib (assoc-ref %build-inputs "zlib")))
+ (list (string-append "CPPFLAGS="
+ "-I" bz2 "/include "
+ "-I" gdbm "/include "
+ "-I" openssl "/include "
+ "-I" readline "/include "
+ "-I" zlib "/include")
+ (string-append "LDFLAGS="
+ "-L" bz2 "/lib "
+ "-L" gdbm "/lib "
+ "-L" openssl "/lib "
+ "-L" readline "/lib "
+ "-L" zlib "/lib")))))
(inputs
- `(("zlib" ,zlib)
+ `(("bzip2" ,bzip2)
+ ("gdbm" ,gdbm)
("openssl" ,openssl)
- ("bzip2" ,bzip2)))
+ ("readline" ,readline)
+ ("zlib" ,zlib)
+ ("patch-dbm" ,(search-patch "python-fix-dbm.patch"))))
(home-page "http://python.org")
(synopsis
"Python, a high-level dynamically-typed programming language")