Python: update to Python-2.7.8

This commit is contained in:
Stefan Saraev 2014-11-24 17:01:55 +02:00 committed by Stephan Raue
parent 26231ed4df
commit 81c08d1519
18 changed files with 230 additions and 379 deletions

View File

@ -17,14 +17,14 @@
################################################################################ ################################################################################
PKG_NAME="Python" PKG_NAME="Python"
PKG_VERSION="2.7.3" PKG_VERSION="2.7.8"
PKG_REV="1" PKG_REV="1"
PKG_ARCH="any" PKG_ARCH="any"
PKG_LICENSE="OSS" PKG_LICENSE="OSS"
PKG_SITE="http://www.python.org/" PKG_SITE="http://www.python.org/"
PKG_URL="http://www.python.org/ftp/python/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.xz" PKG_URL="http://www.python.org/ftp/python/$PKG_VERSION/$PKG_NAME-$PKG_VERSION.tar.xz"
PKG_DEPENDS_HOST="zlib:host" PKG_DEPENDS_HOST="zlib:host"
PKG_DEPENDS_TARGET="toolchain Python:host sqlite expat zlib bzip2 libressl libffi" PKG_DEPENDS_TARGET="toolchain Python:host sqlite expat zlib bzip2 libressl libffi Python:host"
PKG_PRIORITY="optional" PKG_PRIORITY="optional"
PKG_SECTION="lang" PKG_SECTION="lang"
PKG_SHORTDESC="python: The Python programming language" PKG_SHORTDESC="python: The Python programming language"
@ -48,6 +48,9 @@ PKG_CONFIGURE_OPTS_TARGET="ac_cv_file_dev_ptc=no \
ac_cv_buggy_getaddrinfo=no \ ac_cv_buggy_getaddrinfo=no \
ac_cv_header_bluetooth_bluetooth_h=no \ ac_cv_header_bluetooth_bluetooth_h=no \
ac_cv_header_bluetooth_h=no \ ac_cv_header_bluetooth_h=no \
ac_cv_file__dev_ptmx=no \
ac_cv_file__dev_ptc=no \
ac_cv_have_long_long_format=yes \
--with-threads \ --with-threads \
--enable-unicode=ucs4 \ --enable-unicode=ucs4 \
--enable-ipv6 \ --enable-ipv6 \
@ -72,19 +75,6 @@ make_host() {
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES"
} }
make_target() {
make -j1 CC="$TARGET_CC" \
HOSTPYTHON=$ROOT/$TOOLCHAIN/bin/python \
HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \
BLDSHARED="$CC -shared" \
RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
CROSS_COMPILE="$TARGET_NAME" \
CROSS_COMPILE_TARGET="yes" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR"
}
makeinstall_host() { makeinstall_host() {
make PYTHON_MODULES_INCLUDE="$HOST_INCDIR" \ make PYTHON_MODULES_INCLUDE="$HOST_INCDIR" \
PYTHON_MODULES_LIB="$HOST_LIBDIR" \ PYTHON_MODULES_LIB="$HOST_LIBDIR" \
@ -92,44 +82,42 @@ makeinstall_host() {
install install
cp Parser/pgen $ROOT/$TOOLCHAIN/bin cp Parser/pgen $ROOT/$TOOLCHAIN/bin
}
# replace python-config to make sure python uses $SYSROOT_PREFIX make_target() {
mkdir -p $ROOT/$TOOLCHAIN/bin make -j1 CC="$TARGET_CC" \
rm -rf $ROOT/$TOOLCHAIN/bin/python*-config PYTHON_FOR_BUILD=$ROOT/$TOOLCHAIN/bin/python \
HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \
sed -e "s:%PREFIX%:$SYSROOT_PREFIX/usr:g" -e "s:%CFLAGS%:$TARGET_CFLAGS:g" \ BLDSHARED="$CC -shared" \
$PKG_DIR/scripts/python-config > $ROOT/$TOOLCHAIN/bin/python2.7-config RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \
chmod +x $ROOT/$TOOLCHAIN/bin/python2.7-config PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
ln -s python2.7-config $ROOT/$TOOLCHAIN/bin/python-config PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR"
} }
makeinstall_target() { makeinstall_target() {
make -j1 CC="$TARGET_CC" \ make -j1 CC="$TARGET_CC" \
DESTDIR=$SYSROOT_PREFIX \ DESTDIR=$SYSROOT_PREFIX \
HOSTPYTHON=$ROOT/$TOOLCHAIN/bin/python \ PYTHON_FOR_BUILD=$ROOT/$TOOLCHAIN/bin/python \
HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \ HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \
BLDSHARED="$CC -shared" \ BLDSHARED="$CC -shared" \
RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \ RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \ PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
CROSS_COMPILE="$TARGET_NAME" \
CROSS_COMPILE_TARGET="yes" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \ PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR" \ PYTHON_MODULES_LIB="$TARGET_LIBDIR" \
install install
# python distutils per default adds -L$LIBDIR when linking binary extensions # python distutils per default adds -L$LIBDIR when linking binary extensions
sed -e "s|^LIBDIR=.*|LIBDIR= $SYSROOT_PREFIX/usr/lib|" \ sed -e "s|^LIBDIR=.*|LIBDIR= $SYSROOT_PREFIX/usr/lib|" \
-i $SYSROOT_PREFIX/usr/lib/python*/config/Makefile -i $SYSROOT_PREFIX/usr/lib/python*/config/Makefile
make -j1 CC="$TARGET_CC" \ make -j1 CC="$TARGET_CC" \
DESTDIR=$INSTALL \ DESTDIR=$INSTALL \
HOSTPYTHON=$ROOT/$TOOLCHAIN/bin/python \ PYTHON_FOR_BUILD=$ROOT/$TOOLCHAIN/bin/python \
HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \ HOSTPGEN=$ROOT/$TOOLCHAIN/bin/pgen \
BLDSHARED="$CC -shared" \ BLDSHARED="$CC -shared" \
RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \ RUNSHARED="LD_LIBRARY_PATH=$ROOT/$TOOLCHAIN/lib:$LD_LIBRARY_PATH" \
PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \ PYTHON_DISABLE_MODULES="$PY_DISABLED_MODULES" \
CROSS_COMPILE="$TARGET_NAME" \
CROSS_COMPILE_TARGET="yes" \
PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \ PYTHON_MODULES_INCLUDE="$TARGET_INCDIR" \
PYTHON_MODULES_LIB="$TARGET_LIBDIR" \ PYTHON_MODULES_LIB="$TARGET_LIBDIR" \
install install
@ -150,6 +138,7 @@ post_makeinstall_target() {
rm -rf $INSTALL/usr/lib/python*/config/makesetup rm -rf $INSTALL/usr/lib/python*/config/makesetup
rm -rf $INSTALL/usr/lib/python*/config/python.o rm -rf $INSTALL/usr/lib/python*/config/python.o
# TODO remove ?
if [ ! -f $INSTALL/usr/lib/python*/lib-dynload/_socket.so ]; then if [ ! -f $INSTALL/usr/lib/python*/lib-dynload/_socket.so ]; then
echo "sometimes Python dont build '_socket.so' for some reasons and continues without failing," echo "sometimes Python dont build '_socket.so' for some reasons and continues without failing,"
echo "let it fail here, to be sure '_socket.so' will be installed. A rebuild of Python fixes" echo "let it fail here, to be sure '_socket.so' will be installed. A rebuild of Python fixes"

View File

@ -1,135 +0,0 @@
diff -Naur Python-2.7.3/configure Python-2.7.3.patch/configure
--- Python-2.7.3/configure 2012-04-10 01:07:36.000000000 +0200
+++ Python-2.7.3.patch/configure 2012-04-16 14:27:58.161470960 +0200
@@ -13697,7 +13697,7 @@
$as_echo_n "(cached) " >&6
else
if test "$cross_compiling" = yes; then :
- ac_cv_have_long_long_format=no
+ ac_cv_have_long_long_format="cross -- assuming yes"
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@@ -13749,7 +13749,7 @@
$as_echo "$ac_cv_have_long_long_format" >&6; }
fi
-if test "$ac_cv_have_long_long_format" = yes
+if test "$ac_cv_have_long_long_format" != no
then
$as_echo "#define PY_FORMAT_LONG_LONG \"ll\"" >>confdefs.h
diff -Naur Python-2.7.3/Makefile.pre.in Python-2.7.3.patch/Makefile.pre.in
--- Python-2.7.3/Makefile.pre.in 2012-04-10 01:07:33.000000000 +0200
+++ Python-2.7.3.patch/Makefile.pre.in 2012-04-16 14:30:27.753099115 +0200
@@ -182,6 +182,7 @@
PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)
+HOSTPYTHON= ./$(BUILDPYTHON)
# The task to run while instrument when building the profile-opt target
PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
@@ -215,6 +216,8 @@
# Parser
PGEN= Parser/pgen$(EXE)
+HOSTPGEN= $(PGEN)
+
POBJS= \
Parser/acceler.o \
Parser/grammar1.o \
@@ -408,8 +411,8 @@
# Build the shared modules
sharedmods: $(BUILDPYTHON)
@case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
esac
# Build static library
@@ -543,7 +546,7 @@
$(GRAMMAR_H) $(GRAMMAR_C): Parser/pgen.stamp
Parser/pgen.stamp: $(PGEN) $(GRAMMAR_INPUT)
-@$(INSTALL) -d Include
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
-touch Parser/pgen.stamp
$(PGEN): $(PGENOBJS)
@@ -938,26 +941,26 @@
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
fi
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
+ $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST) -f \
-x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
$(DESTDIR)$(LIBDEST)
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
+ $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
-d $(LIBDEST)/site-packages -f \
-x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
+ $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
# Create the PLATDIR source directory, if one wasn't distributed..
$(srcdir)/Lib/$(PLATDIR):
@@ -1062,7 +1065,9 @@
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
- $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
+ --skip-build \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
diff -Naur Python-2.7.3/setup.py Python-2.7.3.patch/setup.py
--- Python-2.7.3/setup.py 2012-04-10 01:07:36.000000000 +0200
+++ Python-2.7.3.patch/setup.py 2012-04-16 14:27:58.164471010 +0200
@@ -23,6 +23,10 @@
# This global variable is used to hold the list of modules to be disabled.
disabled_module_list = []
+# _ctypes fails to cross-compile due to the libffi configure script.
+#if os.environ.has_key('PYTHONXCPREFIX'):
+# disabled_module_list.append('_ctypes')
+
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
1) 'dir' is not already in 'dirlist'
@@ -278,6 +282,14 @@
(ext.name, sys.exc_info()[1]))
self.failed.append(ext.name)
return
+
+ # Inport check will not work when cross-compiling.
+ if os.environ.has_key('PYTHONXCPREFIX'):
+ self.announce(
+ 'WARNING: skipping inport check for cross-compiled: "%s"' %
+ ext.name)
+ return
+
# Workaround for Mac OS X: The Carbon-based modules cannot be
# reliably imported into a command-line Python
if 'Carbon' in ext.extra_link_args:

