diff options
Diffstat (limited to 'meta/recipes-devtools/python/python3/python-3.3-multilib.patch')
-rw-r--r-- | meta/recipes-devtools/python/python3/python-3.3-multilib.patch | 363 |
1 files changed, 0 insertions, 363 deletions
diff --git a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch b/meta/recipes-devtools/python/python3/python-3.3-multilib.patch deleted file mode 100644 index cc35dc1617..0000000000 --- a/meta/recipes-devtools/python/python3/python-3.3-multilib.patch +++ /dev/null | |||
@@ -1,363 +0,0 @@ | |||
1 | From 51fe6f22d0ba113674fb358bd11d75fe659bd26e Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Tue, 14 May 2013 15:00:26 -0700 | ||
4 | Subject: [PATCH 01/13] get the sys.lib from python itself and do not use | ||
5 | hardcoded value of 'lib' | ||
6 | |||
7 | 02/2015 Rebased for 3.4.2 | ||
8 | |||
9 | Upstream-Status: Pending | ||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> | ||
12 | |||
13 | --- | ||
14 | Include/pythonrun.h | 3 +++ | ||
15 | Lib/distutils/command/install.py | 4 +++- | ||
16 | Lib/pydoc.py | 2 +- | ||
17 | Lib/site.py | 4 ++-- | ||
18 | Lib/sysconfig.py | 18 +++++++++--------- | ||
19 | Lib/trace.py | 4 ++-- | ||
20 | Makefile.pre.in | 7 +++++-- | ||
21 | Modules/getpath.c | 10 +++++++++- | ||
22 | Python/getplatform.c | 20 ++++++++++++++++++++ | ||
23 | Python/sysmodule.c | 4 ++++ | ||
24 | configure.ac | 35 +++++++++++++++++++++++++++++++++++ | ||
25 | setup.py | 9 ++++----- | ||
26 | 12 files changed, 97 insertions(+), 23 deletions(-) | ||
27 | |||
28 | Index: Python-3.5.4/Include/pythonrun.h | ||
29 | =================================================================== | ||
30 | --- Python-3.5.4.orig/Include/pythonrun.h | ||
31 | +++ Python-3.5.4/Include/pythonrun.h | ||
32 | @@ -23,6 +23,9 @@ typedef struct { | ||
33 | } PyCompilerFlags; | ||
34 | #endif | ||
35 | |||
36 | +PyAPI_FUNC(const char *) Py_GetArch(void); | ||
37 | +PyAPI_FUNC(const char *) Py_GetLib(void); | ||
38 | + | ||
39 | #ifndef Py_LIMITED_API | ||
40 | PyAPI_FUNC(int) PyRun_SimpleStringFlags(const char *, PyCompilerFlags *); | ||
41 | PyAPI_FUNC(int) PyRun_AnyFileFlags(FILE *, const char *, PyCompilerFlags *); | ||
42 | Index: Python-3.5.4/Lib/distutils/command/install.py | ||
43 | =================================================================== | ||
44 | --- Python-3.5.4.orig/Lib/distutils/command/install.py | ||
45 | +++ Python-3.5.4/Lib/distutils/command/install.py | ||
46 | @@ -19,6 +19,8 @@ from site import USER_BASE | ||
47 | from site import USER_SITE | ||
48 | HAS_USER_SITE = True | ||
49 | |||
50 | +libname = sys.lib | ||
51 | + | ||
52 | WINDOWS_SCHEME = { | ||
53 | 'purelib': '$base/Lib/site-packages', | ||
54 | 'platlib': '$base/Lib/site-packages', | ||
55 | @@ -29,8 +31,8 @@ WINDOWS_SCHEME = { | ||
56 | |||
57 | INSTALL_SCHEMES = { | ||
58 | 'unix_prefix': { | ||
59 | - 'purelib': '$base/lib/python$py_version_short/site-packages', | ||
60 | - 'platlib': '$platbase/lib/python$py_version_short/site-packages', | ||
61 | + 'purelib': '$platbase/'+libname+'/python$py_version_short/site-packages', | ||
62 | + 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages', | ||
63 | 'headers': '$base/include/python$py_version_short$abiflags/$dist_name', | ||
64 | 'scripts': '$base/bin', | ||
65 | 'data' : '$base', | ||
66 | Index: Python-3.5.4/Lib/pydoc.py | ||
67 | =================================================================== | ||
68 | --- Python-3.5.4.orig/Lib/pydoc.py | ||
69 | +++ Python-3.5.4/Lib/pydoc.py | ||
70 | @@ -389,7 +389,7 @@ class Doc: | ||
71 | docmodule = docclass = docroutine = docother = docproperty = docdata = fail | ||
72 | |||
73 | def getdocloc(self, object, | ||
74 | - basedir=os.path.join(sys.base_exec_prefix, "lib", | ||
75 | + basedir=os.path.join(sys.base_exec_prefix, sys.lib, | ||
76 | "python%d.%d" % sys.version_info[:2])): | ||
77 | """Return the location of module docs or None""" | ||
78 | |||
79 | Index: Python-3.5.4/Lib/site.py | ||
80 | =================================================================== | ||
81 | --- Python-3.5.4.orig/Lib/site.py | ||
82 | +++ Python-3.5.4/Lib/site.py | ||
83 | @@ -303,12 +303,12 @@ def getsitepackages(prefixes=None): | ||
84 | seen.add(prefix) | ||
85 | |||
86 | if os.sep == '/': | ||
87 | - sitepackages.append(os.path.join(prefix, "lib", | ||
88 | + sitepackages.append(os.path.join(prefix, sys.lib, | ||
89 | "python" + sys.version[:3], | ||
90 | "site-packages")) | ||
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-3.5.4/Lib/sysconfig.py | ||
99 | =================================================================== | ||
100 | --- Python-3.5.4.orig/Lib/sysconfig.py | ||
101 | +++ Python-3.5.4/Lib/sysconfig.py | ||
102 | @@ -20,10 +20,10 @@ __all__ = [ | ||
103 | |||
104 | _INSTALL_SCHEMES = { | ||
105 | 'posix_prefix': { | ||
106 | - 'stdlib': '{installed_base}/lib/python{py_version_short}', | ||
107 | - 'platstdlib': '{platbase}/lib/python{py_version_short}', | ||
108 | - 'purelib': '{base}/lib/python{py_version_short}/site-packages', | ||
109 | - 'platlib': '{platbase}/lib/python{py_version_short}/site-packages', | ||
110 | + 'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}', | ||
111 | + 'platstdlib': '{platbase}/'+sys.lib+'/python{py_version_short}', | ||
112 | + 'purelib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
113 | + 'platlib': '{platbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
114 | 'include': | ||
115 | '{installed_base}/include/python{py_version_short}{abiflags}', | ||
116 | 'platinclude': | ||
117 | @@ -32,10 +32,10 @@ _INSTALL_SCHEMES = { | ||
118 | 'data': '{base}', | ||
119 | }, | ||
120 | 'posix_home': { | ||
121 | - 'stdlib': '{installed_base}/lib/python', | ||
122 | - 'platstdlib': '{base}/lib/python', | ||
123 | - 'purelib': '{base}/lib/python', | ||
124 | - 'platlib': '{base}/lib/python', | ||
125 | + 'stdlib': '{installed_base}/'+sys.lib+'/python', | ||
126 | + 'platstdlib': '{base}/'+sys.lib+'/python', | ||
127 | + 'purelib': '{base}/'+sys.lib+'/python', | ||
128 | + 'platlib': '{base}/'+sys.lib+'/python', | ||
129 | 'include': '{installed_base}/include/python', | ||
130 | 'platinclude': '{installed_base}/include/python', | ||
131 | 'scripts': '{base}/bin', | ||
132 | @@ -61,10 +61,10 @@ _INSTALL_SCHEMES = { | ||
133 | 'data': '{userbase}', | ||
134 | }, | ||
135 | 'posix_user': { | ||
136 | - 'stdlib': '{userbase}/lib/python{py_version_short}', | ||
137 | - 'platstdlib': '{userbase}/lib/python{py_version_short}', | ||
138 | - 'purelib': '{userbase}/lib/python{py_version_short}/site-packages', | ||
139 | - 'platlib': '{userbase}/lib/python{py_version_short}/site-packages', | ||
140 | + 'stdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', | ||
141 | + 'platstdlib': '{userbase}/'+sys.lib+'/python{py_version_short}', | ||
142 | + 'purelib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
143 | + 'platlib': '{userbase}/'+sys.lib+'/python{py_version_short}/site-packages', | ||
144 | 'include': '{userbase}/include/python{py_version_short}', | ||
145 | 'scripts': '{userbase}/bin', | ||
146 | 'data': '{userbase}', | ||
147 | Index: Python-3.5.4/Lib/trace.py | ||
148 | =================================================================== | ||
149 | --- Python-3.5.4.orig/Lib/trace.py | ||
150 | +++ Python-3.5.4/Lib/trace.py | ||
151 | @@ -749,10 +749,10 @@ def main(argv=None): | ||
152 | # should I also call expanduser? (after all, could use $HOME) | ||
153 | |||
154 | s = s.replace("$prefix", | ||
155 | - os.path.join(sys.base_prefix, "lib", | ||
156 | + os.path.join(sys.base_prefix, sys.lib, | ||
157 | "python" + sys.version[:3])) | ||
158 | s = s.replace("$exec_prefix", | ||
159 | - os.path.join(sys.base_exec_prefix, "lib", | ||
160 | + os.path.join(sys.base_exec_prefix, sys.lib, | ||
161 | "python" + sys.version[:3])) | ||
162 | s = os.path.normpath(s) | ||
163 | ignore_dirs.append(s) | ||
164 | Index: Python-3.5.4/Makefile.pre.in | ||
165 | =================================================================== | ||
166 | --- Python-3.5.4.orig/Makefile.pre.in | ||
167 | +++ Python-3.5.4/Makefile.pre.in | ||
168 | @@ -109,6 +109,8 @@ CFLAGS_ALIASING=@CFLAGS_ALIASING@ | ||
169 | |||
170 | # Machine-dependent subdirectories | ||
171 | MACHDEP= @MACHDEP@ | ||
172 | +LIB= @LIB@ | ||
173 | +ARCH= @ARCH@ | ||
174 | |||
175 | # Multiarch directory (may be empty) | ||
176 | MULTIARCH= @MULTIARCH@ | ||
177 | @@ -128,7 +130,7 @@ LIBDIR= @libdir@ | ||
178 | MANDIR= @mandir@ | ||
179 | INCLUDEDIR= @includedir@ | ||
180 | CONFINCLUDEDIR= $(exec_prefix)/include | ||
181 | -SCRIPTDIR= $(prefix)/lib | ||
182 | +SCRIPTDIR= @libdir@ | ||
183 | ABIFLAGS= @ABIFLAGS@ | ||
184 | |||
185 | # Detailed destination directories | ||
186 | @@ -731,6 +733,7 @@ Modules/getpath.o: $(srcdir)/Modules/get | ||
187 | -DEXEC_PREFIX='"$(exec_prefix)"' \ | ||
188 | -DVERSION='"$(VERSION)"' \ | ||
189 | -DVPATH='"$(VPATH)"' \ | ||
190 | + -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' \ | ||
191 | -o $@ $(srcdir)/Modules/getpath.c | ||
192 | |||
193 | Programs/python.o: $(srcdir)/Programs/python.c | ||
194 | @@ -813,7 +816,7 @@ regen-opcode: | ||
195 | Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h | ||
196 | |||
197 | Python/getplatform.o: $(srcdir)/Python/getplatform.c | ||
198 | - $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c | ||
199 | + $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c | ||
200 | |||
201 | Python/importdl.o: $(srcdir)/Python/importdl.c | ||
202 | $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c | ||
203 | Index: Python-3.5.4/Modules/getpath.c | ||
204 | =================================================================== | ||
205 | --- Python-3.5.4.orig/Modules/getpath.c | ||
206 | +++ Python-3.5.4/Modules/getpath.c | ||
207 | @@ -105,6 +105,13 @@ | ||
208 | #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined" | ||
209 | #endif | ||
210 | |||
211 | +#define LIB_PYTHON LIB "/python" VERSION | ||
212 | + | ||
213 | +#ifndef PYTHONPATH | ||
214 | +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ | ||
215 | + EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" | ||
216 | +#endif | ||
217 | + | ||
218 | #ifndef LANDMARK | ||
219 | #define LANDMARK L"os.py" | ||
220 | #endif | ||
221 | @@ -113,6 +120,7 @@ static wchar_t prefix[MAXPATHLEN+1]; | ||
222 | static wchar_t exec_prefix[MAXPATHLEN+1]; | ||
223 | static wchar_t progpath[MAXPATHLEN+1]; | ||
224 | static wchar_t *module_search_path = NULL; | ||
225 | +static wchar_t *lib_python = L"" LIB_PYTHON; | ||
226 | |||
227 | /* Get file status. Encode the path to the locale encoding. */ | ||
228 | |||
229 | @@ -494,7 +502,7 @@ calculate_path(void) | ||
230 | _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL); | ||
231 | _prefix = Py_DecodeLocale(PREFIX, NULL); | ||
232 | _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL); | ||
233 | - lib_python = Py_DecodeLocale("lib/python" VERSION, NULL); | ||
234 | + lib_python = Py_DecodeLocale(LIB_PYTHON, NULL); | ||
235 | |||
236 | if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) { | ||
237 | Py_FatalError( | ||
238 | Index: Python-3.5.4/Python/getplatform.c | ||
239 | =================================================================== | ||
240 | --- Python-3.5.4.orig/Python/getplatform.c | ||
241 | +++ Python-3.5.4/Python/getplatform.c | ||
242 | @@ -10,3 +10,23 @@ Py_GetPlatform(void) | ||
243 | { | ||
244 | return PLATFORM; | ||
245 | } | ||
246 | + | ||
247 | +#ifndef ARCH | ||
248 | +#define ARCH "unknown" | ||
249 | +#endif | ||
250 | + | ||
251 | +const char * | ||
252 | +Py_GetArch(void) | ||
253 | +{ | ||
254 | + return ARCH; | ||
255 | +} | ||
256 | + | ||
257 | +#ifndef LIB | ||
258 | +#define LIB "lib" | ||
259 | +#endif | ||
260 | + | ||
261 | +const char * | ||
262 | +Py_GetLib(void) | ||
263 | +{ | ||
264 | + return LIB; | ||
265 | +} | ||
266 | Index: Python-3.5.4/Python/sysmodule.c | ||
267 | =================================================================== | ||
268 | --- Python-3.5.4.orig/Python/sysmodule.c | ||
269 | +++ Python-3.5.4/Python/sysmodule.c | ||
270 | @@ -1827,6 +1827,10 @@ _PySys_Init(void) | ||
271 | PyUnicode_FromString(Py_GetCopyright())); | ||
272 | SET_SYS_FROM_STRING("platform", | ||
273 | PyUnicode_FromString(Py_GetPlatform())); | ||
274 | + SET_SYS_FROM_STRING("arch", | ||
275 | + PyUnicode_FromString(Py_GetArch())); | ||
276 | + SET_SYS_FROM_STRING("lib", | ||
277 | + PyUnicode_FromString(Py_GetLib())); | ||
278 | SET_SYS_FROM_STRING("executable", | ||
279 | PyUnicode_FromWideChar( | ||
280 | Py_GetProgramFullPath(), -1)); | ||
281 | Index: Python-3.5.4/configure.ac | ||
282 | =================================================================== | ||
283 | --- Python-3.5.4.orig/configure.ac | ||
284 | +++ Python-3.5.4/configure.ac | ||
285 | @@ -885,6 +885,41 @@ PLATDIR=plat-$MACHDEP | ||
286 | AC_SUBST(PLATDIR) | ||
287 | AC_SUBST(PLATFORM_TRIPLET) | ||
288 | |||
289 | +AC_SUBST(ARCH) | ||
290 | +AC_MSG_CHECKING(ARCH) | ||
291 | +ARCH=`uname -m` | ||
292 | +case $ARCH in | ||
293 | +i?86) ARCH=i386;; | ||
294 | +esac | ||
295 | +AC_MSG_RESULT($ARCH) | ||
296 | + | ||
297 | +AC_SUBST(LIB) | ||
298 | +AC_MSG_CHECKING(LIB) | ||
299 | +case $ac_sys_system in | ||
300 | +Linux*) | ||
301 | + # Test if the compiler is 64bit | ||
302 | + echo 'int i;' > conftest.$ac_ext | ||
303 | + python_cv_cc_64bit_output=no | ||
304 | + if AC_TRY_EVAL(ac_compile); then | ||
305 | + case `/usr/bin/file conftest.$ac_objext` in | ||
306 | + *"ELF 64"*) | ||
307 | + python_cv_cc_64bit_output=yes | ||
308 | + ;; | ||
309 | + esac | ||
310 | + fi | ||
311 | + rm -rf conftest* | ||
312 | + ;; | ||
313 | +esac | ||
314 | + | ||
315 | +case $ARCH:$python_cv_cc_64bit_output in | ||
316 | +ppc64:yes | powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) | ||
317 | + LIB="lib64" | ||
318 | + ;; | ||
319 | +*:*) | ||
320 | + LIB="lib" | ||
321 | + ;; | ||
322 | +esac | ||
323 | +AC_MSG_RESULT($LIB) | ||
324 | |||
325 | AC_MSG_CHECKING([for -Wl,--no-as-needed]) | ||
326 | save_LDFLAGS="$LDFLAGS" | ||
327 | Index: Python-3.5.4/setup.py | ||
328 | =================================================================== | ||
329 | --- Python-3.5.4.orig/setup.py | ||
330 | +++ Python-3.5.4/setup.py | ||
331 | @@ -494,7 +494,7 @@ class PyBuildExt(build_ext): | ||
332 | # directories (i.e. '.' and 'Include') must be first. See issue | ||
333 | # 10520. | ||
334 | if not cross_compiling: | ||
335 | - add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') | ||
336 | + add_dir_to_list(self.compiler.library_dirs, os.path.join('/usr/local', sys.lib)) | ||
337 | add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | ||
338 | # only change this for cross builds for 3.3, issues on Mageia | ||
339 | if cross_compiling: | ||
340 | @@ -552,8 +552,7 @@ class PyBuildExt(build_ext): | ||
341 | # be assumed that no additional -I,-L directives are needed. | ||
342 | if not cross_compiling: | ||
343 | lib_dirs = self.compiler.library_dirs + [ | ||
344 | - '/lib64', '/usr/lib64', | ||
345 | - '/lib', '/usr/lib', | ||
346 | + '/' + sys.lib, '/usr/' + sys.lib, | ||
347 | ] | ||
348 | inc_dirs = self.compiler.include_dirs + ['/usr/include'] | ||
349 | else: | ||
350 | @@ -745,11 +744,11 @@ class PyBuildExt(build_ext): | ||
351 | elif curses_library: | ||
352 | readline_libs.append(curses_library) | ||
353 | elif self.compiler.find_library_file(lib_dirs + | ||
354 | - ['/usr/lib/termcap'], | ||
355 | + ['/usr/'+sys.lib+'/termcap'], | ||
356 | 'termcap'): | ||
357 | readline_libs.append('termcap') | ||
358 | exts.append( Extension('readline', ['readline.c'], | ||
359 | - library_dirs=['/usr/lib/termcap'], | ||
360 | + library_dirs=['/usr/'+sys.lib+'/termcap'], | ||
361 | extra_link_args=readline_extra_link_args, | ||
362 | libraries=readline_libs) ) | ||
363 | else: | ||