From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Roelandt Subject: =?UTF-8?q?=5BPATCH=5D=20gnu=3A=20Python=3A=20enable=20the=20dbm=20module=2E?= Date: Sat, 6 Apr 2013 20:48:31 +0200 Message-ID: <1365274111-3589-1-git-send-email-tipecaml@gmail.com> References: <87zjxb4uoi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:35002) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOYLY-00031w-PS for bug-guix@gnu.org; Sat, 06 Apr 2013 15:00:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UOYLR-00007x-Fx for bug-guix@gnu.org; Sat, 06 Apr 2013 15:00:16 -0400 Received: from mail-we0-x233.google.com ([2a00:1450:400c:c03::233]:44879) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UOYLR-00007Y-5y for bug-guix@gnu.org; Sat, 06 Apr 2013 15:00:09 -0400 Received: by mail-we0-f179.google.com with SMTP id p43so3681287wea.10 for ; Sat, 06 Apr 2013 12:00:08 -0700 (PDT) In-Reply-To: <87zjxb4uoi.fsf@gnu.org> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: bug-guix@gnu.org * gnu/packages/gdbm.scm: Enable the compatibility mode. * gnu/packages/python.scm: Enable the dbm module. * gnu/packages/patches/python-fix-dbm.patch: New file. * Makefile.am: Add it. --- Hello! On 04/06/2013 04:09 PM, Ludovic Courtès wrote: > We also have bdb, so we can use it if that’s what is expected. Well, I managed to do this with the compatibility mode of gdbm. Maybe this patch should be merged with the previous one. I think I'll submit it to Python. Cyril. Makefile.am | 1 + gnu/packages/gdbm.scm | 1 + gnu/packages/patches/python-fix-dbm.patch | 18 ++++++++++++++++++ gnu/packages/python.scm | 11 ++++++++++- 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/python-fix-dbm.patch diff --git a/Makefile.am b/Makefile.am index 136c01b..91de488 100644 --- a/Makefile.am +++ b/Makefile.am @@ -229,6 +229,7 @@ dist_patch_DATA = \ gnu/packages/patches/make-impure-dirs.patch \ gnu/packages/patches/mcron-install.patch \ gnu/packages/patches/perl-no-sys-dirs.patch \ + gnu/packages/patches/python-fix-dbm.patch \ gnu/packages/patches/procps-make-3.82.patch \ gnu/packages/patches/qemu-multiple-smb-shares.patch \ gnu/packages/patches/readline-link-ncurses.patch \ diff --git a/gnu/packages/gdbm.scm b/gnu/packages/gdbm.scm index 588b732..76733db 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 0000000..21e633d --- /dev/null +++ b/gnu/packages/patches/python-fix-dbm.patch @@ -0,0 +1,18 @@ +--- 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 c62b8c0..3f94164 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -19,7 +19,9 @@ (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) @@ -41,26 +43,33 @@ (build-system gnu-build-system) (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 `(("bzip2" ,bzip2) + ("gdbm" ,gdbm) ("openssl" ,openssl) ("readline" ,readline) - ("zlib" ,zlib))) + ("zlib" ,zlib) + ("patch-dbm" ,(search-patch "python-fix-dbm.patch")))) (home-page "http://python.org") (synopsis "Python, a high-level dynamically-typed programming language") -- 1.7.10.4