View File

@ -1,38 +0,0 @@
diff -Naur Python-2.6.6/setup.py Python-2.6.6.patch/setup.py
--- Python-2.6.6/setup.py 2010-11-03 00:17:10.403608974 +0100
+++ Python-2.6.6.patch/setup.py 2010-11-03 00:23:31.624025348 +0100
@@ -18,7 +18,14 @@
from distutils.spawn import find_executable
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+try:
+ disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
+except KeyError:
+ disabled_module_list = []
+try:
+ disable_ssl = os.environ["PYTHON_DISABLE_SSL"]
+except KeyError:
+ disable_ssl = 0
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if
@@ -361,6 +368,8 @@
return sys.platform
def detect_modules(self):
+ global disable_ssl
+
try:
modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
except KeyError:
@@ -714,7 +723,8 @@
] )
if (ssl_incs is not None and
- ssl_libs is not None):
+ ssl_libs is not None and
+ not disable_ssl):
exts.append( Extension('_ssl', ['_ssl.c'],
include_dirs = ssl_incs,
library_dirs = ssl_libs,

View File

@ -1,28 +0,0 @@
diff -Naur Python-2.7.3/Makefile.pre.in Python-2.7.3.patch/Makefile.pre.in
--- Python-2.7.3/Makefile.pre.in 2012-04-16 14:49:16.353716188 +0200
+++ Python-2.7.3.patch/Makefile.pre.in 2012-04-16 14:50:03.740554039 +0200
@@ -941,24 +941,6 @@
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
fi
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"

View File

@ -1,37 +0,0 @@
diff -Naur Python-2.7.2/Makefile.pre.in Python-2.7.2.patch/Makefile.pre.in
--- Python-2.7.2/Makefile.pre.in 2011-10-26 01:53:09.752305358 +0200
+++ Python-2.7.2.patch/Makefile.pre.in 2011-10-26 01:57:20.158587315 +0200
@@ -410,8 +410,8 @@
# Build the shared modules
sharedmods: $(BUILDPYTHON)
@case $$MAKEFLAGS in \
- *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
- *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
+ *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' CONFIG_ARGS="$(CONFIG_ARGS)" $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
+ *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' CONFIG_ARGS="$(CONFIG_ARGS)" $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
esac
# Build static library
@@ -1053,7 +1053,7 @@
# This goes into $(exec_prefix)
sharedinstall: sharedmods
CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
- $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
+ $(RUNSHARED) CONFIG_ARGS="$(CONFIG_ARGS)" $(HOSTPYTHON) -E $(srcdir)/setup.py install \
--skip-build \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
diff -Naur Python-2.7.2/setup.py Python-2.7.2.patch/setup.py
--- Python-2.7.2/setup.py 2011-10-26 01:53:16.014387508 +0200
+++ Python-2.7.2.patch/setup.py 2011-10-26 01:53:46.158782904 +0200
@@ -20,6 +20,9 @@
# Were we compiled --with-pydebug or with #define Py_DEBUG?
COMPILED_WITH_PYDEBUG = hasattr(sys, 'gettotalrefcount')
+sysconfig.get_config_vars()
+sysconfig._CONFIG_VARS.update(os.environ)
+
# This global variable is used to hold the list of modules to be disabled.
try:
disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
diff -Naur Python-2.7.2/setup.py.orig Python-2.7.2.patch/setup.py.orig

View File

@ -1,18 +0,0 @@
# When compiling for an embedded system, we need every bit of
# performance we can get. default to optimized with the option
# of opt-out.
# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
Index: Python-2.6.1/Python/compile.c
===================================================================
--- Python-2.6.1.orig/Python/compile.c
+++ Python-2.6.1/Python/compile.c
@@ -32,7 +32,7 @@
#include "symtable.h"
#include "opcode.h"
-int Py_OptimizeFlag = 0;
+int Py_OptimizeFlag = 1;
#define DEFAULT_BLOCK_SIZE 16
#define DEFAULT_BLOCKS 8

View File

@ -1,34 +0,0 @@
diff -Naur Python-2.7.3/configure Python-2.7.3.patch/configure
--- Python-2.7.3/configure 2012-04-10 01:07:36.000000000 +0200
+++ Python-2.7.3.patch/configure 2012-07-28 04:48:41.720322418 +0200
@@ -5425,11 +5425,11 @@
# debug builds.
OPT="-g -O0 -Wall $STRICT_PROTO"
else
- OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
+ OPT="-g $WRAP $STRICT_PROTO"
fi
;;
*)
- OPT="-O3 -Wall $STRICT_PROTO"
+ OPT="$STRICT_PROTO"
;;
esac
case $ac_sys_system in
diff -Naur Python-2.7.3/configure.in Python-2.7.3.patch/configure.in
--- Python-2.7.3/configure.in 2012-04-10 01:07:36.000000000 +0200
+++ Python-2.7.3.patch/configure.in 2012-07-28 04:48:22.987067842 +0200
@@ -946,11 +946,11 @@
# debug builds.
OPT="-g -O0 -Wall $STRICT_PROTO"
else
- OPT="-g $WRAP -O3 -Wall $STRICT_PROTO"
+ OPT="-g $WRAP $STRICT_PROTO"
fi
;;
*)
- OPT="-O3 -Wall $STRICT_PROTO"
+ OPT="$STRICT_PROTO"
;;
esac
case $ac_sys_system in

