]> git.pld-linux.org Git - packages/python3.git/blob - python3-lib64.patch
Suggests: pip
[packages/python3.git] / python3-lib64.patch
1 --- Python-3.3.1/configure.ac.orig      2013-04-18 16:31:07.244030129 +0200
2 +++ Python-3.3.1/configure.ac   2013-04-18 17:30:31.800622500 +0200
3 @@ -769,6 +769,45 @@
4  MULTIARCH=$($CC --print-multiarch 2>/dev/null)
5  AC_SUBST(MULTIARCH)
6  
7 +AC_SUBST(ARCH)
8 +AC_MSG_CHECKING(ARCH)
9 +ARCH=`uname -m`
10 +case $ARCH in
11 +i?86) ARCH=i386;;
12 +esac
13 +AC_MSG_RESULT($ARCH)
14 +
15 +AC_SUBST(LIB)
16 +AC_MSG_CHECKING(LIB)
17 +case $ac_sys_system in
18 +Linux*)
19 +  # Test if the compiler is 64bit
20 +  echo 'int i;' > conftest.$ac_ext
21 +  python_cv_cc_64bit_output=no
22 +  if AC_TRY_EVAL(ac_compile); then
23 +    case `/usr/bin/file conftest.$ac_objext` in
24 +    *"ELF 64"*)
25 +      python_cv_cc_64bit_output=yes
26 +      ;;
27 +    esac
28 +  fi
29 +  rm -rf conftest*
30 +  ;;
31 +esac
32 +
33 +case $ARCH:$python_cv_cc_64bit_output in
34 +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes)
35 +  LIB="lib64"
36 +  ;;
37 +x86_64:no)
38 +  LIB="libx32"
39 +  ;;
40 +*:*)
41 +  LIB="lib"
42 +  ;;
43 +esac
44 +AC_MSG_RESULT($LIB)
45 +
46  
47  AC_SUBST(LIBRARY)
48  AC_MSG_CHECKING(LIBRARY)
49 --- Python-3.5.0/Include/pylifecycle.h~ 2015-09-13 13:41:20.000000000 +0200
50 +++ Python-3.5.0/Include/pylifecycle.h  2015-09-13 20:08:24.017308537 +0200
51 @@ -65,6 +65,8 @@ int _Py_CheckPython3();
52  /* In their own files */
53  PyAPI_FUNC(const char *) Py_GetVersion(void);
54  PyAPI_FUNC(const char *) Py_GetPlatform(void);
55 +PyAPI_FUNC(const char *) Py_GetArch(void);
56 +PyAPI_FUNC(const char *) Py_GetLib(void);
57  PyAPI_FUNC(const char *) Py_GetCopyright(void);
58  PyAPI_FUNC(const char *) Py_GetCompiler(void);
59  PyAPI_FUNC(const char *) Py_GetBuildInfo(void);
60 --- Python-3.2.1.orig/Lib/distutils/command/install.py  2011-07-09 07:58:46.000000000 +0100
61 +++ Python-3.2.1/Lib/distutils/command/install.py       2011-07-12 22:20:12.000000000 +0100
62 @@ -19,6 +19,8 @@ from site import USER_BASE
63  from site import USER_SITE
64  HAS_USER_SITE = True
65  
66 +libname = sys.lib
67 +
68  WINDOWS_SCHEME = {
69      'purelib': '$base/Lib/site-packages',
70      'platlib': '$base/Lib/site-packages',
71 @@ -47,14 +49,14 @@
72  INSTALL_SCHEMES = {
73      'unix_prefix': {
74          'purelib': '$base/lib/python$py_version_short/site-packages',
75 -        'platlib': '$platbase/lib/python$py_version_short/site-packages',
76 +        'platlib': '$platbase/'+libname+'/python$py_version_short/site-packages',
77          'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
78          'scripts': '$base/bin',
79          'data'   : '$base',
80          },
81      'unix_home': {
82          'purelib': '$base/lib/python',
83 -        'platlib': '$base/lib/python',
84 +        'platlib': '$base/'+libname+'/python',
85          'headers': '$base/include/python/$dist_name',
86          'scripts': '$base/bin',
87          'data'   : '$base',
88 --- Python-3.2.1.orig/Lib/distutils/sysconfig.py        2011-07-09 07:58:47.000000000 +0100
89 +++ Python-3.2.1/Lib/distutils/sysconfig.py     2011-07-12 22:20:12.000000000 +0100
90 @@ -124,8 +124,12 @@
91          prefix = plat_specific and EXEC_PREFIX or PREFIX
92  
93      if os.name == "posix":
94 +        if plat_specific:
95 +            lib = sys.lib
96 +        else:
97 +            lib = 'lib'
98          libpython = os.path.join(prefix,
99 -                                 "lib", "python" + get_python_version())
100 +                                 lib, "python" + get_python_version())
101          if standard_lib:
102              return libpython
103          else:
104 --- Python-3.2.1.orig/Lib/distutils/tests/test_install.py       2011-07-09 07:58:47.000000000 +0100
105 +++ Python-3.2.1/Lib/distutils/tests/test_install.py    2011-07-12 22:20:12.000000000 +0100
106 @@ -49,8 +49,9 @@
107              self.assertEqual(got, expected)
108  
109          libdir = os.path.join(destination, "lib", "python")
110 +        platlibdir =  os.path.join(destination, sys.lib, "python")
111          check_path(cmd.install_lib, libdir)
112 -        check_path(cmd.install_platlib, libdir)
113 +        check_path(cmd.install_platlib, platlibdir)
114          check_path(cmd.install_purelib, libdir)
115          check_path(cmd.install_headers,
116                     os.path.join(destination, "include", "python", "foopkg"))
117 --- Python-3.2.1.orig/Lib/site.py       2011-07-09 07:58:49.000000000 +0100
118 +++ Python-3.2.1/Lib/site.py    2011-07-12 22:20:12.000000000 +0100
119 @@ -304,12 +304,15 @@ def getsitepackages(prefixes=None):
120          seen.add(prefix)
121  
122          if os.sep == '/':
123 -            sitepackages.append(os.path.join(prefix, "lib",
124 +            sitepackages.append(os.path.join(prefix, sys.lib,
125                                          "python" + sys.version[:3],
126                                          "site-packages"))
127 +            sitepackages.append(os.path.join(prefix, sys.lib, "site-python"))
128 +            if sys.lib != 'lib':
129 +                sitepackages.append(os.path.join(prefix, "lib", "python" + sys.version[:3], "site-packages"))
130          else:
131              sitepackages.append(prefix)
132 -            sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
133 +            sitepackages.append(os.path.join(prefix, sys.lib, "site-packages"))
134          if sys.platform == "darwin":
135              # for framework builds *only* we add the standard Apple
136              # locations.
137 --- Python-3.2.1.orig/Lib/sysconfig.py  2011-07-09 07:58:49.000000000 +0100
138 +++ Python-3.2.1/Lib/sysconfig.py       2011-07-12 22:20:12.000000000 +0100
139 @@ -21,10 +21,10 @@
140  
141  _INSTALL_SCHEMES = {
142      'posix_prefix': {
143 -        'stdlib': '{installed_base}/lib/python{py_version_short}',
144 -        'platstdlib': '{platbase}/lib/python{py_version_short}',
145 +        'stdlib': '{installed_base}/' + sys.lib + '/python{py_version_short}',
146 +        'platstdlib': '{platbase}/' + sys.lib + '/python{py_version_short}',
147          'purelib': '{base}/lib/python{py_version_short}/site-packages',
148 -        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
149 +        'platlib': '{platbase}/' + sys.lib + '/python{py_version_short}/site-packages',
150          'include':
151              '{installed_base}/include/python{py_version_short}{abiflags}',
152          'platinclude':
153 @@ -33,10 +33,10 @@
154          'data': '{base}',
155          },
156      'posix_home': {
157 -        'stdlib': '{installed_base}/lib/python',
158 -        'platstdlib': '{base}/lib/python',
159 +        'stdlib': '{installed_base}/' + sys.lib + '/python',
160 +        'platstdlib': '{base}/' + sys.lib + '/python',
161          'purelib': '{base}/lib/python',
162 -        'platlib': '{base}/lib/python',
163 +        'platlib': '{base}/' + sys.lib + '/python',
164          'include': '{installed_base}/include/python',
165          'platinclude': '{installed_base}/include/python',
166          'scripts': '{base}/bin',
167 --- Python-3.2.1.orig/Makefile.pre.in   2011-07-09 07:58:52.000000000 +0100
168 +++ Python-3.2.1/Makefile.pre.in        2011-07-12 22:20:12.000000000 +0100
169 @@ -90,6 +90,8 @@
170  
171  # Machine-dependent subdirectories
172  MACHDEP=       @MACHDEP@
173 +LIB=           @LIB@
174 +ARCH=          @ARCH@
175  
176  # Install prefix for architecture-independent files
177  prefix=                @prefix@
178 @@ -106,7 +108,7 @@
179  MANDIR=                @mandir@
180  INCLUDEDIR=    @includedir@
181  CONFINCLUDEDIR=        $(exec_prefix)/include
182 -SCRIPTDIR=     $(prefix)/lib
183 +SCRIPTDIR=     $(prefix)/$(LIB)
184  ABIFLAGS=      @ABIFLAGS@
185  
186  # Detailed destination directories
187 @@ -611,7 +613,7 @@
188  Python/compile.o Python/symtable.o Python/ast.o: $(GRAMMAR_H) $(AST_H)
189  
190  Python/getplatform.o: $(srcdir)/Python/getplatform.c
191 -               $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -o $@ $(srcdir)/Python/getplatform.c
192 +               $(CC) -c $(PY_CORE_CFLAGS) -DPLATFORM='"$(MACHDEP)"' -DARCH='"$(ARCH)"' -DLIB='"$(LIB)"' -o $@ $(srcdir)/Python/getplatform.c
193  
194  Python/importdl.o: $(srcdir)/Python/importdl.c
195                 $(CC) -c $(PY_CORE_CFLAGS) -I$(DLINCLDIR) -o $@ $(srcdir)/Python/importdl.c
196 --- Python-3.2.1.orig/Modules/getpath.c 2011-07-09 07:58:54.000000000 +0100
197 +++ Python-3.2.1/Modules/getpath.c      2011-07-12 22:21:48.000000000 +0100
198 @@ -121,9 +121,21 @@
199  #define EXEC_PREFIX PREFIX
200  #endif
201  
202 +#ifndef LIB_PYTHON
203 +#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) || defined(__powerpc64__) || defined(__s390x__)
204 +#if defined(__ILP32__)
205 +#define LIB_PYTHON "libx32/python"
206 +#else
207 +#define LIB_PYTHON "lib64/python"
208 +#endif
209 +#else
210 +#define LIB_PYTHON "lib/python"
211 +#endif
212 +#endif
213 +
214  #ifndef PYTHONPATH
215 -#define PYTHONPATH PREFIX "/lib/python" VERSION ":" \
216 -              EXEC_PREFIX "/lib/python" VERSION "/lib-dynload"
217 +#define PYTHONPATH PREFIX "/" LIB_PYTHON VERSION ":" \
218 +              EXEC_PREFIX "/" LIB_PYTHON VERSION "/lib-dynload:"
219  #endif
220  
221  #ifndef LANDMARK
222 @@ -502,7 +514,7 @@ calculate_path(void)
223      _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
224      _prefix = Py_DecodeLocale(PREFIX, NULL);
225      _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
226 -    lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
227 +    lib_python = Py_DecodeLocale(LIB_PYTHON VERSION, NULL);
228  
229      if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
230          Py_FatalError(
231 --- Python-3.2.1.orig/Python/getplatform.c      2011-07-09 07:58:56.000000000 +0100
232 +++ Python-3.2.1/Python/getplatform.c   2011-07-12 22:20:12.000000000 +0100
233 @@ -10,3 +10,23 @@
234  {
235         return PLATFORM;
236  }
237 +
238 +#ifndef ARCH
239 +#define ARCH "unknown"
240 +#endif
241 +
242 +const char *
243 +Py_GetArch(void)
244 +{
245 +       return ARCH;
246 +}
247 +
248 +#ifndef LIB
249 +#define LIB "lib"
250 +#endif
251 +
252 +const char *
253 +Py_GetLib(void)
254 +{
255 +       return LIB;
256 +}
257 --- Python-3.2.1.orig/Python/sysmodule.c        2011-07-09 07:58:56.000000000 +0100
258 +++ Python-3.2.1/Python/sysmodule.c     2011-07-12 22:20:12.000000000 +0100
259 @@ -1560,6 +1560,10 @@
260                          PyUnicode_FromString(Py_GetCopyright()));
261      SET_SYS_FROM_STRING("platform",
262                          PyUnicode_FromString(Py_GetPlatform()));
263 +    SET_SYS_FROM_STRING("arch",
264 +                        PyUnicode_FromString(Py_GetArch()));
265 +    SET_SYS_FROM_STRING("lib",
266 +                        PyUnicode_FromString(Py_GetLib()));
267      SET_SYS_FROM_STRING("executable",
268                          PyUnicode_FromWideChar(
269                                 Py_GetProgramFullPath(), -1));
270 --- Python-3.2.1.orig/setup.py  2011-07-09 07:58:56.000000000 +0100
271 +++ Python-3.2.1/setup.py       2011-07-12 22:20:12.000000000 +0100
272 @@ -516,8 +516,7 @@
273          # be assumed that no additional -I,-L directives are needed.
274          if not cross_compiling:
275              lib_dirs = self.compiler.library_dirs + [
276 -                '/lib64', '/usr/lib64',
277 -                '/lib', '/usr/lib',
278 +                '/' + sys.lib, '/usr/' + sys.lib
279                  ]
280              inc_dirs = self.compiler.include_dirs + ['/usr/include']
281          exts = []
282 @@ -643,11 +642,11 @@
283              elif curses_library:
284                  readline_libs.append(curses_library)
285              elif self.compiler.find_library_file(lib_dirs +
286 -                                                     ['/usr/lib/termcap'],
287 +                                                     ['/usr/' + sys.lib + '/termcap'],
288                                                       'termcap'):
289                  readline_libs.append('termcap')
290              exts.append( Extension('readline', ['readline.c'],
291 -                                   library_dirs=['/usr/lib/termcap'],
292 +                                   library_dirs=['/usr/' + sys.lib + '/termcap'],
293                                     extra_link_args=readline_extra_link_args,
294                                     libraries=readline_libs) )
295          else:
This page took 0.05135 seconds and 3 git commands to generate.