From d239eff59def00cb42b6c223c3a2d43bc85d0bf3 Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Tue, 17 Jun 2008 23:03:36 +0300 Subject: [PATCH] [python] Improved to be able to build without gdbm, readline or zlib --- python/python/python-setup.patch | 28 +--------------------------- python/python/python.conf | 15 ++++++++++++++- 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/python/python/python-setup.patch b/python/python/python-setup.patch index 847035688..a6c3820fa 100644 --- a/python/python/python-setup.patch +++ b/python/python/python-setup.patch @@ -2,6 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../python/python-setup.patch +# Copyright (C) 2008 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # # More information can be found in the files COPYING and README. @@ -24,15 +25,6 @@ # GNU readline. Unlike previous Python incarnations, GNU readline is # now incorporated in an optional module, configured in the Setup file -@@ -157,7 +157,7 @@ - # it, depending on your system -- see the GNU readline instructions. - # It's okay for this to be a shared library, too. - --#readline readline.c -lreadline -ltermcap -+readline readline.c -lreadline -ltermcap - - - # Modules that should always be present (non UNIX dependent): @@ -201,25 +201,25 @@ # Socket module helper for SSL support; you must comment out the other @@ -75,21 +67,3 @@ # Curses support, requring the System V version of curses, often -@@ -382,7 +382,7 @@ - # - # First, look at Setup.config; configure may have set this for you. - --#gdbm gdbmmodule.c -I/usr/local/include -L/usr/local/lib -lgdbm -+gdbm gdbmmodule.c -I/usr/include -L/usr/lib -lgdbm - - - # Sleepycat Berkeley DB interface. -@@ -446,7 +446,7 @@ - # Andrew Kuchling's zlib module. - # This require zlib 1.1.3 (or later). - # See http://www.gzip.org/zlib/ --#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz -+zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz - - # Interface to the Expat XML parser - # diff --git a/python/python/python.conf b/python/python/python.conf index b81bfe99f..e09a3e8dd 100644 --- a/python/python/python.conf +++ b/python/python/python.conf @@ -2,7 +2,7 @@ # This copyright note is auto-generated by ./scripts/Create-CopyPatch. # # Filename: package/.../python/python.conf -# Copyright (C) 2007 The OpenSDE Project +# Copyright (C) 2007 - 2008 The OpenSDE Project # Copyright (C) 2004 - 2006 The T2 SDE Project # Copyright (C) 1998 - 2004 Clifford Wolf # @@ -22,6 +22,17 @@ export PYTHON="$root/$prefix/bin/python" EOT } +python_preconf() +{ + local x= + + for x in gdbm readline zlib; do + # enable if present + if pkginstalled $x; then + sed -i -e "s/^#\($x\)/\1/" Modules/Setup.dist + fi + done +} runpysetup=0 var_append confopt " " "--enable-shared --with-threads" @@ -30,6 +41,7 @@ var_append confopt " " "--enable-shared --with-threads" var_append flistrfilter "|" ".*: /usr/lib.*/python.*/site-packages/.*" hook_add postmake 5 "python_postmake" +hook_add preconf 5 "python_preconf" # hardcoded path idocy fix_python_for_64bit() { @@ -38,3 +50,4 @@ fix_python_for_64bit() { [[ $libdir = *lib64 ]] && hook_add preconf 9 "fix_python_for_64bit" +