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