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)
downloadpoky-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 0000000000..5131e0ba69
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/04-default-is-optimized.patch
@@ -0,0 +1,18 @@
1# When compiling for an embedded system, we need every bit of
2# performance we can get. default to optimized with the option
3# of opt-out.
4# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
5
6Index: Python-2.6.1/Python/compile.c
7===================================================================
8--- Python-2.6.1.orig/Python/compile.c
9+++ Python-2.6.1/Python/compile.c
10@@ -32,7 +32,7 @@
11 #include "symtable.h"
12 #include "opcode.h"
13
14-int Py_OptimizeFlag = 0;
15+int Py_OptimizeFlag = 1;
16
17 #define DEFAULT_BLOCK_SIZE 16
18 #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 0000000000..f5e852a118
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch
@@ -0,0 +1,16 @@
1# Some versions of SWIG do not use the extension parameter.
2# Make it optional.
3# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
4Index: Python-2.6.1/Lib/distutils/command/build_ext.py
5===================================================================
6--- Python-2.6.1.orig/Lib/distutils/command/build_ext.py
7+++ Python-2.6.1/Lib/distutils/command/build_ext.py
8@@ -566,7 +566,7 @@ class build_ext (Command):
9 target_lang=language)
10
11
12- def swig_sources (self, sources, extension):
13+ def swig_sources (self, sources, extension=None):
14
15 """Walk the list of source files in 'sources', looking for SWIG
16 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 0000000000..8354e266fa
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch
@@ -0,0 +1,18 @@
1# Don't modify the she-bang line for a cross-build.
2# Otherwise it points to our hostpython (which we do not want)
3#
4# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
5
6Index: Python-2.6.1/Lib/distutils/command/build_scripts.py
7===================================================================
8--- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py
9+++ Python-2.6.1/Lib/distutils/command/build_scripts.py
10@@ -87,7 +87,7 @@ class build_scripts (Command):
11 continue
12
13 match = first_line_re.match(first_line)
14- if match:
15+ if False: #match:
16 adjust = 1
17 post_interp = match.group(1) or ''
18
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 0000000000..bf4366f12b
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch
@@ -0,0 +1,60 @@
1# The proper prefix is inside our staging area.
2# Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de>
3
4Index: Python-2.6.6/Lib/distutils/sysconfig.py
5===================================================================
6--- Python-2.6.6.orig/Lib/distutils/sysconfig.py
7+++ Python-2.6.6/Lib/distutils/sysconfig.py
8@@ -19,8 +19,8 @@ import sys
9 from distutils.errors import DistutilsPlatformError
10
11 # These are needed in a couple of spots, so just compute them once.
12-PREFIX = os.path.normpath(sys.prefix)
13-EXEC_PREFIX = os.path.normpath(sys.exec_prefix)
14+PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
15+EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
16
17 # Path to the base directory of the project. On Windows the binary may
18 # live in project/PCBuild9. If we're dealing with an x64 Windows build,
19@@ -70,7 +70,10 @@ def get_python_inc(plat_specific=0, pref
20 sys.exec_prefix -- i.e., ignore 'plat_specific'.
21 """
22 if prefix is None:
23- prefix = plat_specific and EXEC_PREFIX or PREFIX
24+ if plat_specific:
25+ prefix = plat_specific and os.environ['STAGING_INCDIR'].rstrip('include')
26+ else:
27+ prefix = plat_specific and EXEC_PREFIX or PREFIX
28
29 if os.name == "posix":
30 if python_build:
31@@ -116,7 +119,10 @@ def get_python_lib(plat_specific=0, stan
32 sys.exec_prefix -- i.e., ignore 'plat_specific'.
33 """
34 if prefix is None:
35- prefix = plat_specific and EXEC_PREFIX or PREFIX
36+ if plat_specific:
37+ prefix = plat_specific and os.environ['STAGING_LIBDIR'].rstrip('lib')
38+ else:
39+ prefix = plat_specific and EXEC_PREFIX or PREFIX
40
41 if os.name == "posix":
42 libpython = os.path.join(prefix,
43@@ -216,7 +222,7 @@ def get_config_h_filename():
44 else:
45 # The name of the config.h file changed in 2.2
46 config_h = 'pyconfig.h'
47- return os.path.join(inc_dir, config_h)
48+ return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
49
50
51 def get_makefile_filename():
52@@ -225,7 +231,7 @@ def get_makefile_filename():
53 return os.path.join(os.path.dirname(os.path.realpath(sys.executable)),
54 "Makefile")
55 lib_dir = get_python_lib(plat_specific=1, standard_lib=1)
56- return os.path.join(lib_dir, "config", "Makefile")
57+ return os.path.join(lib_dir, "config", "Makefile").replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
58
59
60 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 0000000000..beb3adc6db
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/debug.patch
@@ -0,0 +1,27 @@
1Index: Python-2.6.1/Lib/distutils/unixccompiler.py
2===================================================================
3--- Python-2.6.1.orig/Lib/distutils/unixccompiler.py 2009-11-13 16:04:54.000000000 +0000
4+++ Python-2.6.1/Lib/distutils/unixccompiler.py 2009-11-13 16:06:27.000000000 +0000
5@@ -300,6 +300,8 @@
6 dylib_f = self.library_filename(lib, lib_type='dylib')
7 static_f = self.library_filename(lib, lib_type='static')
8
9+ print "Looking in %s for %s" % (lib, dirs)
10+
11 for dir in dirs:
12 shared = os.path.join(dir, shared_f)
13 dylib = os.path.join(dir, dylib_f)
14@@ -309,10 +311,13 @@
15 # assuming that *all* Unix C compilers do. And of course I'm
16 # ignoring even GCC's "-static" option. So sue me.
17 if os.path.exists(dylib):
18+ print "Found %s" % (dylib)
19 return dylib
20 elif os.path.exists(shared):
21+ print "Found %s" % (shared)
22 return shared
23 elif os.path.exists(static):
24+ print "Found %s" % (static)
25 return static
26
27 # 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 0000000000..da2bd8f1d2
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/nohostlibs.patch
@@ -0,0 +1,53 @@
1Index: Python-2.6.6/setup.py
2===================================================================
3--- Python-2.6.6.orig/setup.py
4+++ Python-2.6.6/setup.py
5@@ -356,8 +356,8 @@ class PyBuildExt(build_ext):
6
7 def detect_modules(self):
8 # Ensure that /usr/local is always used
9- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
10- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
11+ #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
12+ #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
13
14 # Add paths specified in the environment variables LDFLAGS and
15 # CPPFLAGS for header and library files.
16@@ -393,10 +393,10 @@ class PyBuildExt(build_ext):
17 for directory in reversed(options.dirs):
18 add_dir_to_list(dir_list, directory)
19
20- if os.path.normpath(sys.prefix) != '/usr':
21- add_dir_to_list(self.compiler.library_dirs,
22+
23+ add_dir_to_list(self.compiler.library_dirs,
24 sysconfig.get_config_var("LIBDIR"))
25- add_dir_to_list(self.compiler.include_dirs,
26+ add_dir_to_list(self.compiler.include_dirs,
27 sysconfig.get_config_var("INCLUDEDIR"))
28
29 try:
30@@ -407,11 +407,8 @@ class PyBuildExt(build_ext):
31 # lib_dirs and inc_dirs are used to search for files;
32 # if a file is found in one of those directories, it can
33 # be assumed that no additional -I,-L directives are needed.
34- lib_dirs = self.compiler.library_dirs + [
35- '/lib64', '/usr/lib64',
36- '/lib', '/usr/lib',
37- ]
38- inc_dirs = self.compiler.include_dirs + ['/usr/include']
39+ lib_dirs = self.compiler.library_dirs
40+ inc_dirs = self.compiler.include_dirs
41 exts = []
42 missing = []
43
44@@ -661,8 +658,7 @@ class PyBuildExt(build_ext):
45 pass # Issue 7384: Already linked against curses or tinfo.
46 elif curses_library:
47 readline_libs.append(curses_library)
48- elif self.compiler.find_library_file(lib_dirs +
49- ['/usr/lib/termcap'],
50+ elif self.compiler.find_library_file(lib_dirs,
51 'termcap'):
52 readline_libs.append('termcap')
53 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 0000000000..273901898a
--- /dev/null
+++ b/meta/recipes-devtools/python/python-native/sitecustomize.py
@@ -0,0 +1,45 @@
1# OpenEmbedded sitecustomize.py (C) 2002-2008 Michael 'Mickey' Lauer <mlauer@vanille-media.de>
2# GPLv2 or later
3# Version: 20081123
4# Features:
5# * set proper default encoding
6# * enable readline completion in the interactive interpreter
7# * load command line history on startup
8# * save command line history on exit
9
10import os
11
12def __exithandler():
13 try:
14 readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
15 except IOError:
16 pass
17
18def __registerExitHandler():
19 import atexit
20 atexit.register( __exithandler )
21
22def __enableReadlineSupport():
23 readline.set_history_length( 1000 )
24 readline.parse_and_bind( "tab: complete" )
25 try:
26 readline.read_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) )
27 except IOError:
28 pass
29
30def __enableDefaultEncoding():
31 import sys
32 try:
33 sys.setdefaultencoding( "utf8" )
34 except LookupError:
35 pass
36
37import sys
38try:
39 import rlcompleter, readline
40except ImportError:
41 pass
42else:
43 __enableDefaultEncoding()
44 __registerExitHandler()
45 __enableReadlineSupport()