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