View File

@ -0,0 +1,66 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index bcd83bf..5e54a0d 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -191,6 +191,7 @@ UNICODE_OBJS= @UNICODE_OBJS@
PYTHON= python$(EXE)
BUILDPYTHON= python$(BUILDEXE)
+HOSTPYTHON= ./$(BUILDPYTHON)
PYTHON_FOR_BUILD=@PYTHON_FOR_BUILD@
_PYTHON_HOST_PLATFORM=@_PYTHON_HOST_PLATFORM@
@@ -231,6 +232,7 @@ LIBFFI_INCLUDEDIR= @LIBFFI_INCLUDEDIR@
##########################################################################
# Parser
PGEN= Parser/pgen$(EXE)
+HOSTPGEN= $(PGEN)
PSRCS= \
Parser/acceler.c \
@@ -461,6 +463,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
esac; \
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
+ PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
# Build static library
@@ -598,7 +601,7 @@ Modules/pwdmodule.o: $(srcdir)/Modules/pwdmodule.c $(srcdir)/Modules/posixmodule
$(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
@$(MKDIR_P) Include
$(MAKE) $(PGEN)
- $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
+ $(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
$(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
$(MAKE) $(GRAMMAR_H)
touch $(GRAMMAR_C)
@@ -1142,7 +1145,9 @@ libainstall: all python-config
# Install the dynamically loadable modules
# This goes into $(exec_prefix)
sharedinstall: sharedmods
+ CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
+ --skip-build \
--prefix=$(prefix) \
--install-scripts=$(BINDIR) \
--install-platlib=$(DESTSHARED) \
diff --git a/setup.py b/setup.py
index a46bf35..528e9df 100644
--- a/setup.py
+++ b/setup.py
@@ -292,6 +292,14 @@ class PyBuildExt(build_ext):
(ext.name, sys.exc_info()[1]))
self.failed.append(ext.name)
return
+
+ # Inport check will not work when cross-compiling.
+ if os.environ.has_key('PYTHONXCPREFIX'):
+ self.announce(
+ 'WARNING: skipping inport check for cross-compiled: "%s"' %
+ ext.name)
+ return
+
# Workaround for Mac OS X: The Carbon-based modules cannot be
# reliably imported into a command-line Python
if 'Carbon' in ext.extra_link_args:

View File

@ -1,13 +1,17 @@
diff -Naur Python-2.7.2/setup.py Python-2.7.2.patch/setup.py diff --git a/setup.py b/setup.py
--- Python-2.7.2/setup.py 2011-10-25 14:07:59.520264628 +0200 index d6ef5be..7a0d8f2 100644
+++ Python-2.7.2.patch/setup.py 2011-10-25 14:16:32.218793079 +0200 --- a/setup.py
@@ -380,10 +380,19 @@ +++ b/setup.py
@@ -439,13 +439,19 @@ class PyBuildExt(build_ext):
os.unlink(tmpfile) os.unlink(tmpfile)
def detect_modules(self): def detect_modules(self):
- # Ensure that /usr/local is always used - # Ensure that /usr/local is always used
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') - if not cross_compiling:
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
- if cross_compiling:
- self.add_gcc_paths()
- self.add_multiarch_paths() - self.add_multiarch_paths()
+ try: + try:
+ modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split() + modules_include_dirs = os.environ["PYTHON_MODULES_INCLUDE"].split()
@ -25,7 +29,7 @@ diff -Naur Python-2.7.2/setup.py Python-2.7.2.patch/setup.py
# Add paths specified in the environment variables LDFLAGS and # Add paths specified in the environment variables LDFLAGS and
# CPPFLAGS for header and library files. # CPPFLAGS for header and library files.
@@ -419,17 +428,6 @@ @@ -481,17 +487,6 @@ class PyBuildExt(build_ext):
for directory in reversed(options.dirs): for directory in reversed(options.dirs):
add_dir_to_list(dir_list, directory) add_dir_to_list(dir_list, directory)
@ -43,17 +47,3 @@ diff -Naur Python-2.7.2/setup.py Python-2.7.2.patch/setup.py
try: try:
have_unicode = unicode have_unicode = unicode
except NameError: except NameError:
@@ -438,11 +436,8 @@
# lib_dirs and inc_dirs are used to search for files;
# if a file is found in one of those directories, it can
# be assumed that no additional -I,-L directives are needed.
- lib_dirs = self.compiler.library_dirs + [
- '/lib64', '/usr/lib64',
- '/lib', '/usr/lib',
- ]
- inc_dirs = self.compiler.include_dirs + ['/usr/include']
+ lib_dirs = self.compiler.library_dirs
+ inc_dirs = self.compiler.include_dirs
exts = []
missing = []

View File

@ -0,0 +1,16 @@
diff --git a/setup.py b/setup.py
index a46bf35..d6ef5be 100644
--- a/setup.py
+++ b/setup.py
@@ -33,7 +33,10 @@ host_platform = get_platform()
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
# This global variable is used to hold the list of modules to be disabled.
-disabled_module_list = []
+try:
+ disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()
+except KeyError:
+ disabled_module_list = []
def add_dir_to_list(dirlist, dir):
"""Add the directory 'dir' to the list 'dirlist' (at the front) if

View File

@ -1,11 +1,11 @@
diff -Naur Python-2.7.2/setup.py Python-2.7.2.patch/setup.py diff --git a/setup.py b/setup.py
--- Python-2.7.2/setup.py 2011-10-26 01:53:16.014387508 +0200 index 07af0b6..6426b22 100644
+++ Python-2.7.2.patch/setup.py 2011-10-26 02:20:08.236706196 +0200 --- a/setup.py
@@ -1877,12 +1877,18 @@ +++ b/setup.py
ffi_configfile): @@ -2030,10 +2030,18 @@ class PyBuildExt(build_ext):
from distutils.dir_util import mkpath if not self.verbose:
mkpath(ffi_builddir) config_args.append("-q")
- config_args = []
+ +
+ #NOTE: best solution is to add to configure script + #NOTE: best solution is to add to configure script
+ # as config subdirectory and to exclude darwin + # as config subdirectory and to exclude darwin
@ -13,7 +13,7 @@ diff -Naur Python-2.7.2/setup.py Python-2.7.2.patch/setup.py
+ #FIXME: lets for now pass all top configure arguments + #FIXME: lets for now pass all top configure arguments
+ #and do not modify configure script. + #and do not modify configure script.
+ config_args = sysconfig.get_config_var("CONFIG_ARGS") + config_args = sysconfig.get_config_var("CONFIG_ARGS")
+
# Pass empty CFLAGS because we'll just append the resulting # Pass empty CFLAGS because we'll just append the resulting
# CFLAGS to Python's; -g or -O2 is to be avoided. # CFLAGS to Python's; -g or -O2 is to be avoided.
cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \ cmd = "cd %s && env CFLAGS='' '%s/configure' %s" \

View File

@ -0,0 +1,29 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index 918f210..c82366c 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1011,24 +1011,6 @@ libinstall: build_all $(srcdir)/Lib/$(PLATDIR) $(srcdir)/Modules/xxmodule.c
$(INSTALL_DATA) $(srcdir)/Modules/xxmodule.c \
$(DESTDIR)$(LIBDEST)/distutils/tests ; \
fi
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST) -f \
- -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
- $(DESTDIR)$(LIBDEST)
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
- -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
- $(PYTHON_FOR_BUILD) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
- -d $(LIBDEST)/site-packages -f \
- -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
$(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt
-PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \

View File

@ -0,0 +1,34 @@
diff --git a/Makefile.pre.in b/Makefile.pre.in
index bf3aed7..7ff5c79 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -464,6 +464,7 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
$(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
_TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
PYTHONXCPREFIX='$(DESTDIR)$(prefix)' \
+ CONFIG_ARGS="$(CONFIG_ARGS)" \
$(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
libpython$(VERSION).so: $(LIBRARY_OBJS)
@@ -1104,6 +1105,7 @@ libainstall: all python-config
# This goes into $(exec_prefix)
sharedinstall: sharedmods
CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' \
+ CONFIG_ARGS="$(CONFIG_ARGS)" \
$(RUNSHARED) $(PYTHON_FOR_BUILD) $(srcdir)/setup.py install \
--skip-build \
--prefix=$(prefix) \
diff --git a/setup.py b/setup.py
index 6426b22..d2776dd 100644
--- a/setup.py
+++ b/setup.py
@@ -32,6 +32,9 @@ host_platform = get_platform()
# Were we compiled --with-pydebug or with #define Py_DEBUG?
COMPILED_WITH_PYDEBUG = ('--with-pydebug' in sysconfig.get_config_var("CONFIG_ARGS"))
+sysconfig.get_config_vars()
+sysconfig._CONFIG_VARS.update(os.environ)
+
# This global variable is used to hold the list of modules to be disabled.
try:
disabled_module_list = os.environ["PYTHON_DISABLE_MODULES"].split()

View File

@ -1,7 +1,8 @@
diff -up Python-2.6.4/Lib/distutils/unixccompiler.py.distutils-rpath Python-2.6.4/Lib/distutils/unixccompiler.py diff --git a/Lib/distutils/unixccompiler.py b/Lib/distutils/unixccompiler.py
--- Python-2.6.4/Lib/distutils/unixccompiler.py.distutils-rpath 2009-09-09 04:34:06.000000000 -0400 index 2aa1cb1..529e2d4 100644
+++ Python-2.6.4/Lib/distutils/unixccompiler.py 2010-03-15 21:33:25.000000000 -0400 --- a/Lib/distutils/unixccompiler.py
@@ -142,6 +142,16 @@ class UnixCCompiler(CCompiler): +++ b/Lib/distutils/unixccompiler.py
@@ -83,6 +83,16 @@ class UnixCCompiler(CCompiler):
if sys.platform == "cygwin": if sys.platform == "cygwin":
exe_extension = ".exe" exe_extension = ".exe"

View File

@ -1,7 +1,8 @@
diff -Naur Python-2.7.2/Makefile.pre.in Python-2.7.2.patch/Makefile.pre.in diff --git a/Makefile.pre.in b/Makefile.pre.in
--- Python-2.7.2/Makefile.pre.in 2011-10-25 16:20:40.178698198 +0200 index 918f210..eb9ee6b 100644
+++ Python-2.7.2.patch/Makefile.pre.in 2011-10-25 16:22:33.429160448 +0200 --- a/Makefile.pre.in
@@ -398,7 +398,7 @@ +++ b/Makefile.pre.in
@@ -438,7 +438,7 @@ coverage:
# Build the interpreter # Build the interpreter
@ -10,9 +11,9 @@ diff -Naur Python-2.7.2/Makefile.pre.in Python-2.7.2.patch/Makefile.pre.in
$(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \ $(LINKCC) $(LDFLAGS) $(LINKFORSHARED) -o $@ \
Modules/python.o \ Modules/python.o \
$(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
@@ -414,18 +414,6 @@ @@ -465,18 +465,6 @@ sharedmods: $(BUILDPYTHON) pybuilddir.txt
*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' PYTHONXCPREFIX='$(DESTDIR)$(prefix)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ _TCLTK_INCLUDES='$(TCLTK_INCLUDES)' _TCLTK_LIBS='$(TCLTK_LIBS)' \
esac $(PYTHON_FOR_BUILD) $(srcdir)/setup.py $$quiet build
-# Build static library -# Build static library
-# avoid long command lines, same as LIBRARY_OBJS -# avoid long command lines, same as LIBRARY_OBJS
@ -29,7 +30,7 @@ diff -Naur Python-2.7.2/Makefile.pre.in Python-2.7.2.patch/Makefile.pre.in
libpython$(VERSION).so: $(LIBRARY_OBJS) libpython$(VERSION).so: $(LIBRARY_OBJS)
if test $(INSTSONAME) != $(LDLIBRARY); then \ if test $(INSTSONAME) != $(LDLIBRARY); then \
$(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \ $(BLDSHARED) -Wl,-h$(INSTSONAME) -o $(INSTSONAME) $(LIBRARY_OBJS) $(MODLIBS) $(SHLIBS) $(LIBC) $(LIBM) $(LDLAST); \
@@ -997,18 +985,6 @@ @@ -1090,18 +1078,6 @@ libainstall: all python-config
else true; \ else true; \
fi; \ fi; \
done done
@ -48,4 +49,3 @@ diff -Naur Python-2.7.2/Makefile.pre.in Python-2.7.2.patch/Makefile.pre.in
$(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c $(INSTALL_DATA) Modules/config.c $(DESTDIR)$(LIBPL)/config.c
$(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o $(INSTALL_DATA) Modules/python.o $(DESTDIR)$(LIBPL)/python.o
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in $(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
diff -Naur Python-2.7.2/Makefile.pre.in.orig Python-2.7.2.patch/Makefile.pre.in.orig

View File

@ -0,0 +1,13 @@
diff --git a/Python/compile.c b/Python/compile.c
index 1cf53f9..25665b5 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -32,7 +32,7 @@
#include "symtable.h"
#include "opcode.h"
-int Py_OptimizeFlag = 0;
+int Py_OptimizeFlag = 1;
#define DEFAULT_BLOCK_SIZE 16
#define DEFAULT_BLOCKS 8

View File

@ -1,7 +1,8 @@
diff -Naur Python-2.7.3/Lib/socket.py Python-2.7.3.patch/Lib/socket.py diff --git a/Lib/socket.py b/Lib/socket.py
--- Python-2.7.3/Lib/socket.py 2012-04-10 01:07:31.000000000 +0200 index aac04f6..02aa293 100644
+++ Python-2.7.3.patch/Lib/socket.py 2014-07-18 04:33:44.132850756 +0200 --- a/Lib/socket.py
@@ -67,7 +67,6 @@ +++ b/Lib/socket.py
@@ -67,7 +67,6 @@ else:
from _ssl import SSLError as sslerror from _ssl import SSLError as sslerror
from _ssl import \ from _ssl import \
RAND_add, \ RAND_add, \
@ -9,10 +10,11 @@ diff -Naur Python-2.7.3/Lib/socket.py Python-2.7.3.patch/Lib/socket.py
RAND_status, \ RAND_status, \
SSL_ERROR_ZERO_RETURN, \ SSL_ERROR_ZERO_RETURN, \
SSL_ERROR_WANT_READ, \ SSL_ERROR_WANT_READ, \
diff -Naur Python-2.7.3/Lib/ssl.py Python-2.7.3.patch/Lib/ssl.py diff --git a/Lib/ssl.py b/Lib/ssl.py
--- Python-2.7.3/Lib/ssl.py 2012-04-10 01:07:31.000000000 +0200 index 666cea3..64e196a 100644
+++ Python-2.7.3.patch/Lib/ssl.py 2014-07-18 05:06:34.938100455 +0200 --- a/Lib/ssl.py
@@ -62,7 +62,7 @@ +++ b/Lib/ssl.py
@@ -62,7 +62,7 @@ import _ssl # if we can't import it, let the error propagate
from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION from _ssl import OPENSSL_VERSION_NUMBER, OPENSSL_VERSION_INFO, OPENSSL_VERSION
from _ssl import SSLError from _ssl import SSLError
from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED from _ssl import CERT_NONE, CERT_OPTIONAL, CERT_REQUIRED
@ -21,10 +23,11 @@ diff -Naur Python-2.7.3/Lib/ssl.py Python-2.7.3.patch/Lib/ssl.py
from _ssl import \ from _ssl import \
SSL_ERROR_ZERO_RETURN, \ SSL_ERROR_ZERO_RETURN, \
SSL_ERROR_WANT_READ, \ SSL_ERROR_WANT_READ, \
diff -Naur Python-2.7.3/Modules/_ssl.c Python-2.7.3.patch/Modules/_ssl.c diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- Python-2.7.3/Modules/_ssl.c 2012-04-10 01:07:33.000000000 +0200 index 752b033..9541df7 100644
+++ Python-2.7.3.patch/Modules/_ssl.c 2014-07-18 04:37:28.324453450 +0200 --- a/Modules/_ssl.c
@@ -1531,32 +1531,6 @@ +++ b/Modules/_ssl.c
@@ -1601,32 +1601,6 @@ Returns 1 if the OpenSSL PRNG has been seeded with enough data and 0 if not.\n\
It is necessary to seed the PRNG with RAND_add() on some platforms before\n\ It is necessary to seed the PRNG with RAND_add() on some platforms before\n\
using the ssl() function."); using the ssl() function.");
@ -52,12 +55,12 @@ diff -Naur Python-2.7.3/Modules/_ssl.c Python-2.7.3.patch/Modules/_ssl.c
-\n\ -\n\
-Queries the entropy gather daemon (EGD) on the socket named by 'path'.\n\ -Queries the entropy gather daemon (EGD) on the socket named by 'path'.\n\
-Returns number of bytes read. Raises SSLError if connection to EGD\n\ -Returns number of bytes read. Raises SSLError if connection to EGD\n\
-fails or if it does provide enough data to seed PRNG."); -fails or if it does not provide enough data to seed PRNG.");
- -
#endif #endif /* HAVE_OPENSSL_RAND */
/* List of functions exported by this module. */
@@ -1569,8 +1543,6 @@ @@ -1640,8 +1614,6 @@ static PyMethodDef PySSL_methods[] = {
#ifdef HAVE_OPENSSL_RAND #ifdef HAVE_OPENSSL_RAND
{"RAND_add", PySSL_RAND_add, METH_VARARGS, {"RAND_add", PySSL_RAND_add, METH_VARARGS,
PySSL_RAND_add_doc}, PySSL_RAND_add_doc},