summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python-native
diff options
context:
space:
mode:
authorNitin A Kamble <nitin.a.kamble@intel.com>2010-11-08 10:34:46 -0800
committerSaul Wold <sgw@linux.intel.com>2010-11-14 21:08:26 -0800
commit793bb465b3a6b0c883340621575b9944d7ccaf5a (patch)
treeb668cfadf3836b3d018dd76005f3bb65b4f8dd03 /meta/recipes-devtools/python/python-native
parenta7af5c516e547e669d92569dba21a9c1c790cf7f (diff)
downloadast2050-yocto-poky-793bb465b3a6b0c883340621575b9944d7ccaf5a.zip
ast2050-yocto-poky-793bb465b3a6b0c883340621575b9944d7ccaf5a.tar.gz
python, python-native upgrade from 2.6.5 to 2.6.6
Removed these patch: python-native-2.6.5/00-fix-bindir-libdir-for-cross.patch python/00-fix-bindir-libdir-for-cross.patch The upstream code has changed, and it does not need the above 2 patches (fixes) anymore. Patches rebased to the newer code: python/01-use-proper-tools-for-cross-build.patch python/04-default-is-optimized.patch python/06-avoid_usr_lib_termcap_path_in_linking.patch python/99-ignore-optimization-flag.patch Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Diffstat (limited to 'meta/recipes-devtools/python/python-native')
-rw-r--r--meta/recipes-devtools/python/python-native/04-default-is-optimized.patch18
-rw-r--r--meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch16
-rw-r--r--meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch18
-rw-r--r--meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch60
-rw-r--r--meta/recipes-devtools/python/python-native/debug.patch27
-rw-r--r--meta/recipes-devtools/python/python-native/nohostlibs.patch53
-rw-r--r--meta/recipes-devtools/python/python-native/sitecustomize.py45
7 files changed, 237 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python-native/04-default-is-optimized.patch b/meta/recipes-devtools/python/python-native/04-default-is-optimized.patch
new file mode 100644
index 0000000..5131e0b
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/04-default-is-optimized.patch
@@ -0,0 +1,18 @@
+# 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
diff --git a/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
new file mode 100644
index 0000000..f5e852a
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
@@ -0,0 +1,16 @@
+# Some versions of SWIG do not use the extension parameter.
+# Make it optional.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+Index: Python-2.6.1/Lib/distutils/command/build_ext.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py
++++ Python-2.6.1/Lib/distutils/command/build_ext.py
+@@ -566,7 +566,7 @@ class build_ext (Command):
+ target_lang=language)
+
+
+- def swig_sources (self, sources, extension):
++ def swig_sources (self, sources, extension=None):
+
+ """Walk the list of source files in 'sources', looking for SWIG
+ interface (.i) files. Run SWIG on all that are found, and
diff --git a/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch b/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
new file mode 100644
index 0000000..8354e26
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
@@ -0,0 +1,18 @@
+# Don't modify the she-bang line for a cross-build.
+# Otherwise it points to our hostpython (which we do not want)
+#
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+
+Index: Python-2.6.1/Lib/distutils/command/build_scripts.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py
++++ Python-2.6.1/Lib/distutils/command/build_scripts.py
+@@ -87,7 +87,7 @@ class build_scripts (Command):
+ continue
+
+ match = first_line_re.match(first_line)
+- if match:
++ if False: #match:
+ adjust = 1
+ post_interp = match.group(1) or ''
+
diff --git a/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
new file mode 100644
index 0000000..bf4366f
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,60 @@
+# The proper prefix is inside our staging area.
+# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
+
+Index: Python-2.6.6/Lib/distutils/sysconfig.py
+===================================================================
+--- Python-2.6.6.orig/Lib/distutils/sysconfig.py
++++ Python-2.6.6/Lib/distutils/sysconfig.py
+@@ -19,8 +19,8 @@ import sys
+ from distutils.errors import DistutilsPlatformError
+
+ # These are needed in a couple of spots, so just compute them once.
+-PREFIX = os.path.normpath(sys.prefix)
+-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
++PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
++EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+ # Path to the base directory of the project. On Windows the binary may
+ # live in project/PCBuild9. If we're dealing with an x64 Windows build,
+@@ -70,7 +70,10 @@ def get_python_inc(plat_specific=0, pref
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
+ """
+ if prefix is None:
+- prefix = plat_specific and EXEC_PREFIX or PREFIX
++ if plat_specific:
++ prefix = plat_specific and os.environ['STAGING_INCDIR'].rstrip('include')
++ else:
++ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
+ if python_build:
+@@ -116,7 +119,10 @@ def get_python_lib(plat_specific=0, stan
+ sys.exec_prefix -- i.e., ignore 'plat_specific'.
+ """
+ if prefix is None:
+- prefix = plat_specific and EXEC_PREFIX or PREFIX
++ if plat_specific:
++ prefix = plat_specific and os.environ['STAGING_LIBDIR'].rstrip('lib')
++ else:
++ prefix = plat_specific and EXEC_PREFIX or PREFIX
+
+ if os.name == "posix":
+ libpython = os.path.join(prefix,
+@@ -216,7 +222,7 @@ def get_config_h_filename():
+ else:
+ # The name of the config.h file changed in 2.2
+ config_h = 'pyconfig.h'
+- return os.path.join(inc_dir, config_h)
++ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+
+ def get_makefile_filename():
+@@ -225,7 +231,7 @@ def get_makefile_filename():
+ return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
+ "Makefile")
+ lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
+- return os.path.join(lib_dir, "config", "Makefile")
++ return os.path.join(lib_dir, "config", "Makefile").replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
+
+
+ def parse_config_h(fp, g=None):
diff --git a/meta/recipes-devtools/python/python-native/debug.patch b/meta/recipes-devtools/python/python-native/debug.patch
new file mode 100644
index 0000000..beb3adc
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/debug.patch
@@ -0,0 +1,27 @@
+Index: Python-2.6.1/Lib/distutils/unixccompiler.py
+===================================================================
+--- Python-2.6.1.orig/Lib/distutils/unixccompiler.py 2009-11-13 16:04:54.000000000 +0000
++++ Python-2.6.1/Lib/distutils/unixccompiler.py 2009-11-13 16:06:27.000000000 +0000
+@@ -300,6 +300,8 @@
+ dylib_f = self.library_filename(lib, lib_type='dylib')
+ static_f = self.library_filename(lib, lib_type='static')
+
++ print "Looking in %s for %s" % (lib, dirs)
++
+ for dir in dirs:
+ shared = os.path.join(dir, shared_f)
+ dylib = os.path.join(dir, dylib_f)
+@@ -309,10 +311,13 @@
+ # assuming that *all* Unix C compilers do. And of course I'm
+ # ignoring even GCC's "-static" option. So sue me.
+ if os.path.exists(dylib):
++ print "Found %s" % (dylib)
+ return dylib
+ elif os.path.exists(shared):
++ print "Found %s" % (shared)
+ return shared
+ elif os.path.exists(static):
++ print "Found %s" % (static)
+ return static
+
+ # Oops, didn't find it in *any* of 'dirs'
diff --git a/meta/recipes-devtools/python/python-native/nohostlibs.patch b/meta/recipes-devtools/python/python-native/nohostlibs.patch
new file mode 100644
index 0000000..da2bd8f
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/nohostlibs.patch
@@ -0,0 +1,53 @@
+Index: Python-2.6.6/setup.py
+===================================================================
+--- Python-2.6.6.orig/setup.py
++++ Python-2.6.6/setup.py
+@@ -356,8 +356,8 @@ class PyBuildExt(build_ext):
+
+ def detect_modules(self):
+ # Ensure that /usr/local is always used
+- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+- 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')
+
+ # Add paths specified in the environment variables LDFLAGS and
+ # CPPFLAGS for header and library files.
+@@ -393,10 +393,10 @@ class PyBuildExt(build_ext):
+ for directory in reversed(options.dirs):
+ add_dir_to_list(dir_list, directory)
+
+- if os.path.normpath(sys.prefix) != '/usr':
+- add_dir_to_list(self.compiler.library_dirs,
++
++ add_dir_to_list(self.compiler.library_dirs,
+ sysconfig.get_config_var("LIBDIR"))
+- add_dir_to_list(self.compiler.include_dirs,
++ add_dir_to_list(self.compiler.include_dirs,
+ sysconfig.get_config_var("INCLUDEDIR"))
+
+ try:
+@@ -407,11 +407,8 @@ class PyBuildExt(build_ext):
+ # 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 = []
+
+@@ -661,8 +658,7 @@ class PyBuildExt(build_ext):
+ pass # Issue 7384: Already linked against curses or tinfo.
+ elif curses_library:
+ readline_libs.append(curses_library)
+- elif self.compiler.find_library_file(lib_dirs +
+- ['/usr/lib/termcap'],
++ elif self.compiler.find_library_file(lib_dirs,
+ 'termcap'):
+ readline_libs.append('termcap')
+ exts.append( Extension('readline', ['readline.c'],
diff --git a/meta/recipes-devtools/python/python-native/sitecustomize.py b/meta/recipes-devtools/python/python-native/sitecustomize.py
new file mode 100644
index 0000000..2739018
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/sitecustomize.py
@@ -0,0 +1,45 @@
+# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
+# GPLv2 or later
+# Version: 20081123
+# Features:
+# * set proper default encoding
+# * enable readline completion in the interactive interpreter
+# * load command line history on startup
+# * save command line history on exit
+
+import os
+
+def __exithandler():
+ try:
+ readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __registerExitHandler():
+ import atexit
+ atexit.register( __exithandler )
+
+def __enableReadlineSupport():
+ readline.set_history_length( 1000 )
+ readline.parse_and_bind( "tab: complete" )
+ try:
+ readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
+ except IOError:
+ pass
+
+def __enableDefaultEncoding():
+ import sys
+ try:
+ sys.setdefaultencoding( "utf8" )
+ except LookupError:
+ pass
+
+import sys
+try:
+ import rlcompleter, readline
+except ImportError:
+ pass
+else:
+ __enableDefaultEncoding()
+ __registerExitHandler()
+ __enableReadlineSupport()
OpenPOWER on IntegriCloud