Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 1 | Rebased for Python 2.7.9 |
| 2 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 3 | Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 | |
| 5 | 2011/09/29 |
| 6 | The python recipe building was failing because python-native |
| 7 | could not handle sys.lib var. sys.lib var is defined in the |
| 8 | multilib patch hence added this multilib.patch for python-native |
| 9 | recipe. |
| 10 | |
| 11 | Upstream-Status: Inappropriate [oe-specific] |
| 12 | |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 13 | Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 14 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 15 | Index: Python-2.7.14/Include/pythonrun.h |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 16 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 17 | --- Python-2.7.14.orig/Include/pythonrun.h |
| 18 | +++ Python-2.7.14/Include/pythonrun.h |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 19 | @@ -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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 27 | Index: Python-2.7.14/Lib/distutils/command/install.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 29 | --- Python-2.7.14.orig/Lib/distutils/command/install.py |
| 30 | +++ Python-2.7.14/Lib/distutils/command/install.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 31 | @@ -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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 49 | Index: Python-2.7.14/Lib/pydoc.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 50 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 51 | --- Python-2.7.14.orig/Lib/pydoc.py |
| 52 | +++ Python-2.7.14/Lib/pydoc.py |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 53 | @@ -375,7 +375,7 @@ class Doc: |
| 54 | docmodule = docclass = docroutine = docother = docproperty = docdata = fail |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 55 | |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 56 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 62 | Index: Python-2.7.14/Lib/site.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 63 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 64 | --- Python-2.7.14.orig/Lib/site.py |
| 65 | +++ Python-2.7.14/Lib/site.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 66 | @@ -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 Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 86 | return sitepackages |
| 87 | |
| 88 | def addsitepackages(known_paths): |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 89 | Index: Python-2.7.14/Lib/test/test_dl.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 90 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 91 | --- Python-2.7.14.orig/Lib/test/test_dl.py |
| 92 | +++ Python-2.7.14/Lib/test/test_dl.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 93 | @@ -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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 107 | Index: Python-2.7.14/Lib/trace.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 108 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 109 | --- Python-2.7.14.orig/Lib/trace.py |
| 110 | +++ Python-2.7.14/Lib/trace.py |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 111 | @@ -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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 124 | Index: Python-2.7.14/Makefile.pre.in |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 125 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 126 | --- 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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 129 | |
| 130 | # Machine-dependent subdirectories |
| 131 | MACHDEP= @MACHDEP@ |
| 132 | +LIB= @LIB@ |
| 133 | |
| 134 | # Multiarch directory (may be empty) |
| 135 | MULTIARCH= @MULTIARCH@ |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 136 | @@ -110,7 +111,7 @@ LIBDIR= @libdir@ |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 137 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 145 | @@ -644,6 +645,7 @@ Modules/getpath.o: $(srcdir)/Modules/get |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 146 | -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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 153 | @@ -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 Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 155 | |
| 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 162 | Index: Python-2.7.14/Modules/getpath.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 163 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 164 | --- Python-2.7.14.orig/Modules/getpath.c |
| 165 | +++ Python-2.7.14/Modules/getpath.c |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 166 | @@ -100,6 +100,13 @@ |
| 167 | #error "PREFIX, EXEC_PREFIX, VERSION, and VPATH must be constant defined" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 168 | #endif |
| 169 | |
| 170 | +#define LIB_PYTHON LIB "/python" VERSION |
| 171 | + |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 172 | +#ifndef PYTHONPATH |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 173 | +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 174 | + EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" |
| 175 | +#endif |
| 176 | + |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 177 | #ifndef LANDMARK |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 178 | #define LANDMARK "os.py" |
| 179 | #endif |
| 180 | @@ -108,7 +115,7 @@ static char prefix[MAXPATHLEN+1]; |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 181 | 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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 189 | Index: Python-2.7.14/Python/getplatform.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 190 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 191 | --- Python-2.7.14.orig/Python/getplatform.c |
| 192 | +++ Python-2.7.14/Python/getplatform.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 193 | @@ -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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 207 | Index: Python-2.7.14/Python/sysmodule.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 208 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 209 | --- Python-2.7.14.orig/Python/sysmodule.c |
| 210 | +++ Python-2.7.14/Python/sysmodule.c |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 211 | @@ -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 Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 220 | Index: Python-2.7.14/configure.ac |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 221 | =================================================================== |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 222 | --- Python-2.7.14.orig/configure.ac |
| 223 | +++ Python-2.7.14/configure.ac |
| 224 | @@ -758,6 +758,11 @@ SunOS*) |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 225 | ;; |
| 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) |