diff options
| author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
|---|---|---|
| committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
| commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
| tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/recipes-devtools/python/python-native | |
| download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz | |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-devtools/python/python-native')
9 files changed, 535 insertions, 0 deletions
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..a39247ce70 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/10-distutils-fix-swig-parameter.patch | |||
| @@ -0,0 +1,18 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | # Some versions of SWIG do not use the extension parameter. | ||
| 4 | # Make it optional. | ||
| 5 | # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> | ||
| 6 | Index: Python-2.6.1/Lib/distutils/command/build_ext.py | ||
| 7 | =================================================================== | ||
| 8 | --- Python-2.6.1.orig/Lib/distutils/command/build_ext.py | ||
| 9 | +++ Python-2.6.1/Lib/distutils/command/build_ext.py | ||
| 10 | @@ -566,7 +566,7 @@ class build_ext (Command): | ||
| 11 | target_lang=language) | ||
| 12 | |||
| 13 | |||
| 14 | - def swig_sources (self, sources, extension): | ||
| 15 | + def swig_sources (self, sources, extension=None): | ||
| 16 | |||
| 17 | """Walk the list of source files in 'sources', looking for SWIG | ||
| 18 | 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..c92469b9b6 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/11-distutils-never-modify-shebang-line.patch | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | # Don't modify the she-bang line for a cross-build. | ||
| 4 | # Otherwise it points to our hostpython (which we do not want) | ||
| 5 | # | ||
| 6 | # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> | ||
| 7 | |||
| 8 | Index: Python-2.6.1/Lib/distutils/command/build_scripts.py | ||
| 9 | =================================================================== | ||
| 10 | --- Python-2.6.1.orig/Lib/distutils/command/build_scripts.py | ||
| 11 | +++ Python-2.6.1/Lib/distutils/command/build_scripts.py | ||
| 12 | @@ -87,7 +87,7 @@ class build_scripts (Command): | ||
| 13 | continue | ||
| 14 | |||
| 15 | match = first_line_re.match(first_line) | ||
| 16 | - if match: | ||
| 17 | + if False: #match: | ||
| 18 | adjust = 1 | ||
| 19 | post_interp = match.group(1) or '' | ||
| 20 | |||
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..f89aaff7b1 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/12-distutils-prefix-is-inside-staging-area.patch | |||
| @@ -0,0 +1,65 @@ | |||
| 1 | Upstream-Status: Inappropriate [embedded specific] | ||
| 2 | |||
| 3 | # The proper prefix is inside our staging area. | ||
| 4 | # Signed-Off: Michael 'Mickey' Lauer <mickey@vanille-media.de> | ||
| 5 | # Signed-off-by: Phil Blundell <philb@gnu.org> | ||
| 6 | |||
| 7 | --- Python-2.6.6/Lib/distutils/sysconfig.py.orig 2012-01-03 14:02:03.027005296 +0000 | ||
| 8 | +++ Python-2.6.6/Lib/distutils/sysconfig.py 2012-01-03 14:02:31.517601081 +0000 | ||
| 9 | @@ -19,8 +19,8 @@ | ||
| 10 | from distutils.errors import DistutilsPlatformError | ||
| 11 | |||
| 12 | # These are needed in a couple of spots, so just compute them once. | ||
| 13 | -PREFIX = os.path.normpath(sys.prefix) | ||
| 14 | -EXEC_PREFIX = os.path.normpath(sys.exec_prefix) | ||
| 15 | +PREFIX = os.path.normpath(sys.prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
| 16 | +EXEC_PREFIX = os.path.normpath(sys.exec_prefix).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
| 17 | |||
| 18 | # Path to the base directory of the project. On Windows the binary may | ||
| 19 | # live in project/PCBuild9. If we're dealing with an x64 Windows build, | ||
| 20 | @@ -70,7 +70,7 @@ | ||
| 21 | sys.exec_prefix -- i.e., ignore 'plat_specific'. | ||
| 22 | """ | ||
| 23 | if prefix is None: | ||
| 24 | - prefix = plat_specific and EXEC_PREFIX or PREFIX | ||
| 25 | + prefix = os.environ['STAGING_INCDIR'].rstrip('include') | ||
| 26 | |||
| 27 | if os.name == "posix": | ||
| 28 | if python_build: | ||
| 29 | @@ -115,12 +115,16 @@ | ||
| 30 | If 'prefix' is supplied, use it instead of sys.prefix or | ||
| 31 | sys.exec_prefix -- i.e., ignore 'plat_specific'. | ||
| 32 | """ | ||
| 33 | + lib_basename = os.environ['STAGING_LIBDIR'].split('/')[-1] | ||
| 34 | if prefix is None: | ||
| 35 | - prefix = plat_specific and EXEC_PREFIX or PREFIX | ||
| 36 | + if plat_specific: | ||
| 37 | + prefix = os.environ['STAGING_LIBDIR'].rstrip(lib_basename) | ||
| 38 | + else: | ||
| 39 | + prefix = PREFIX | ||
| 40 | |||
| 41 | if os.name == "posix": | ||
| 42 | libpython = os.path.join(prefix, | ||
| 43 | - "lib", "python" + get_python_version()) | ||
| 44 | + lib_basename, "python" + get_python_version()) | ||
| 45 | if standard_lib: | ||
| 46 | return libpython | ||
| 47 | else: | ||
| 48 | @@ -216,7 +220,7 @@ | ||
| 49 | else: | ||
| 50 | # The name of the config.h file changed in 2.2 | ||
| 51 | config_h = 'pyconfig.h' | ||
| 52 | - return os.path.join(inc_dir, config_h) | ||
| 53 | + return os.path.join(inc_dir, config_h).replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
| 54 | |||
| 55 | |||
| 56 | def get_makefile_filename(): | ||
| 57 | @@ -225,7 +229,7 @@ | ||
| 58 | return os.path.join(os.path.dirname(os.path.realpath(sys.executable)), | ||
| 59 | "Makefile") | ||
| 60 | lib_dir = get_python_lib(plat_specific=1, standard_lib=1) | ||
| 61 | - return os.path.join(lib_dir, "config", "Makefile") | ||
| 62 | + return os.path.join(lib_dir, "config", "Makefile").replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") ) | ||
| 63 | |||
| 64 | |||
| 65 | 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..5ec10d6b20 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/debug.patch | |||
| @@ -0,0 +1,29 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | Index: Python-2.6.1/Lib/distutils/unixccompiler.py | ||
| 4 | =================================================================== | ||
| 5 | --- Python-2.6.1.orig/Lib/distutils/unixccompiler.py 2009-11-13 16:04:54.000000000 +0000 | ||
| 6 | +++ Python-2.6.1/Lib/distutils/unixccompiler.py 2009-11-13 16:06:27.000000000 +0000 | ||
| 7 | @@ -300,6 +300,8 @@ | ||
| 8 | dylib_f = self.library_filename(lib, lib_type='dylib') | ||
| 9 | static_f = self.library_filename(lib, lib_type='static') | ||
| 10 | |||
| 11 | + print "Looking in %s for %s" % (lib, dirs) | ||
| 12 | + | ||
| 13 | for dir in dirs: | ||
| 14 | shared = os.path.join(dir, shared_f) | ||
| 15 | dylib = os.path.join(dir, dylib_f) | ||
| 16 | @@ -309,10 +311,13 @@ | ||
| 17 | # assuming that *all* Unix C compilers do. And of course I'm | ||
| 18 | # ignoring even GCC's "-static" option. So sue me. | ||
| 19 | if os.path.exists(dylib): | ||
| 20 | + print "Found %s" % (dylib) | ||
| 21 | return dylib | ||
| 22 | elif os.path.exists(shared): | ||
| 23 | + print "Found %s" % (shared) | ||
| 24 | return shared | ||
| 25 | elif os.path.exists(static): | ||
| 26 | + print "Found %s" % (static) | ||
| 27 | return static | ||
| 28 | |||
| 29 | # Oops, didn't find it in *any* of 'dirs' | ||
diff --git a/meta/recipes-devtools/python/python-native/multilib.patch b/meta/recipes-devtools/python/python-native/multilib.patch new file mode 100644 index 0000000000..0526031ada --- /dev/null +++ b/meta/recipes-devtools/python/python-native/multilib.patch | |||
| @@ -0,0 +1,243 @@ | |||
| 1 | commit 248279e54467a8cd5cde98fc124d1d1384703513 | ||
| 2 | Author: Yu Ke <ke.yu@intel.com> | ||
| 3 | Date: Tue Jun 28 21:21:29 2011 +0800 | ||
| 4 | |||
| 5 | SUSE patch for the lib64 issue | ||
| 6 | |||
| 7 | see detail in http://bugs.python.org/issue1294959 | ||
| 8 | |||
| 9 | also rebased a bit for Yocto python 2.6.6 | ||
| 10 | |||
| 11 | Picked-by: Yu Ke <ke.yu@intel.com> | ||
| 12 | |||
| 13 | |||
| 14 | 2011/09/29 | ||
| 15 | The python recipe building was failing because python-native | ||
| 16 | could not handle sys.lib var. sys.lib var is defined in the | ||
| 17 | multilib patch hence added this multilib.patch for python-native | ||
| 18 | recipe. | ||
| 19 | |||
| 20 | Upstream-Status: Inappropriate [oe-specific] | ||
| 21 | |||
| 22 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
| 23 | |||
| 24 | Index: Python-2.7.2/Include/pythonrun.h | ||
| 25 | =================================================================== | ||
| 26 | --- Python-2.7.2.orig/Include/pythonrun.h | ||
| 27 | +++ Python-2.7.2/Include/pythonrun.h | ||
| 28 | @@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void); | ||
| 29 | /* In their own files */ | ||
| 30 | PyAPI_FUNC(const char *) Py_GetVersion(void); | ||
| 31 | PyAPI_FUNC(const char *) Py_GetPlatform(void); | ||
| 32 | +PyAPI_FUNC(const char *) Py_GetLib(void); | ||
| 33 | PyAPI_FUNC(const char *) Py_GetCopyright(void); | ||
| 34 | PyAPI_FUNC(const char *) Py_GetCompiler(void); | ||
| 35 | PyAPI_FUNC(const char *) Py_GetBuildInfo(void); | ||
| 36 | Index: Python-2.7.2/Lib/distutils/command/install.py | ||
| 37 | =================================================================== | ||
| 38 | --- Python-2.7.2.orig/Lib/distutils/command/install.py | ||
| 39 | +++ Python-2.7.2/Lib/distutils/command/install.py | ||
| 40 | @@ -22,6 +22,8 @@ from site import USER_BASE | ||
| 41 | from site import USER_SITE | ||
| 42 | |||
| 43 | |||
| 44 | +libname = sys.lib | ||
| 45 | + | ||
| 46 | if sys.version < "2.2": | ||
| 47 | WINDOWS_SCHEME = { | ||
| 48 | 'purelib': '$base', | ||
| 49 | @@ -42,7 +44,7 @@ else: | ||
| 50 | INSTALL_SCHEMES = { | ||
| 51 | 'unix_prefix': { | ||
| 52 | 'purelib': '$base/lib/python$py_version_short/site-packages', | ||
| 53 | - 'platlib': '$platbase/lib/python$py_version_short/site-packages', | ||
| 54 | + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', | ||
| 55 | 'headers': '$base/include/python$py_version_short/$dist_name', | ||
| 56 | 'scripts': '$base/bin', | ||
| 57 | 'data' : '$base', | ||
| 58 | Index: Python-2.7.2/Lib/pydoc.py | ||
| 59 | =================================================================== | ||
| 60 | --- Python-2.7.2.orig/Lib/pydoc.py | ||
| 61 | +++ Python-2.7.2/Lib/pydoc.py | ||
| 62 | @@ -352,7 +352,7 @@ class Doc: | ||
| 63 | |||
| 64 | docloc = os.environ.get("PYTHONDOCS", | ||
| 65 | "http://docs.python.org/library") | ||
| 66 | - basedir = os.path.join(sys.exec_prefix, "lib", | ||
| 67 | + basedir = os.path.join(sys.exec_prefix, sys.lib, | ||
| 68 | "python"+sys.version[0:3]) | ||
| 69 | if (isinstance(object, type(os)) and | ||
| 70 | (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', | ||
| 71 | Index: Python-2.7.2/Lib/site.py | ||
| 72 | =================================================================== | ||
| 73 | --- Python-2.7.2.orig/Lib/site.py | ||
| 74 | +++ Python-2.7.2/Lib/site.py | ||
| 75 | @@ -300,13 +300,19 @@ def getsitepackages(): | ||
| 76 | if sys.platform in ('os2emx', 'riscos'): | ||
| 77 | sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) | ||
| 78 | elif os.sep == '/': | ||
| 79 | - sitepackages.append(os.path.join(prefix, "lib", | ||
| 80 | + sitepackages.append(os.path.join(prefix, sys.lib, | ||
| 81 | "python" + sys.version[:3], | ||
| 82 | "site-packages")) | ||
| 83 | - sitepackages.append(os.path.join(prefix, "lib", "site-python")) | ||
| 84 | + if sys.lib != "lib": | ||
| 85 | + sitepackages.append(os.path.join(prefix, "lib", | ||
| 86 | + "python" + sys.version[:3], | ||
| 87 | + "site-packages")) | ||
| 88 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) | ||
| 89 | + if sys.lib != "lib": | ||
| 90 | + sitepackages.append(os.path.join(prefix, "lib", "site-python")) | ||
| 91 | else: | ||
| 92 | sitepackages.append(prefix) | ||
| 93 | - sitepackages.append(os.path.join(prefix, "lib", "site-packages")) | ||
| 94 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) | ||
| 95 | if sys.platform == "darwin": | ||
| 96 | # for framework builds *only* we add the standard Apple | ||
| 97 | # locations. | ||
| 98 | Index: Python-2.7.2/Lib/test/test_dl.py | ||
| 99 | =================================================================== | ||
| 100 | --- Python-2.7.2.orig/Lib/test/test_dl.py | ||
| 101 | +++ Python-2.7.2/Lib/test/test_dl.py | ||
| 102 | @@ -5,10 +5,11 @@ | ||
| 103 | import unittest | ||
| 104 | from test.test_support import verbose, import_module | ||
| 105 | dl = import_module('dl', deprecated=True) | ||
| 106 | +import sys | ||
| 107 | |||
| 108 | sharedlibs = [ | ||
| 109 | - ('/usr/lib/libc.so', 'getpid'), | ||
| 110 | - ('/lib/libc.so.6', 'getpid'), | ||
| 111 | + ('/usr/'+sys.lib+'/libc.so', 'getpid'), | ||
| 112 | + ('/'+sys.lib+'/libc.so.6', 'getpid'), | ||
| 113 | ('/usr/bin/cygwin1.dll', 'getpid'), | ||
| 114 | ('/usr/lib/libc.dylib', 'getpid'), | ||
| 115 | ] | ||
| 116 | Index: Python-2.7.2/Lib/trace.py | ||
| 117 | =================================================================== | ||
| 118 | --- Python-2.7.2.orig/Lib/trace.py | ||
| 119 | +++ Python-2.7.2/Lib/trace.py | ||
| 120 | @@ -762,10 +762,10 @@ def main(argv=None): | ||
| 121 | # should I also call expanduser? (after all, could use $HOME) | ||
| 122 | |||
| 123 | s = s.replace("$prefix", | ||
| 124 | - os.path.join(sys.prefix, "lib", | ||
| 125 | + os.path.join(sys.prefix, sys.lib, | ||
| 126 | "python" + sys.version[:3])) | ||
| 127 | s = s.replace("$exec_prefix", | ||
| 128 | - os.path.join(sys.exec_prefix, "lib", | ||
| 129 | + os.path.join(sys.exec_prefix, sys.lib, | ||
| 130 | "python" + sys.version[:3])) | ||
| 131 | s = os.path.normpath(s) | ||
| 132 | ignore_dirs.append(s) | ||
| 133 | Index: Python-2.7.2/Makefile.pre.in | ||
| 134 | =================================================================== | ||
| 135 | --- Python-2.7.2.orig/Makefile.pre.in | ||
| 136 | +++ Python-2.7.2/Makefile.pre.in | ||
| 137 | @@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG | ||
| 138 | |||
| 139 | # Machine-dependent subdirectories | ||
| 140 | MACHDEP= @MACHDEP@ | ||
| 141 | +LIB= @LIB@ | ||
| 142 | |||
| 143 | # Install prefix for architecture-independent files | ||
| 144 | prefix= @prefix@ | ||
| 145 | @@ -97,7 +98,7 @@ LIBDIR= @libdir@ | ||
| 146 | MANDIR= @mandir@ | ||
| 147 | INCLUDEDIR= @includedir@ | ||
| 148 | CONFINCLUDEDIR= $(exec_prefix)/include | ||
| 149 | -SCRIPTDIR= $(prefix)/lib | ||
| 150 | +SCRIPTDIR= $(prefix)/@LIB@ | ||
| 151 | |||
| 152 | # Detailed destination directories | ||
| 153 | BINLIBDEST= $(LIBDIR)/python$(VERSION) | ||
| 154 | @@ -532,6 +533,7 @@ Modules/getpath.o: $(srcdir)/Modules/get | ||
| 155 | -DEXEC_PREFIX='"$(exec_prefix)"' \ | ||
| 156 | -DVERSION='"$(VERSION)"' \ | ||
| 157 | -DVPATH='"$(VPATH)"' \ | ||
| 158 | + -DLIB='"$(LIB)"' \ | ||
| 159 | -o $@ $(srcdir)/Modules/getpath.c | ||
| 160 | |||
| 161 | Modules/python.o: $(srcdir)/Modules/python.c | ||
| 162 | @@ -566,7 +568,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) | ||
| 163 | Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) | ||
| 164 | |||
| 165 | Python/getplatform.o: $(srcdir)/Python/getplatform.c | ||
| 166 | - $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c | ||
| 167 | + $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c | ||
| 168 | |||
| 169 | Python/importdl.o: $(srcdir)/Python/importdl.c | ||
| 170 | $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c | ||
| 171 | Index: Python-2.7.2/Modules/getpath.c | ||
| 172 | =================================================================== | ||
| 173 | --- Python-2.7.2.orig/Modules/getpath.c | ||
| 174 | +++ Python-2.7.2/Modules/getpath.c | ||
| 175 | @@ -116,9 +116,11 @@ | ||
| 176 | #define EXEC_PREFIX PREFIX | ||
| 177 | #endif | ||
| 178 | |||
| 179 | +#define LIB_PYTHON LIB "/python" VERSION | ||
| 180 | + | ||
| 181 | #ifndef PYTHONPATH | ||
| 182 | -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ | ||
| 183 | - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" | ||
| 184 | +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ | ||
| 185 | + EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" | ||
| 186 | #endif | ||
| 187 | |||
| 188 | #ifndef LANDMARK | ||
| 189 | @@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1]; | ||
| 190 | static char exec_prefix[MAXPATHLEN+1]; | ||
| 191 | static char progpath[MAXPATHLEN+1]; | ||
| 192 | static char *module_search_path = NULL; | ||
| 193 | -static char lib_python[] = "lib/python" VERSION; | ||
| 194 | +static char lib_python[] = LIB_PYTHON; | ||
| 195 | |||
| 196 | static void | ||
| 197 | reduce(char *dir) | ||
| 198 | Index: Python-2.7.2/Python/getplatform.c | ||
| 199 | =================================================================== | ||
| 200 | --- Python-2.7.2.orig/Python/getplatform.c | ||
| 201 | +++ Python-2.7.2/Python/getplatform.c | ||
| 202 | @@ -10,3 +10,13 @@ Py_GetPlatform(void) | ||
| 203 | { | ||
| 204 | return PLATFORM; | ||
| 205 | } | ||
| 206 | + | ||
| 207 | +#ifndef LIB | ||
| 208 | +#define LIB "lib" | ||
| 209 | +#endif | ||
| 210 | + | ||
| 211 | +const char * | ||
| 212 | +Py_GetLib(void) | ||
| 213 | +{ | ||
| 214 | + return LIB; | ||
| 215 | +} | ||
| 216 | Index: Python-2.7.2/Python/sysmodule.c | ||
| 217 | =================================================================== | ||
| 218 | --- Python-2.7.2.orig/Python/sysmodule.c | ||
| 219 | +++ Python-2.7.2/Python/sysmodule.c | ||
| 220 | @@ -1416,6 +1416,8 @@ _PySys_Init(void) | ||
| 221 | PyString_FromString(Py_GetCopyright())); | ||
| 222 | SET_SYS_FROM_STRING("platform", | ||
| 223 | PyString_FromString(Py_GetPlatform())); | ||
| 224 | + SET_SYS_FROM_STRING("lib", | ||
| 225 | + PyString_FromString(Py_GetLib())); | ||
| 226 | SET_SYS_FROM_STRING("executable", | ||
| 227 | PyString_FromString(Py_GetProgramFullPath())); | ||
| 228 | SET_SYS_FROM_STRING("prefix", | ||
| 229 | Index: Python-2.7.2/configure.in | ||
| 230 | =================================================================== | ||
| 231 | --- Python-2.7.2.orig/configure.in | ||
| 232 | +++ Python-2.7.2/configure.in | ||
| 233 | @@ -629,6 +629,10 @@ SunOS*) | ||
| 234 | ;; | ||
| 235 | esac | ||
| 236 | |||
| 237 | +AC_SUBST(LIB) | ||
| 238 | +AC_MSG_CHECKING(LIB) | ||
| 239 | +LIB=`basename ${libdir}` | ||
| 240 | +AC_MSG_RESULT($LIB) | ||
| 241 | |||
| 242 | AC_SUBST(LIBRARY) | ||
| 243 | AC_MSG_CHECKING(LIBRARY) | ||
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..09c3fb808a --- /dev/null +++ b/meta/recipes-devtools/python/python-native/nohostlibs.patch | |||
| @@ -0,0 +1,67 @@ | |||
| 1 | Upstream-Status: Inappropriate [embedded specific] | ||
| 2 | |||
| 3 | 2011/09/29 | ||
| 4 | rebased for python-2.7.2 | ||
| 5 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
| 6 | |||
| 7 | Index: Python-2.7.2/setup.py | ||
| 8 | =================================================================== | ||
| 9 | --- Python-2.7.2.orig/setup.py | ||
| 10 | +++ Python-2.7.2/setup.py | ||
| 11 | @@ -369,8 +369,8 @@ class PyBuildExt(build_ext): | ||
| 12 | |||
| 13 | def detect_modules(self): | ||
| 14 | # Ensure that /usr/local is always used | ||
| 15 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
| 16 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
| 17 | + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
| 18 | + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
| 19 | self.add_multiarch_paths() | ||
| 20 | |||
| 21 | # Add paths specified in the environment variables LDFLAGS and | ||
| 22 | @@ -407,15 +407,15 @@ class PyBuildExt(build_ext): | ||
| 23 | for directory in reversed(options.dirs): | ||
| 24 | add_dir_to_list(dir_list, directory) | ||
| 25 | |||
| 26 | - if os.path.normpath(sys.prefix) != '/usr' \ | ||
| 27 | - and not sysconfig.get_config_var('PYTHONFRAMEWORK'): | ||
| 28 | + #if os.path.normpath(sys.prefix) != '/usr' \ | ||
| 29 | + #and not sysconfig.get_config_var('PYTHONFRAMEWORK'): | ||
| 30 | # OSX note: Don't add LIBDIR and INCLUDEDIR to building a framework | ||
| 31 | # (PYTHONFRAMEWORK is set) to avoid # linking problems when | ||
| 32 | # building a framework with different architectures than | ||
| 33 | # the one that is currently installed (issue #7473) | ||
| 34 | - add_dir_to_list(self.compiler.library_dirs, | ||
| 35 | + add_dir_to_list(self.compiler.library_dirs, | ||
| 36 | sysconfig.get_config_var("LIBDIR")) | ||
| 37 | - add_dir_to_list(self.compiler.include_dirs, | ||
| 38 | + add_dir_to_list(self.compiler.include_dirs, | ||
| 39 | sysconfig.get_config_var("INCLUDEDIR")) | ||
| 40 | |||
| 41 | try: | ||
| 42 | @@ -426,11 +426,8 @@ class PyBuildExt(build_ext): | ||
| 43 | # lib_dirs and inc_dirs are used to search for files; | ||
| 44 | # if a file is found in one of those directories, it can | ||
| 45 | # be assumed that no additional -I,-L directives are needed. | ||
| 46 | - lib_dirs = self.compiler.library_dirs + [ | ||
| 47 | - '/lib64', '/usr/lib64', | ||
| 48 | - '/lib', '/usr/lib', | ||
| 49 | - ] | ||
| 50 | - inc_dirs = self.compiler.include_dirs + ['/usr/include'] | ||
| 51 | + lib_dirs = self.compiler.library_dirs | ||
| 52 | + inc_dirs = self.compiler.include_dirs | ||
| 53 | exts = [] | ||
| 54 | missing = [] | ||
| 55 | |||
| 56 | @@ -676,9 +673,8 @@ class PyBuildExt(build_ext): | ||
| 57 | pass # Issue 7384: Already linked against curses or tinfo. | ||
| 58 | elif curses_library: | ||
| 59 | readline_libs.append(curses_library) | ||
| 60 | - elif self.compiler.find_library_file(lib_dirs + | ||
| 61 | - ['/usr/lib/termcap'], | ||
| 62 | - 'termcap'): | ||
| 63 | + elif self.compiler.find_library_file(lib_dirs, | ||
| 64 | + 'termcap'): | ||
| 65 | readline_libs.append('termcap') | ||
| 66 | exts.append( Extension('readline', ['readline.c'], | ||
| 67 | library_dirs=['/usr/lib/termcap'], | ||
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 | |||
| 10 | import os | ||
| 11 | |||
| 12 | def __exithandler(): | ||
| 13 | try: | ||
| 14 | readline.write_history_file( "%s/.python-history" % os.getenv( "HOME", "/tmp" ) ) | ||
| 15 | except IOError: | ||
| 16 | pass | ||
| 17 | |||
| 18 | def __registerExitHandler(): | ||
| 19 | import atexit | ||
| 20 | atexit.register( __exithandler ) | ||
| 21 | |||
| 22 | def __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 | |||
| 30 | def __enableDefaultEncoding(): | ||
| 31 | import sys | ||
| 32 | try: | ||
| 33 | sys.setdefaultencoding( "utf8" ) | ||
| 34 | except LookupError: | ||
| 35 | pass | ||
| 36 | |||
| 37 | import sys | ||
| 38 | try: | ||
| 39 | import rlcompleter, readline | ||
| 40 | except ImportError: | ||
| 41 | pass | ||
| 42 | else: | ||
| 43 | __enableDefaultEncoding() | ||
| 44 | __registerExitHandler() | ||
| 45 | __enableReadlineSupport() | ||
diff --git a/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch b/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch new file mode 100644 index 0000000000..1cb8fea50f --- /dev/null +++ b/meta/recipes-devtools/python/python-native/sys_platform_is_now_always_linux2.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | Upstream-Status: Accepted [http://hg.python.org/cpython/rev/c816479f6aaf/] | ||
| 2 | Bugtracker: http://bugs.python.org/issue12326 | ||
| 3 | |||
| 4 | [Removed "Misc/NEWS" hunk] | ||
| 5 | |||
| 6 | Signed-off-by: Andreas Oberritter <obi@opendreambox.org> | ||
| 7 | |||
| 8 | # HG changeset patch | ||
| 9 | # User Victor Stinner <victor.stinner@haypocalc.com> | ||
| 10 | # Date 1313841758 -7200 | ||
| 11 | # Node ID c816479f6aaf71dbd3f3fe4b239186d60c55ce48 | ||
| 12 | # Parent 3e093590ac57fdda428c7da3f72ddf0c475ecf2b | ||
| 13 | Issue #12326: sys.platform is now always 'linux2' on Linux | ||
| 14 | |||
| 15 | Even if Python is compiled on Linux 3. | ||
| 16 | |||
| 17 | diff --git a/configure.in b/configure.in | ||
| 18 | --- a/configure.in | ||
| 19 | +++ b/configure.in | ||
| 20 | @@ -293,6 +293,7 @@ then | ||
| 21 | MACHDEP="$ac_md_system$ac_md_release" | ||
| 22 | |||
| 23 | case $MACHDEP in | ||
| 24 | + linux*) MACHDEP="linux2";; | ||
| 25 | cygwin*) MACHDEP="cygwin";; | ||
| 26 | darwin*) MACHDEP="darwin";; | ||
| 27 | atheos*) MACHDEP="atheos";; | ||
| 28 | |||
diff --git a/meta/recipes-devtools/python/python-native/unixccompiler.patch b/meta/recipes-devtools/python/python-native/unixccompiler.patch new file mode 100644 index 0000000000..4502829129 --- /dev/null +++ b/meta/recipes-devtools/python/python-native/unixccompiler.patch | |||
| @@ -0,0 +1,20 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | The CC variable,sometimes like:"x86_64-poky-linux-gcc -m64 --sysroot=/${TMPDIR}/sysroots/qemux86-64", contains option information. | ||
| 4 | This will lead to wrong compiler name "qemux86-64" rather than "x86_64-poky-linux-gcc" when python finding the compiler name. | ||
| 5 | |||
| 6 | Signed-off-by: Mei Lei <lei.mei@intel.com> | ||
| 7 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 8 | Index: Python-2.7.2/Lib/distutils/unixccompiler.py | ||
| 9 | =================================================================== | ||
| 10 | --- Python-2.7.2.orig/Lib/distutils/unixccompiler.py 2011-11-24 13:51:10.539998722 -0800 | ||
| 11 | +++ Python-2.7.2/Lib/distutils/unixccompiler.py 2011-11-24 15:54:36.872137766 -0800 | ||
| 12 | @@ -282,7 +282,7 @@ | ||
| 13 | # this time, there's no way to determine this information from | ||
| 14 | # the configuration data stored in the Python installation, so | ||
| 15 | # we use this hack. | ||
| 16 | - compiler = os.path.basename(sysconfig.get_config_var("CC")) | ||
| 17 | + compiler = sysconfig.get_config_var("CC") | ||
| 18 | if sys.platform[:6] == "darwin": | ||
| 19 | # MacOSX's linker doesn't understand the -R flag at all | ||
| 20 | return "-L" + dir | ||
