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

build of pyexpat and elementtree modules
- add patch adapted from upstream (patch 7) to add support for building
    against system expat; add --with-system-expat to "configure" invocation
- remove embedded copies of expat and zlib from source tree during "prep"
This commit is contained in:
dmalcolm 2010-01-28 19:56:39 +00:00
parent 4aab458c04
commit 1ae4dd3f5e
3 changed files with 112 additions and 30 deletions

View File

@ -1,6 +1,7 @@
--- Python-3.1.1/Modules/Setup.dist.config 2009-06-04 03:30:30.000000000 -0600
+++ Python-3.1.1/Modules/Setup.dist 2009-09-25 12:14:38.000000000 -0600
@@ -141,7 +141,7 @@
diff -up Python-3.1.1/Modules/Setup.dist.config Python-3.1.1/Modules/Setup.dist
--- Python-3.1.1/Modules/Setup.dist.config 2009-06-04 05:30:30.000000000 -0400
+++ Python-3.1.1/Modules/Setup.dist 2010-01-25 23:08:55.179858352 -0500
@@ -141,7 +141,7 @@ _symtable symtablemodule.c
# modules are to be built as shared libraries (see above for more
# detail; also note that *static* reverses this effect):
@ -9,7 +10,7 @@
# GNU readline. Unlike previous Python incarnations, GNU readline is
# now incorporated in an optional module, configured in the Setup file
@@ -151,71 +151,71 @@
@@ -151,71 +151,71 @@ _symtable symtablemodule.c
# it, depending on your system -- see the GNU readline instructions.
# It's okay for this to be a shared library, too.
@ -31,11 +32,6 @@
-#_collections _collectionsmodule.c # Container types
-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
-#atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
-#_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
-#_heapq _heapqmodule.c # Heap queue algorithm
+array arraymodule.c # array objects
+cmath cmathmodule.c # -lm # complex math library functions
+math mathmodule.c # -lm # math library functions, e.g. sin()
@ -48,9 +44,12 @@
+_collections _collectionsmodule.c # Container types
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
+atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
+_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator
-#_pickle _pickle.c # pickle accelerator
+_pickle _pickle.c # pickle accelerator
+#datetime datetimemodule.c # date/time type
#datetime datetimemodule.c # date/time type
-#_bisect _bisectmodule.c # Bisection algorithms
-#_heapq _heapqmodule.c # Heap queue algorithm
+_bisect _bisectmodule.c # Bisection algorithms
+_heapq _heapqmodule.c # Heap queue algorithm
@ -114,7 +113,7 @@
# Multimedia modules -- off by default.
@@ -223,7 +223,7 @@
@@ -223,7 +223,7 @@ _symtable symtablemodule.c
# #993173 says audioop works on 64-bit platforms, though.
# These represent audio samples or images as strings:
@ -123,7 +122,7 @@
# Note that the _md5 and _sha modules are normally only built if the
@@ -238,9 +238,9 @@
@@ -238,9 +238,9 @@ _symtable symtablemodule.c
# The _sha module implements the SHA checksum algorithms.
# (NIST's Secure Hash Algorithms.)
@ -136,7 +135,7 @@
# The _tkinter module.
@@ -255,7 +255,7 @@
@@ -255,7 +255,7 @@ _symtable symtablemodule.c
# every system.
# *** Always uncomment this (leave the leading underscore in!):
@ -145,7 +144,7 @@
# *** 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:
@@ -265,7 +265,7 @@
@@ -265,7 +265,7 @@ _symtable symtablemodule.c
# *** Or uncomment this for Solaris:
# -I/usr/openwin/include \
# *** Uncomment and edit for Tix extension only:
@ -154,7 +153,7 @@
# *** 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:
@@ -274,7 +274,7 @@
@@ -274,7 +274,7 @@ _symtable symtablemodule.c
# *** Uncomment and edit for TOGL extension only:
# -DWITH_TOGL togl.c \
# *** Uncomment and edit to reflect your Tcl/Tk versions:
@ -163,7 +162,7 @@
# *** Uncomment and edit to reflect where your X11 libraries are:
# -L/usr/X11R6/lib \
# *** Or uncomment this for Solaris:
@@ -284,10 +284,10 @@
@@ -284,10 +284,10 @@ _symtable symtablemodule.c
# *** Uncomment for AIX:
# -lld \
# *** Always uncomment this; X11 libraries to link with:
@ -176,7 +175,7 @@
# Curses support, requring the System V version of curses, often
@@ -321,14 +321,14 @@
@@ -321,14 +321,14 @@ _symtable symtablemodule.c
#
# First, look at Setup.config; configure may have set this for you.
@ -194,7 +193,7 @@
# Lee Busby's SIGFPE modules.
@@ -351,7 +351,7 @@
@@ -351,7 +351,7 @@ _symtable symtablemodule.c
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
@ -203,13 +202,7 @@
# Interface to the Expat XML parser
#
@@ -364,19 +364,19 @@
#
# 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
@@ -369,14 +369,14 @@ _symtable symtablemodule.c
# Hye-Shik Chang's CJKCodecs
# multibytecodec is required for all the other CJK codec modules

