diff options
Diffstat (limited to 'meta/recipes-devtools/python/python-native')
-rw-r--r-- | meta/recipes-devtools/python/python-native/multilib.patch | 240 | ||||
-rw-r--r-- | meta/recipes-devtools/python/python-native/nohostlibs.patch | 36 |
2 files changed, 264 insertions, 12 deletions
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..f8d7aee84b --- /dev/null +++ b/meta/recipes-devtools/python/python-native/multilib.patch | |||
@@ -0,0 +1,240 @@ | |||
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 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> | ||
20 | |||
21 | Index: Python-2.7.2/Include/pythonrun.h | ||
22 | =================================================================== | ||
23 | --- Python-2.7.2.orig/Include/pythonrun.h | ||
24 | +++ Python-2.7.2/Include/pythonrun.h | ||
25 | @@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void); | ||
26 | /* In their own files */ | ||
27 | PyAPI_FUNC(const char *) Py_GetVersion(void); | ||
28 | PyAPI_FUNC(const char *) Py_GetPlatform(void); | ||
29 | +PyAPI_FUNC(const char *) Py_GetLib(void); | ||
30 | PyAPI_FUNC(const char *) Py_GetCopyright(void); | ||
31 | PyAPI_FUNC(const char *) Py_GetCompiler(void); | ||
32 | PyAPI_FUNC(const char *) Py_GetBuildInfo(void); | ||
33 | Index: Python-2.7.2/Lib/distutils/command/install.py | ||
34 | =================================================================== | ||
35 | --- Python-2.7.2.orig/Lib/distutils/command/install.py | ||
36 | +++ Python-2.7.2/Lib/distutils/command/install.py | ||
37 | @@ -22,6 +22,8 @@ from site import USER_BASE | ||
38 | from site import USER_SITE | ||
39 | |||
40 | |||
41 | +libname = sys.lib | ||
42 | + | ||
43 | if sys.version < "2.2": | ||
44 | WINDOWS_SCHEME = { | ||
45 | 'purelib': '$base', | ||
46 | @@ -42,7 +44,7 @@ else: | ||
47 | INSTALL_SCHEMES = { | ||
48 | 'unix_prefix': { | ||
49 | 'purelib': '$base/lib/python$py_version_short/site-packages', | ||
50 | - 'platlib': '$platbase/lib/python$py_version_short/site-packages', | ||
51 | + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', | ||
52 | 'headers': '$base/include/python$py_version_short/$dist_name', | ||
53 | 'scripts': '$base/bin', | ||
54 | 'data' : '$base', | ||
55 | Index: Python-2.7.2/Lib/pydoc.py | ||
56 | =================================================================== | ||
57 | --- Python-2.7.2.orig/Lib/pydoc.py | ||
58 | +++ Python-2.7.2/Lib/pydoc.py | ||
59 | @@ -352,7 +352,7 @@ class Doc: | ||
60 | |||
61 | docloc = os.environ.get("PYTHONDOCS", | ||
62 | "http://docs.python.org/library") | ||
63 | - basedir = os.path.join(sys.exec_prefix, "lib", | ||
64 | + basedir = os.path.join(sys.exec_prefix, sys.lib, | ||
65 | "python"+sys.version[0:3]) | ||
66 | if (isinstance(object, type(os)) and | ||
67 | (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', | ||
68 | Index: Python-2.7.2/Lib/site.py | ||
69 | =================================================================== | ||
70 | --- Python-2.7.2.orig/Lib/site.py | ||
71 | +++ Python-2.7.2/Lib/site.py | ||
72 | @@ -300,13 +300,19 @@ def getsitepackages(): | ||
73 | if sys.platform in ('os2emx', 'riscos'): | ||
74 | sitepackages.append(os.path.join(prefix, "Lib", "site-packages")) | ||
75 | elif os.sep == '/': | ||
76 | - sitepackages.append(os.path.join(prefix, "lib", | ||
77 | + sitepackages.append(os.path.join(prefix, sys.lib, | ||
78 | "python" + sys.version[:3], | ||
79 | "site-packages")) | ||
80 | - sitepackages.append(os.path.join(prefix, "lib", "site-python")) | ||
81 | + if sys.lib != "lib": | ||
82 | + sitepackages.append(os.path.join(prefix, "lib", | ||
83 | + "python" + sys.version[:3], | ||
84 | + "site-packages")) | ||
85 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-python")) | ||
86 | + if sys.lib != "lib": | ||
87 | + sitepackages.append(os.path.join(prefix, "lib", "site-python")) | ||
88 | else: | ||
89 | sitepackages.append(prefix) | ||
90 | - sitepackages.append(os.path.join(prefix, "lib", "site-packages")) | ||
91 | + sitepackages.append(os.path.join(prefix, sys.lib, "site-packages")) | ||
92 | if sys.platform == "darwin": | ||
93 | # for framework builds *only* we add the standard Apple | ||
94 | # locations. | ||
95 | Index: Python-2.7.2/Lib/test/test_dl.py | ||
96 | =================================================================== | ||
97 | --- Python-2.7.2.orig/Lib/test/test_dl.py | ||
98 | +++ Python-2.7.2/Lib/test/test_dl.py | ||
99 | @@ -5,10 +5,11 @@ | ||
100 | import unittest | ||
101 | from test.test_support import verbose, import_module | ||
102 | dl = import_module('dl', deprecated=True) | ||
103 | +import sys | ||
104 | |||
105 | sharedlibs = [ | ||
106 | - ('/usr/lib/libc.so', 'getpid'), | ||
107 | - ('/lib/libc.so.6', 'getpid'), | ||
108 | + ('/usr/'+sys.lib+'/libc.so', 'getpid'), | ||
109 | + ('/'+sys.lib+'/libc.so.6', 'getpid'), | ||
110 | ('/usr/bin/cygwin1.dll', 'getpid'), | ||
111 | ('/usr/lib/libc.dylib', 'getpid'), | ||
112 | ] | ||
113 | Index: Python-2.7.2/Lib/trace.py | ||
114 | =================================================================== | ||
115 | --- Python-2.7.2.orig/Lib/trace.py | ||
116 | +++ Python-2.7.2/Lib/trace.py | ||
117 | @@ -762,10 +762,10 @@ def main(argv=None): | ||
118 | # should I also call expanduser? (after all, could use $HOME) | ||
119 | |||
120 | s = s.replace("$prefix", | ||
121 | - os.path.join(sys.prefix, "lib", | ||
122 | + os.path.join(sys.prefix, sys.lib, | ||
123 | "python" + sys.version[:3])) | ||
124 | s = s.replace("$exec_prefix", | ||
125 | - os.path.join(sys.exec_prefix, "lib", | ||
126 | + os.path.join(sys.exec_prefix, sys.lib, | ||
127 | "python" + sys.version[:3])) | ||
128 | s = os.path.normpath(s) | ||
129 | ignore_dirs.append(s) | ||
130 | Index: Python-2.7.2/Makefile.pre.in | ||
131 | =================================================================== | ||
132 | --- Python-2.7.2.orig/Makefile.pre.in | ||
133 | +++ Python-2.7.2/Makefile.pre.in | ||
134 | @@ -81,6 +81,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG | ||
135 | |||
136 | # Machine-dependent subdirectories | ||
137 | MACHDEP= @MACHDEP@ | ||
138 | +LIB= @LIB@ | ||
139 | |||
140 | # Install prefix for architecture-independent files | ||
141 | prefix= @prefix@ | ||
142 | @@ -97,7 +98,7 @@ LIBDIR= @libdir@ | ||
143 | MANDIR= @mandir@ | ||
144 | INCLUDEDIR= @includedir@ | ||
145 | CONFINCLUDEDIR= $(exec_prefix)/include | ||
146 | -SCRIPTDIR= $(prefix)/lib | ||
147 | +SCRIPTDIR= $(prefix)/@LIB@ | ||
148 | |||
149 | # Detailed destination directories | ||
150 | BINLIBDEST= $(LIBDIR)/python$(VERSION) | ||
151 | @@ -532,6 +533,7 @@ Modules/getpath.o: $(srcdir)/Modules/get | ||
152 | -DEXEC_PREFIX='"$(exec_prefix)"' \ | ||
153 | -DVERSION='"$(VERSION)"' \ | ||
154 | -DVPATH='"$(VPATH)"' \ | ||
155 | + -DLIB='"$(LIB)"' \ | ||
156 | -o $@ $(srcdir)/Modules/getpath.c | ||
157 | |||
158 | Modules/python.o: $(srcdir)/Modules/python.c | ||
159 | @@ -566,7 +568,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) | ||
160 | Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) | ||
161 | |||
162 | Python/getplatform.o: $(srcdir)/Python/getplatform.c | ||
163 | - $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c | ||
164 | + $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c | ||
165 | |||
166 | Python/importdl.o: $(srcdir)/Python/importdl.c | ||
167 | $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c | ||
168 | Index: Python-2.7.2/Modules/getpath.c | ||
169 | =================================================================== | ||
170 | --- Python-2.7.2.orig/Modules/getpath.c | ||
171 | +++ Python-2.7.2/Modules/getpath.c | ||
172 | @@ -116,9 +116,11 @@ | ||
173 | #define EXEC_PREFIX PREFIX | ||
174 | #endif | ||
175 | |||
176 | +#define LIB_PYTHON LIB "/python" VERSION | ||
177 | + | ||
178 | #ifndef PYTHONPATH | ||
179 | -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ | ||
180 | - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" | ||
181 | +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ | ||
182 | + EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" | ||
183 | #endif | ||
184 | |||
185 | #ifndef LANDMARK | ||
186 | @@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1]; | ||
187 | static char exec_prefix[MAXPATHLEN+1]; | ||
188 | static char progpath[MAXPATHLEN+1]; | ||
189 | static char *module_search_path = NULL; | ||
190 | -static char lib_python[] = "lib/python" VERSION; | ||
191 | +static char lib_python[] = LIB_PYTHON; | ||
192 | |||
193 | static void | ||
194 | reduce(char *dir) | ||
195 | Index: Python-2.7.2/Python/getplatform.c | ||
196 | =================================================================== | ||
197 | --- Python-2.7.2.orig/Python/getplatform.c | ||
198 | +++ Python-2.7.2/Python/getplatform.c | ||
199 | @@ -10,3 +10,13 @@ Py_GetPlatform(void) | ||
200 | { | ||
201 | return PLATFORM; | ||
202 | } | ||
203 | + | ||
204 | +#ifndef LIB | ||
205 | +#define LIB "lib" | ||
206 | +#endif | ||
207 | + | ||
208 | +const char * | ||
209 | +Py_GetLib(void) | ||
210 | +{ | ||
211 | + return LIB; | ||
212 | +} | ||
213 | Index: Python-2.7.2/Python/sysmodule.c | ||
214 | =================================================================== | ||
215 | --- Python-2.7.2.orig/Python/sysmodule.c | ||
216 | +++ Python-2.7.2/Python/sysmodule.c | ||
217 | @@ -1416,6 +1416,8 @@ _PySys_Init(void) | ||
218 | PyString_FromString(Py_GetCopyright())); | ||
219 | SET_SYS_FROM_STRING("platform", | ||
220 | PyString_FromString(Py_GetPlatform())); | ||
221 | + SET_SYS_FROM_STRING("lib", | ||
222 | + PyString_FromString(Py_GetLib())); | ||
223 | SET_SYS_FROM_STRING("executable", | ||
224 | PyString_FromString(Py_GetProgramFullPath())); | ||
225 | SET_SYS_FROM_STRING("prefix", | ||
226 | Index: Python-2.7.2/configure.in | ||
227 | =================================================================== | ||
228 | --- Python-2.7.2.orig/configure.in | ||
229 | +++ Python-2.7.2/configure.in | ||
230 | @@ -629,6 +629,10 @@ SunOS*) | ||
231 | ;; | ||
232 | esac | ||
233 | |||
234 | +AC_SUBST(LIB) | ||
235 | +AC_MSG_CHECKING(LIB) | ||
236 | +LIB=`basename ${libdir}` | ||
237 | +AC_MSG_RESULT($LIB) | ||
238 | |||
239 | AC_SUBST(LIBRARY) | ||
240 | AC_MSG_CHECKING(LIBRARY) | ||
diff --git a/meta/recipes-devtools/python/python-native/nohostlibs.patch b/meta/recipes-devtools/python/python-native/nohostlibs.patch index aed45c9913..09c3fb808a 100644 --- a/meta/recipes-devtools/python/python-native/nohostlibs.patch +++ b/meta/recipes-devtools/python/python-native/nohostlibs.patch | |||
@@ -1,10 +1,14 @@ | |||
1 | Upstream-Status: Inappropriate [embedded specific] | 1 | Upstream-Status: Inappropriate [embedded specific] |
2 | 2 | ||
3 | Index: Python-2.6.6/setup.py | 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 | ||
4 | =================================================================== | 8 | =================================================================== |
5 | --- Python-2.6.6.orig/setup.py | 9 | --- Python-2.7.2.orig/setup.py |
6 | +++ Python-2.6.6/setup.py | 10 | +++ Python-2.7.2/setup.py |
7 | @@ -356,8 +356,8 @@ class PyBuildExt(build_ext): | 11 | @@ -369,8 +369,8 @@ class PyBuildExt(build_ext): |
8 | 12 | ||
9 | def detect_modules(self): | 13 | def detect_modules(self): |
10 | # Ensure that /usr/local is always used | 14 | # Ensure that /usr/local is always used |
@@ -12,16 +16,22 @@ Index: Python-2.6.6/setup.py | |||
12 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 16 | - add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') |
13 | + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | 17 | + #add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') |
14 | + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 18 | + #add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') |
19 | self.add_multiarch_paths() | ||
15 | 20 | ||
16 | # Add paths specified in the environment variables LDFLAGS and | 21 | # Add paths specified in the environment variables LDFLAGS and |
17 | # CPPFLAGS for header and library files. | 22 | @@ -407,15 +407,15 @@ class PyBuildExt(build_ext): |
18 | @@ -393,10 +393,10 @@ class PyBuildExt(build_ext): | ||
19 | for directory in reversed(options.dirs): | 23 | for directory in reversed(options.dirs): |
20 | add_dir_to_list(dir_list, directory) | 24 | add_dir_to_list(dir_list, directory) |
21 | 25 | ||
22 | - if os.path.normpath(sys.prefix) != '/usr': | 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) | ||
23 | - add_dir_to_list(self.compiler.library_dirs, | 34 | - add_dir_to_list(self.compiler.library_dirs, |
24 | + | ||
25 | + add_dir_to_list(self.compiler.library_dirs, | 35 | + add_dir_to_list(self.compiler.library_dirs, |
26 | sysconfig.get_config_var("LIBDIR")) | 36 | sysconfig.get_config_var("LIBDIR")) |
27 | - add_dir_to_list(self.compiler.include_dirs, | 37 | - add_dir_to_list(self.compiler.include_dirs, |
@@ -29,7 +39,7 @@ Index: Python-2.6.6/setup.py | |||
29 | sysconfig.get_config_var("INCLUDEDIR")) | 39 | sysconfig.get_config_var("INCLUDEDIR")) |
30 | 40 | ||
31 | try: | 41 | try: |
32 | @@ -407,11 +407,8 @@ class PyBuildExt(build_ext): | 42 | @@ -426,11 +426,8 @@ class PyBuildExt(build_ext): |
33 | # lib_dirs and inc_dirs are used to search for files; | 43 | # lib_dirs and inc_dirs are used to search for files; |
34 | # if a file is found in one of those directories, it can | 44 | # if a file is found in one of those directories, it can |
35 | # be assumed that no additional -I,-L directives are needed. | 45 | # be assumed that no additional -I,-L directives are needed. |
@@ -43,13 +53,15 @@ Index: Python-2.6.6/setup.py | |||
43 | exts = [] | 53 | exts = [] |
44 | missing = [] | 54 | missing = [] |
45 | 55 | ||
46 | @@ -661,8 +658,7 @@ class PyBuildExt(build_ext): | 56 | @@ -676,9 +673,8 @@ class PyBuildExt(build_ext): |
47 | pass # Issue 7384: Already linked against curses or tinfo. | 57 | pass # Issue 7384: Already linked against curses or tinfo. |
48 | elif curses_library: | 58 | elif curses_library: |
49 | readline_libs.append(curses_library) | 59 | readline_libs.append(curses_library) |
50 | - elif self.compiler.find_library_file(lib_dirs + | 60 | - elif self.compiler.find_library_file(lib_dirs + |
51 | - ['/usr/lib/termcap'], | 61 | - ['/usr/lib/termcap'], |
62 | - 'termcap'): | ||
52 | + elif self.compiler.find_library_file(lib_dirs, | 63 | + elif self.compiler.find_library_file(lib_dirs, |
53 | 'termcap'): | 64 | + 'termcap'): |
54 | readline_libs.append('termcap') | 65 | readline_libs.append('termcap') |
55 | exts.append( Extension('readline', ['readline.c'], | 66 | exts.append( Extension('readline', ['readline.c'], |
67 | library_dirs=['/usr/lib/termcap'], | ||