Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame^] | 1 | Rebased for Python 2.7.9 |
| 2 | |
| 3 | Signed-Off-By: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> |
| 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 | |
| 13 | Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com> |
| 14 | |
| 15 | Index: Python-2.7.9/Include/pythonrun.h |
| 16 | =================================================================== |
| 17 | --- Python-2.7.9.orig/Include/pythonrun.h |
| 18 | +++ Python-2.7.9/Include/pythonrun.h |
| 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); |
| 27 | Index: Python-2.7.9/Lib/distutils/command/install.py |
| 28 | =================================================================== |
| 29 | --- Python-2.7.9.orig/Lib/distutils/command/install.py |
| 30 | +++ Python-2.7.9/Lib/distutils/command/install.py |
| 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', |
| 49 | Index: Python-2.7.9/Lib/pydoc.py |
| 50 | =================================================================== |
| 51 | --- Python-2.7.9.orig/Lib/pydoc.py |
| 52 | +++ Python-2.7.9/Lib/pydoc.py |
| 53 | @@ -383,7 +383,7 @@ class Doc: |
| 54 | |
| 55 | docloc = os.environ.get("PYTHONDOCS", |
| 56 | "http://docs.python.org/library") |
| 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 | if (isinstance(object, type(os)) and |
| 61 | (object.__name__ in ('errno', 'exceptions', 'gc', 'imp', |
| 62 | Index: Python-2.7.9/Lib/site.py |
| 63 | =================================================================== |
| 64 | --- Python-2.7.9.orig/Lib/site.py |
| 65 | +++ Python-2.7.9/Lib/site.py |
| 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")) |
| 86 | if sys.platform == "darwin": |
| 87 | # for framework builds *only* we add the standard Apple |
| 88 | # locations. |
| 89 | Index: Python-2.7.9/Lib/test/test_dl.py |
| 90 | =================================================================== |
| 91 | --- Python-2.7.9.orig/Lib/test/test_dl.py |
| 92 | +++ Python-2.7.9/Lib/test/test_dl.py |
| 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 | ] |
| 107 | Index: Python-2.7.9/Lib/trace.py |
| 108 | =================================================================== |
| 109 | --- Python-2.7.9.orig/Lib/trace.py |
| 110 | +++ Python-2.7.9/Lib/trace.py |
| 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) |
| 124 | Index: Python-2.7.9/Makefile.pre.in |
| 125 | =================================================================== |
| 126 | --- Python-2.7.9.orig/Makefile.pre.in |
| 127 | +++ Python-2.7.9/Makefile.pre.in |
| 128 | @@ -87,6 +87,7 @@ PY_CFLAGS= $(CFLAGS) $(CPPFLAGS) $(CFLAG |
| 129 | |
| 130 | # Machine-dependent subdirectories |
| 131 | MACHDEP= @MACHDEP@ |
| 132 | +LIB= @LIB@ |
| 133 | |
| 134 | # Multiarch directory (may be empty) |
| 135 | MULTIARCH= @MULTIARCH@ |
| 136 | @@ -106,7 +107,7 @@ LIBDIR= @libdir@ |
| 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) |
| 145 | @@ -597,6 +598,7 @@ Modules/getpath.o: $(srcdir)/Modules/get |
| 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 |
| 153 | @@ -639,7 +641,7 @@ $(AST_C): $(AST_ASDL) $(ASDLGEN_FILES) |
| 154 | Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H) |
| 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 |
| 162 | Index: Python-2.7.9/Modules/getpath.c |
| 163 | =================================================================== |
| 164 | --- Python-2.7.9.orig/Modules/getpath.c |
| 165 | +++ Python-2.7.9/Modules/getpath.c |
| 166 | @@ -116,9 +116,11 @@ |
| 167 | #define EXEC_PREFIX PREFIX |
| 168 | #endif |
| 169 | |
| 170 | +#define LIB_PYTHON LIB "/python" VERSION |
| 171 | + |
| 172 | #ifndef PYTHONPATH |
| 173 | -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \ |
| 174 | - EXEC_PREFIX "/lib/python" VERSION "/lib-dynload" |
| 175 | +#define PYTHONPATH PREFIX "/" LIB_PYTHON ":" \ |
| 176 | + EXEC_PREFIX "/" LIB_PYTHON "/lib-dynload" |
| 177 | #endif |
| 178 | |
| 179 | #ifndef LANDMARK |
| 180 | @@ -129,7 +131,7 @@ static char prefix[MAXPATHLEN+1]; |
| 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) |
| 189 | Index: Python-2.7.9/Python/getplatform.c |
| 190 | =================================================================== |
| 191 | --- Python-2.7.9.orig/Python/getplatform.c |
| 192 | +++ Python-2.7.9/Python/getplatform.c |
| 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 | +} |
| 207 | Index: Python-2.7.9/Python/sysmodule.c |
| 208 | =================================================================== |
| 209 | --- Python-2.7.9.orig/Python/sysmodule.c |
| 210 | +++ Python-2.7.9/Python/sysmodule.c |
| 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", |
| 220 | Index: Python-2.7.9/configure.ac |
| 221 | =================================================================== |
| 222 | --- Python-2.7.9.orig/configure.ac |
| 223 | +++ Python-2.7.9/configure.ac |
| 224 | @@ -736,6 +736,11 @@ SunOS*) |
| 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) |