- 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:
parent
4aab458c04
commit
1ae4dd3f5e
@ -1,6 +1,7 @@
|
|||||||
--- Python-3.1.1/Modules/Setup.dist.config 2009-06-04 03:30:30.000000000 -0600
|
diff -up Python-3.1.1/Modules/Setup.dist.config Python-3.1.1/Modules/Setup.dist
|
||||||
+++ Python-3.1.1/Modules/Setup.dist 2009-09-25 12:14:38.000000000 -0600
|
--- Python-3.1.1/Modules/Setup.dist.config 2009-06-04 05:30:30.000000000 -0400
|
||||||
@@ -141,7 +141,7 @@
|
+++ 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
|
# modules are to be built as shared libraries (see above for more
|
||||||
# detail; also note that *static* reverses this effect):
|
# detail; also note that *static* reverses this effect):
|
||||||
|
|
||||||
@ -9,7 +10,7 @@
|
|||||||
|
|
||||||
# GNU readline. Unlike previous Python incarnations, GNU readline is
|
# GNU readline. Unlike previous Python incarnations, GNU readline is
|
||||||
# now incorporated in an optional module, configured in the Setup file
|
# 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, depending on your system -- see the GNU readline instructions.
|
||||||
# It's okay for this to be a shared library, too.
|
# It's okay for this to be a shared library, too.
|
||||||
|
|
||||||
@ -31,11 +32,6 @@
|
|||||||
-#_collections _collectionsmodule.c # Container types
|
-#_collections _collectionsmodule.c # Container types
|
||||||
-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
|
-#itertools itertoolsmodule.c # Functions creating iterators for efficient looping
|
||||||
-#atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
|
-#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
|
+array arraymodule.c # array objects
|
||||||
+cmath cmathmodule.c # -lm # complex math library functions
|
+cmath cmathmodule.c # -lm # complex math library functions
|
||||||
+math mathmodule.c # -lm # math library functions, e.g. sin()
|
+math mathmodule.c # -lm # math library functions, e.g. sin()
|
||||||
@ -48,9 +44,12 @@
|
|||||||
+_collections _collectionsmodule.c # Container types
|
+_collections _collectionsmodule.c # Container types
|
||||||
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
|
+itertools itertoolsmodule.c # Functions creating iterators for efficient looping
|
||||||
+atexit atexitmodule.c # Register functions to be run at interpreter-shutdown
|
+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
|
+_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
|
+_bisect _bisectmodule.c # Bisection algorithms
|
||||||
+_heapq _heapqmodule.c # Heap queue algorithm
|
+_heapq _heapqmodule.c # Heap queue algorithm
|
||||||
|
|
||||||
@ -114,7 +113,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# Multimedia modules -- off by default.
|
# 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.
|
# #993173 says audioop works on 64-bit platforms, though.
|
||||||
# These represent audio samples or images as strings:
|
# 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
|
# 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.
|
# The _sha module implements the SHA checksum algorithms.
|
||||||
# (NIST's Secure Hash Algorithms.)
|
# (NIST's Secure Hash Algorithms.)
|
||||||
@ -136,7 +135,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# The _tkinter module.
|
# The _tkinter module.
|
||||||
@@ -255,7 +255,7 @@
|
@@ -255,7 +255,7 @@ _symtable symtablemodule.c
|
||||||
# every system.
|
# every system.
|
||||||
|
|
||||||
# *** Always uncomment this (leave the leading underscore in!):
|
# *** Always uncomment this (leave the leading underscore in!):
|
||||||
@ -145,7 +144,7 @@
|
|||||||
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
|
# *** Uncomment and edit to reflect where your Tcl/Tk libraries are:
|
||||||
# -L/usr/local/lib \
|
# -L/usr/local/lib \
|
||||||
# *** Uncomment and edit to reflect where your Tcl/Tk headers are:
|
# *** 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:
|
# *** Or uncomment this for Solaris:
|
||||||
# -I/usr/openwin/include \
|
# -I/usr/openwin/include \
|
||||||
# *** Uncomment and edit for Tix extension only:
|
# *** Uncomment and edit for Tix extension only:
|
||||||
@ -154,7 +153,7 @@
|
|||||||
# *** Uncomment and edit for BLT extension only:
|
# *** Uncomment and edit for BLT extension only:
|
||||||
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
|
# -DWITH_BLT -I/usr/local/blt/blt8.0-unoff/include -lBLT8.0 \
|
||||||
# *** Uncomment and edit for PIL (TkImaging) extension only:
|
# *** 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:
|
# *** Uncomment and edit for TOGL extension only:
|
||||||
# -DWITH_TOGL togl.c \
|
# -DWITH_TOGL togl.c \
|
||||||
# *** Uncomment and edit to reflect your Tcl/Tk versions:
|
# *** Uncomment and edit to reflect your Tcl/Tk versions:
|
||||||
@ -163,7 +162,7 @@
|
|||||||
# *** Uncomment and edit to reflect where your X11 libraries are:
|
# *** Uncomment and edit to reflect where your X11 libraries are:
|
||||||
# -L/usr/X11R6/lib \
|
# -L/usr/X11R6/lib \
|
||||||
# *** Or uncomment this for Solaris:
|
# *** Or uncomment this for Solaris:
|
||||||
@@ -284,10 +284,10 @@
|
@@ -284,10 +284,10 @@ _symtable symtablemodule.c
|
||||||
# *** Uncomment for AIX:
|
# *** Uncomment for AIX:
|
||||||
# -lld \
|
# -lld \
|
||||||
# *** Always uncomment this; X11 libraries to link with:
|
# *** Always uncomment this; X11 libraries to link with:
|
||||||
@ -176,7 +175,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# Curses support, requring the System V version of curses, often
|
# 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.
|
# First, look at Setup.config; configure may have set this for you.
|
||||||
|
|
||||||
@ -194,7 +193,7 @@
|
|||||||
|
|
||||||
|
|
||||||
# Lee Busby's SIGFPE modules.
|
# Lee Busby's SIGFPE modules.
|
||||||
@@ -351,7 +351,7 @@
|
@@ -351,7 +351,7 @@ _symtable symtablemodule.c
|
||||||
# Andrew Kuchling's zlib module.
|
# Andrew Kuchling's zlib module.
|
||||||
# This require zlib 1.1.3 (or later).
|
# This require zlib 1.1.3 (or later).
|
||||||
# See http://www.gzip.org/zlib/
|
# See http://www.gzip.org/zlib/
|
||||||
@ -203,13 +202,7 @@
|
|||||||
|
|
||||||
# Interface to the Expat XML parser
|
# Interface to the Expat XML parser
|
||||||
#
|
#
|
||||||
@@ -364,19 +364,19 @@
|
@@ -369,14 +369,14 @@ _symtable symtablemodule.c
|
||||||
#
|
|
||||||
# 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
|
|
||||||
|
|
||||||
# Hye-Shik Chang's CJKCodecs
|
# Hye-Shik Chang's CJKCodecs
|
||||||
|
|
||||||
# multibytecodec is required for all the other CJK codec modules
|
# multibytecodec is required for all the other CJK codec modules
|
||||||
|
67
python-3.1.1-with-system-expat.patch
Normal file
67
python-3.1.1-with-system-expat.patch
Normal 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:
|
30
python3.spec
30
python3.spec
@ -25,7 +25,7 @@
|
|||||||
Summary: Version 3 of the Python programming language aka Python 3000
|
Summary: Version 3 of the Python programming language aka Python 3000
|
||||||
Name: python3
|
Name: python3
|
||||||
Version: %{pybasever}.1
|
Version: %{pybasever}.1
|
||||||
Release: 21%{?dist}
|
Release: 22%{?dist}
|
||||||
License: Python
|
License: Python
|
||||||
Group: Development/Languages
|
Group: Development/Languages
|
||||||
Source: http://python.org/ftp/python/%{version}/Python-%{version}.tar.bz2
|
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):
|
# a libpythonMAJOR.MINOR.a (bug 550692):
|
||||||
Patch6: python-3.1.1-no-static-lib.patch
|
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
|
Patch102: python-3.1.1-lib64.patch
|
||||||
|
|
||||||
# http://bugs.python.org/issue6999 -- fixed in r75062
|
# 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}
|
%setup -q -n Python-%{version}
|
||||||
chmod +x %{SOURCE1}
|
chmod +x %{SOURCE1}
|
||||||
|
|
||||||
# Ensure that we're using the system copy of libffi, rather than the copy
|
# Ensure that we're using the system copy of various libraries, rather than
|
||||||
# shipped by upstream in the tarball:
|
# 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
|
for SUBDIR in darwin libffi libffi_arm_wince libffi_msvc libffi_osx ; do
|
||||||
rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
|
rm -r Modules/_ctypes/$SUBDIR || exit 1 ;
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Remove embedded copy of zlib:
|
||||||
|
rm -r Modules/zlib || exit 1
|
||||||
|
|
||||||
|
#
|
||||||
|
# Apply patches:
|
||||||
|
#
|
||||||
%patch0 -p1 -b .config
|
%patch0 -p1 -b .config
|
||||||
%patch1 -p1 -b .rpath
|
%patch1 -p1 -b .rpath
|
||||||
%patch2 -p0 -b .fix-handling-of-readonly-pyc-files
|
%patch2 -p0 -b .fix-handling-of-readonly-pyc-files
|
||||||
@ -174,6 +188,7 @@ done
|
|||||||
%patch4 -p1 -b .apply-our-changes-to-expected-shebang
|
%patch4 -p1 -b .apply-our-changes-to-expected-shebang
|
||||||
%patch5 -p1 -b .install-tkinter-tests
|
%patch5 -p1 -b .install-tkinter-tests
|
||||||
%patch6 -p1 -b .no-static-lib
|
%patch6 -p1 -b .no-static-lib
|
||||||
|
%patch7 -p1 -b .expat
|
||||||
|
|
||||||
%if "%{_lib}" == "lib64"
|
%if "%{_lib}" == "lib64"
|
||||||
%patch102 -p1 -b .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`"
|
export LDFLAGS="$LDFLAGS `pkg-config --libs-only-L openssl`"
|
||||||
|
|
||||||
autoconf
|
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}
|
make OPT="$CFLAGS" %{?_smp_mflags}
|
||||||
|
|
||||||
@ -566,6 +581,13 @@ rm -fr $RPM_BUILD_ROOT
|
|||||||
%{pylibdir}/tkinter/test
|
%{pylibdir}/tkinter/test
|
||||||
|
|
||||||
%changelog
|
%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
|
* Mon Jan 25 2010 David Malcolm <dmalcolm@redhat.com> - 3.1.1-21
|
||||||
- introduce %%{dynload_dir} macro
|
- introduce %%{dynload_dir} macro
|
||||||
- explicitly list all lib-dynload files, rather than dynamically gathering the
|
- explicitly list all lib-dynload files, rather than dynamically gathering the
|
||||||
|
Loading…
Reference in New Issue
Block a user