- update python-2.6.2-config.patch to remove downstream customization of

build of pyexpat and elementtree modules
- add patch adapted from upstream (patch 3) to add support for building
    against system expat; add --with-system-expat to "configure" invocation
- remove embedded copy of expat from source tree during "prep"
This commit is contained in:
dmalcolm 2010-01-26 21:46:40 +00:00
parent 05912b1cfa
commit 94e658aa1a
3 changed files with 108 additions and 52 deletions

View File

@ -1,7 +1,7 @@
diff -ru Python-2.6-orig Python-2.6
--- Python-2.6.2-orig/Modules/Setup.dist 2008-11-27 05:15:12.000000000 -0500
+++ Python-2.6.2/Modules/Setup.dist 2009-07-30 15:06:59.000000000 -0400
@@ -152,7 +152,7 @@
diff -up Python-2.6.2/Modules/Setup.dist.rhconfig Python-2.6.2/Modules/Setup.dist
--- Python-2.6.2/Modules/Setup.dist.rhconfig 2008-11-27 05:15:12.000000000 -0500
+++ Python-2.6.2/Modules/Setup.dist 2010-01-25 21:11:01.508867242 -0500
@@ -152,7 +152,7 @@ GLHACK=-Dclear=__GLclear
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@ -10,7 +10,7 @@ diff -ru Python-2.6-orig Python-2.6
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
@@ -162,74 +162,74 @@
@@ -162,74 +162,74 @@ GLHACK=-Dclear=__GLclear
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@ -33,10 +33,6 @@ diff -ru Python-2.6-orig Python-2.6
-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-#strop stropmodule.c # String manipulations
-#_functools _functoolsmodule.c # Tools for working with functions and callable objects
-#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
-#_pickle _pickle.c # pickle accelerator
-#datetime datetimemodule.c # date/time type
-#_bisect _bisectmodule.c # Bisection algorithms
+array arraymodule.c # array objects
+cmath cmathmodule.c # -lm # complex math library functions
+math mathmodule.c # -lm # math library functions, e.g. sin()
@ -50,9 +46,10 @@ diff -ru Python-2.6-orig Python-2.6
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+strop stropmodule.c # String manipulations
+_functools _functoolsmodule.c # Tools for working with functions and callable objects
+_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
+#_pickle _pickle.c # pickle accelerator
+#datetime datetimemodule.c # date/time type
#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
#_pickle _pickle.c # pickle accelerator
#datetime datetimemodule.c # date/time type
-#_bisect _bisectmodule.c # Bisection algorithms
+_bisect _bisectmodule.c # Bisection algorithms
-#unicodedata unicodedata.c # static Unicode character database
@ -119,7 +116,7 @@ diff -ru Python-2.6-orig Python-2.6
# Multimedia modules -- off by default.
@@ -237,8 +237,8 @@
@@ -237,8 +237,8 @@ GLHACK=-Dclear=__GLclear
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@ -130,7 +127,7 @@ diff -ru Python-2.6-orig Python-2.6
# Note that the _md5 and _sha modules are normally only built if the
@@ -248,14 +248,14 @@
@@ -248,14 +248,14 @@ GLHACK=-Dclear=__GLclear
# Message-Digest Algorithm, described in RFC 1321. The necessary files
# md5.c and md5.h are included here.
@ -149,7 +146,7 @@ diff -ru Python-2.6-orig Python-2.6
# SGI IRIX specific modules -- off by default.
@@ -302,12 +302,12 @@
@@ -302,12 +302,12 @@ GLHACK=-Dclear=__GLclear
# A Linux specific module -- off by default; this may also work on
# some *BSDs.
@ -164,7 +161,7 @@ diff -ru Python-2.6-orig Python-2.6
# The _tkinter module.
@@ -322,7 +322,7 @@
@@ -322,7 +322,7 @@ GLHACK=-Dclear=__GLclear
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@ -173,7 +170,7 @@ diff -ru Python-2.6-orig Python-2.6
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
# -L/usr/local/lib \
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
@@ -332,7 +332,7 @@
@@ -332,7 +332,7 @@ GLHACK=-Dclear=__GLclear
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@ -182,7 +179,7 @@ diff -ru Python-2.6-orig Python-2.6
# *** Uncomment and edit for BLT extension only:
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
# *** Uncomment and edit for PIL (TkImaging) extension only:
@@ -341,7 +341,7 @@
@@ -341,7 +341,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@ -191,7 +188,7 @@ diff -ru Python-2.6-orig Python-2.6
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
@@ -351,7 +351,7 @@
@@ -351,7 +351,7 @@ GLHACK=-Dclear=__GLclear
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@ -200,7 +197,7 @@ diff -ru Python-2.6-orig Python-2.6
# Lance Ellinghaus's syslog module
#syslog syslogmodule.c # syslog daemon interface
@@ -373,7 +373,7 @@
@@ -373,7 +373,7 @@ GLHACK=-Dclear=__GLclear
# it is a highly experimental and dangerous device for calling
# *arbitrary* C functions in *arbitrary* shared libraries:
@ -209,7 +206,7 @@ diff -ru Python-2.6-orig Python-2.6
# Modules that provide persistent dictionary-like semantics. You will
@@ -396,7 +396,7 @@
@@ -396,7 +396,7 @@ GLHACK=-Dclear=__GLclear
#
# First, look at Setup.config; configure may have set this for you.
@ -218,7 +215,8 @@ diff -ru Python-2.6-orig Python-2.6
# Sleepycat Berkeley DB interface.
@@ -412,10 +412,9 @@
@@ -411,11 +411,10 @@ GLHACK=-Dclear=__GLclear
#
# Edit the variables DB and DBLIBVERto point to the db top directory
# and the subdirectory of PORT where you built it.
-#DB=/usr/local/BerkeleyDB.4.0
@ -233,7 +231,7 @@ diff -ru Python-2.6-orig Python-2.6
# Historical Berkeley DB 1.85
#
@@ -430,14 +429,14 @@
@@ -430,14 +429,14 @@ GLHACK=-Dclear=__GLclear
# Helper module for various ascii-encoders
@ -252,7 +250,7 @@ diff -ru Python-2.6-orig Python-2.6
# Lee Busby's SIGFPE modules.
@@ -460,7 +459,7 @@
@@ -460,7 +459,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
@ -261,14 +259,7 @@ diff -ru Python-2.6-orig Python-2.6
# Interface to the Expat XML parser
#
@@ -473,20 +472,20 @@
#
# More information on Expat can be found at www.libexpat.org.
#
-#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
+pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI
@@ -479,14 +478,14 @@ GLHACK=-Dclear=__GLclear
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules
@ -290,22 +281,3 @@ diff -ru Python-2.6-orig Python-2.6
# Example -- included for reference only:
# xx xxmodule.c
--- Python-2.6.2-orig/setup.py 2009-07-30 14:56:58.000000000 -0400
+++ Python-2.6.2/setup.py 2009-07-30 15:07:39.000000000 -0400
@@ -1203,7 +1203,6 @@
exts.append(Extension('pyexpat',
define_macros = define_macros,
- include_dirs = [expatinc],
sources = ['pyexpat.c',
'expat/xmlparse.c',
'expat/xmlrole.c',
@@ -1218,7 +1217,6 @@
define_macros.append(('USE_PYEXPAT_CAPI', None))
exts.append(Extension('_elementtree',
define_macros = define_macros,
- include_dirs = [expatinc],
sources = ['_elementtree.c'],
))
else:
Only in Python-2.6.2: setup.py~

View File

@ -0,0 +1,67 @@
diff -up Python-2.6.2/configure.in.expat Python-2.6.2/configure.in
--- Python-2.6.2/configure.in.expat 2010-01-25 21:46:42.700858981 -0500
+++ Python-2.6.2/configure.in 2010-01-25 21:46:54.710857387 -0500
@@ -1898,6 +1898,13 @@ LIBS="$withval $LIBS"
],
[AC_MSG_RESULT(no)])
+# Check for use of the system expat library
+AC_MSG_CHECKING(for --with-system-expat)
+AC_ARG_WITH(system_expat,
+ AC_HELP_STRING(--with-system-expat, build pyexpat module using an installed expat library))
+
+AC_MSG_RESULT($with_system_expat)
+
# Check for use of the system libffi library
AC_MSG_CHECKING(for --with-system-ffi)
AC_ARG_WITH(system_ffi,
diff -up Python-2.6.2/setup.py.expat Python-2.6.2/setup.py
--- Python-2.6.2/setup.py.expat 2010-01-25 21:46:48.490911125 -0500
+++ Python-2.6.2/setup.py 2010-01-25 21:46:54.711857933 -0500
@@ -1196,19 +1196,26 @@ class PyBuildExt(build_ext):
#
# More information on Expat can be found at www.libexpat.org.
#
- expatinc = os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')
- define_macros = [
- ('HAVE_EXPAT_CONFIG_H', '1'),
- ]
+ if '--with-system-expat' in sysconfig.get_config_var("CONFIG_ARGS"):
+ expat_inc = []
+ define_macros = []
+ expat_lib = ['expat']
+ expat_sources = []
+ else:
+ expat_inc = [os.path.join(os.getcwd(), srcdir, 'Modules', 'expat')]
+ define_macros = [
+ ('HAVE_EXPAT_CONFIG_H', '1'),
+ ]
+ expat_lib = []
+ expat_sources = ['expat/xmlparse.c',
+ 'expat/xmlrole.c',
+ 'expat/xmltok.c']
exts.append(Extension('pyexpat',
define_macros = define_macros,
- include_dirs = [expatinc],
- sources = ['pyexpat.c',
- 'expat/xmlparse.c',
- 'expat/xmlrole.c',
- 'expat/xmltok.c',
- ],
+ include_dirs = expat_inc,
+ libraries = expat_lib,
+ sources = ['pyexpat.c'] + expat_sources
))
# Fredrik Lundh's cElementTree module. Note that this also
@@ -1218,7 +1225,8 @@ class PyBuildExt(build_ext):
define_macros.append(('USE_PYEXPAT_CAPI', None))
exts.append(Extension('_elementtree',
define_macros = define_macros,
- include_dirs = [expatinc],
+ include_dirs = expat_inc,
+ libraries = expat_lib,
sources = ['_elementtree.c'],
))
else:

View File

@ -25,7 +25,7 @@
Summary: An interpreted, interactive, object-oriented programming language
Name: %{python}
Version: 2.6.4
Release: 10%{?dist}
Release: 11%{?dist}
License: Python
Group: Development/Languages
Provides: python-abi = %{pybasever}
@ -35,6 +35,11 @@ Source: http://www.python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
Patch0: python-2.6.2-config.patch
Patch1: Python-2.2.1-pydocnogui.patch
#Patch2: python-2.3.4-pydocnodoc.patch
# Fixup configure.in and setup.py to build against system expat library.
# Adapted from http://svn.python.org/view?view=rev&revision=77169
Patch3: python-2.6.2-with-system-expat.patch
Patch4: python-2.5-cflags.patch
#Patch5: python-2.5.1-ctypes-exec-stack.patch
Patch6: python-2.5.1-plural-fix.patch
@ -221,6 +226,9 @@ code that uses more than just unittest and/or test_support.py.
# Ensure that we're using the system copy of various libraries, rather than
# copies shipped by upstream in the tarball:
# Remove embedded copy of expat:
rm -r Modules/expat || exit 1
# Remove embedded copy of libffi:
for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
@ -233,6 +241,7 @@ rm -r Modules/zlib || exit 1
# Apply patches:
#
%patch0 -p1 -b .rhconfig
%patch3 -p1 -b .expat
%patch1 -p1 -b .no_gui
#%%patch2 -p1 -b .no-doc
%patch4 -p1 -b .cflags
@ -299,6 +308,7 @@ autoconf
--enable-unicode=%{unicode} \
--enable-shared \
--with-system-ffi \
--with-system-expat \
--with-valgrind
make OPT="$CFLAGS" %{?_smp_mflags}
@ -656,6 +666,13 @@ rm -fr $RPM_BUILD_ROOT
%{dynload_dir}/_testcapimodule.so
%changelog
* Mon Jan 25 2010 David Malcolm <dmalcolm@redhat.com> - 2.6.4-11
- update python-2.6.2-config.patch to remove downstream customization of build
of pyexpat and elementtree modules
- add patch adapted from upstream (patch 3) to add support for building against
system expat; add --with-system-expat to "configure" invocation
- remove embedded copy of expat from source tree during "prep"
* Mon Jan 25 2010 David Malcolm <dmalcolm@redhat.com> - 2.6.4-10
- introduce macros for 3 directories, replacing expanded references throughout:
%%{pylibdir}, %%{dynload_dir}, %%{site_packages}