blob: af0f173c6d1fef1b95c08558c0b3222dd17a7d3c [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001Rebased for Python 2.7.9
2
Patrick Williamsc0f7c042017-02-23 20:41:17 -06003Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com>
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004
52011/09/29
6The python recipe building was failing because python-native
7could not handle sys.lib var. sys.lib var is defined in the
8multilib patch hence added this multilib.patch for python-native
9recipe.
10
11Upstream-Status: Inappropriate [oe-specific]
12
Patrick Williamsc0f7c042017-02-23 20:41:17 -060013Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014
Brad Bishop316dfdd2018-06-25 12:45:53 -040015Index: Python-2.7.14/Include/pythonrun.h
Patrick Williamsc124f4f2015-09-15 14:41:29 -050016===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -040017--- Python-2.7.14.orig/Include/pythonrun.h
18+++ Python-2.7.14/Include/pythonrun.h
Patrick Williamsc124f4f2015-09-15 14:41:29 -050019@@ -108,6 +108,7 @@ PyAPI_FUNC(char *) Py_GetPath(void);
20 /* In their own files */
21 PyAPI_FUNC(const char *) Py_GetVersion(void);
22 PyAPI_FUNC(const char *) Py_GetPlatform(void);
23+PyAPI_FUNC(const char *) Py_GetLib(void);
24 PyAPI_FUNC(const char *) Py_GetCopyright(void);
25 PyAPI_FUNC(const char *) Py_GetCompiler(void);
26 PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
Brad Bishop316dfdd2018-06-25 12:45:53 -040027Index: Python-2.7.14/Lib/distutils/command/install.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -050028===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -040029--- Python-2.7.14.orig/Lib/distutils/command/install.py
30+++ Python-2.7.14/Lib/distutils/command/install.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -050031@@ -22,6 +22,8 @@ from site import USER_BASE
32 from site import USER_SITE
33
34
35+libname = sys.lib
36+
37 if sys.version < "2.2":
38 WINDOWS_SCHEME = {
39 'purelib': '$base',
40@@ -42,7 +44,7 @@ else:
41 INSTALL_SCHEMES = {
42 'unix_prefix': {
43 'purelib': '$base/lib/python$py_version_short/site-packages',
44- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
45+ 'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
46 'headers': '$base/include/python$py_version_short/$dist_name',
47 'scripts': '$base/bin',
48 'data' : '$base',
Brad Bishop316dfdd2018-06-25 12:45:53 -040049Index: Python-2.7.14/Lib/pydoc.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -050050===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -040051--- Python-2.7.14.orig/Lib/pydoc.py
52+++ Python-2.7.14/Lib/pydoc.py
Brad Bishop6e60e8b2018-02-01 10:27:11 -050053@@ -375,7 +375,7 @@ class Doc:
54 docmodule = docclass = docroutine = docother = docproperty = docdata = fail
Patrick Williamsc124f4f2015-09-15 14:41:29 -050055
Brad Bishop6e60e8b2018-02-01 10:27:11 -050056 def getdocloc(self, object,
57- basedir=os.path.join(sys.exec_prefix, "lib",
58+ basedir=os.path.join(sys.exec_prefix, "sys.lib",
59 "python"+sys.version[0:3])):
60 """Return the location of module docs or None"""
61
Brad Bishop316dfdd2018-06-25 12:45:53 -040062Index: Python-2.7.14/Lib/site.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -050063===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -040064--- Python-2.7.14.orig/Lib/site.py
65+++ Python-2.7.14/Lib/site.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -050066@@ -288,13 +288,19 @@ def getsitepackages():
67 if sys.platform in ('os2emx', 'riscos'):
68 sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
69 elif os.sep == '/':
70- sitepackages.append(os.path.join(prefix, "lib",
71+ sitepackages.append(os.path.join(prefix, sys.lib,
72 "python" + sys.version[:3],
73 "site-packages"))
74- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
75+ if sys.lib != "lib":
76+ sitepackages.append(os.path.join(prefix, "lib",
77+ "python" + sys.version[:3],
78+ "site-packages"))
79+ sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
80+ if sys.lib != "lib":
81+ sitepackages.append(os.path.join(prefix, "lib", "site-python"))
82 else:
83 sitepackages.append(prefix)
84- sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
85+ sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
Brad Bishop6e60e8b2018-02-01 10:27:11 -050086 return sitepackages
87
88 def addsitepackages(known_paths):
Brad Bishop316dfdd2018-06-25 12:45:53 -040089Index: Python-2.7.14/Lib/test/test_dl.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -050090===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -040091--- Python-2.7.14.orig/Lib/test/test_dl.py
92+++ Python-2.7.14/Lib/test/test_dl.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -050093@@ -4,10 +4,11 @@
94 import unittest
95 from test.test_support import verbose, import_module
96 dl = import_module('dl', deprecated=True)
97+import sys
98
99 sharedlibs = [
100- ('/usr/lib/libc.so', 'getpid'),
101- ('/lib/libc.so.6', 'getpid'),
102+ ('/usr/'+sys.lib+'/libc.so', 'getpid'),
103+ ('/'+sys.lib+'/libc.so.6', 'getpid'),
104 ('/usr/bin/cygwin1.dll', 'getpid'),
105 ('/usr/lib/libc.dylib', 'getpid'),
106 ]
Brad Bishop316dfdd2018-06-25 12:45:53 -0400107Index: Python-2.7.14/Lib/trace.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500108===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -0400109--- Python-2.7.14.orig/Lib/trace.py
110+++ Python-2.7.14/Lib/trace.py
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500111@@ -754,10 +754,10 @@ def main(argv=None):
112 # should I also call expanduser? (after all, could use $HOME)
113
114 s = s.replace("$prefix",
115- os.path.join(sys.prefix, "lib",
116+ os.path.join(sys.prefix, sys.lib,
117 "python" + sys.version[:3]))
118 s = s.replace("$exec_prefix",
119- os.path.join(sys.exec_prefix, "lib",
120+ os.path.join(sys.exec_prefix, sys.lib,
121 "python" + sys.version[:3]))
122 s = os.path.normpath(s)
123 ignore_dirs.append(s)
Brad Bishop316dfdd2018-06-25 12:45:53 -0400124Index: Python-2.7.14/Makefile.pre.in
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500125===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -0400126--- Python-2.7.14.orig/Makefile.pre.in
127+++ Python-2.7.14/Makefile.pre.in
128@@ -91,6 +91,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500129
130 # Machine-dependent subdirectories
131 MACHDEP= @MACHDEP@
132+LIB= @LIB@
133
134 # Multiarch directory (may be empty)
135 MULTIARCH= @MULTIARCH@
Brad Bishop316dfdd2018-06-25 12:45:53 -0400136@@ -110,7 +111,7 @@ LIBDIR= @libdir@
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500137 MANDIR= @mandir@
138 INCLUDEDIR= @includedir@
139 CONFINCLUDEDIR= $(exec_prefix)/include
140-SCRIPTDIR= $(prefix)/lib
141+SCRIPTDIR= $(prefix)/@LIB@
142
143 # Detailed destination directories
144 BINLIBDEST= $(LIBDIR)/python$(VERSION)
Brad Bishop316dfdd2018-06-25 12:45:53 -0400145@@ -644,6 +645,7 @@ Modules/getpath.o: $(srcdir)/Modules/get
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500146 -DEXEC_PREFIX='"$(exec_prefix)"' \
147 -DVERSION='"$(VERSION)"' \
148 -DVPATH='"$(VPATH)"' \
149+ -DLIB='"$(LIB)"' \
150 -o $@ $(srcdir)/Modules/getpath.c
151
152 Modules/python.o: $(srcdir)/Modules/python.c
Brad Bishop316dfdd2018-06-25 12:45:53 -0400153@@ -692,7 +694,7 @@ regen-ast:
154 Python/compile.o Python/symtable.o Python/ast.o: $(srcdir)/Include/graminit.h $(srcdir)/Include/Python-ast.h
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500155
156 Python/getplatform.o: $(srcdir)/Python/getplatform.c
157- $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
158+ $(CC) -c $(PY_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
159
160 Python/importdl.o: $(srcdir)/Python/importdl.c
161 $(CC) -c $(PY_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
Brad Bishop316dfdd2018-06-25 12:45:53 -0400162Index: Python-2.7.14/Modules/getpath.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500163===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -0400164--- Python-2.7.14.orig/Modules/getpath.c
165+++ Python-2.7.14/Modules/getpath.c
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600166@@ -100,6 +100,13 @@
167 #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined"
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500168 #endif
169
170+#define LIB_PYTHON LIB "/python" VERSION
171+
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600172+#ifndef PYTHONPATH
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500173+#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600174+ EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload"
175+#endif
176+
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500177 #ifndef LANDMARK
Patrick Williamsc0f7c042017-02-23 20:41:17 -0600178 #define LANDMARK "os.py"
179 #endif
180@@ -108,7 +115,7 @@ static char prefix[MAXPATHLEN+1];
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500181 static char exec_prefix[MAXPATHLEN+1];
182 static char progpath[MAXPATHLEN+1];
183 static char *module_search_path = NULL;
184-static char lib_python[] = "lib/python" VERSION;
185+static char lib_python[] = LIB_PYTHON;
186
187 static void
188 reduce(char *dir)
Brad Bishop316dfdd2018-06-25 12:45:53 -0400189Index: Python-2.7.14/Python/getplatform.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500190===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -0400191--- Python-2.7.14.orig/Python/getplatform.c
192+++ Python-2.7.14/Python/getplatform.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500193@@ -10,3 +10,13 @@ Py_GetPlatform(void)
194 {
195 return PLATFORM;
196 }
197+
198+#ifndef LIB
199+#define LIB "lib"
200+#endif
201+
202+const char *
203+Py_GetLib(void)
204+{
205+ return LIB;
206+}
Brad Bishop316dfdd2018-06-25 12:45:53 -0400207Index: Python-2.7.14/Python/sysmodule.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500208===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -0400209--- Python-2.7.14.orig/Python/sysmodule.c
210+++ Python-2.7.14/Python/sysmodule.c
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500211@@ -1437,6 +1437,8 @@ _PySys_Init(void)
212 PyString_FromString(Py_GetCopyright()));
213 SET_SYS_FROM_STRING("platform",
214 PyString_FromString(Py_GetPlatform()));
215+ SET_SYS_FROM_STRING("lib",
216+ PyString_FromString(Py_GetLib()));
217 SET_SYS_FROM_STRING("executable",
218 PyString_FromString(Py_GetProgramFullPath()));
219 SET_SYS_FROM_STRING("prefix",
Brad Bishop316dfdd2018-06-25 12:45:53 -0400220Index: Python-2.7.14/configure.ac
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500221===================================================================
Brad Bishop316dfdd2018-06-25 12:45:53 -0400222--- Python-2.7.14.orig/configure.ac
223+++ Python-2.7.14/configure.ac
224@@ -758,6 +758,11 @@ SunOS*)
Patrick Williamsc124f4f2015-09-15 14:41:29 -0500225 ;;
226 esac
227
228+AC_SUBST(LIB)
229+AC_MSG_CHECKING(LIB)
230+LIB=`basename ${libdir}`
231+AC_MSG_RESULT($LIB)
232+
233
234 AC_SUBST(LIBRARY)
235 AC_MSG_CHECKING(LIBRARY)