View File

@ -0,0 +1,67 @@
diff -up Python-3.1.1/configure.in.expat Python-3.1.1/configure.in
--- Python-3.1.1/configure.in.expat 2010-01-25 23:02:05.488859572 -0500
+++ Python-3.1.1/configure.in 2010-01-25 23:02:21.425857866 -0500
@@ -1853,6 +1853,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-3.1.1/setup.py.expat Python-3.1.1/setup.py
--- Python-3.1.1/setup.py.expat 2010-01-25 23:02:11.254859198 -0500
+++ Python-3.1.1/setup.py 2010-01-25 23:02:21.426857993 -0500
@@ -1110,19 +1110,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
@@ -1132,7 +1139,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: Version 3 of the Python programming language aka Python 3000
Name: python3
Version: %{pybasever}.1
Release: 21%{?dist}
Release: 22%{?dist}
License: Python
Group: Development/Languages
Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
@ -79,6 +79,10 @@ Patch5: python-3.1.1-install-tkinter-tests.patch
# a libpythonMAJOR.MINOR.a (bug 550692):
Patch6: python-3.1.1-no-static-lib.patch
# Fixup configure.in and setup.py to build against system expat library.
# Adapted from http://svn.python.org/view?view=rev&revision=77170
Patch7: python-3.1.1-with-system-expat.patch
Patch102: python-3.1.1-lib64.patch
# http://bugs.python.org/issue6999 -- fixed in r75062
@ -161,12 +165,22 @@ python 3 code that uses more than just unittest and/or test_support.py.
%setup -q -n Python-%{version}
chmod +x %{SOURCE1}
# Ensure that we're using the system copy of libffi, rather than the copy
# shipped by upstream in the tarball:
# 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 ;
done
# Remove embedded copy of zlib:
rm -r Modules/zlib || exit 1
#
# Apply patches:
#
%patch0 -p1 -b .config
%patch1 -p1 -b .rpath
%patch2 -p0 -b .fix-handling-of-readonly-pyc-files
@ -174,6 +188,7 @@ done
%patch4 -p1 -b .apply-our-changes-to-expected-shebang
%patch5 -p1 -b .install-tkinter-tests
%patch6 -p1 -b .no-static-lib
%patch7 -p1 -b .expat
%if "%{_lib}" == "lib64"
%patch102 -p1 -b .lib64
@ -201,7 +216,7 @@ export CFLAGS="$CFLAGS `pkg-config --cflags openssl`"
export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
autoconf
%configure --enable-ipv6 --with-wide-unicode --enable-shared --with-system-ffi
%configure --enable-ipv6 --with-wide-unicode --enable-shared --with-system-ffi --with-system-expat
make OPT="$CFLAGS" %{?_smp_mflags}
@ -566,6 +581,13 @@ rm -fr $RPM_BUILD_ROOT
%{pylibdir}/tkinter/test
%changelog
* Thu Jan 28 2010 David Malcolm <dmalcolm@redhat.com> - 3.1.1-22
- update python-3.1.1-config.patch to remove downstream customization of build
of pyexpat and elementtree modules
- add patch adapted from upstream (patch 7) to add support for building against
system expat; add --with-system-expat to "configure" invocation
- remove embedded copies of expat and zlib from source tree during "prep"
* Mon Jan 25 2010 David Malcolm <dmalcolm@redhat.com> - 3.1.1-21
- introduce %%{dynload_dir} macro
- explicitly list all lib-dynload files, rather than dynamically gathering the