churchyard / rpms / python3

Forked from rpms/python3 6 years ago
Clone

Blame 00102-lib64.patch

6cd1c5f
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
d668c1e
index 0258d3d..4b969bf 100644
6cd1c5f
--- a/Lib/distutils/command/install.py
6cd1c5f
+++ b/Lib/distutils/command/install.py
6cd1c5f
@@ -30,14 +30,14 @@ WINDOWS_SCHEME = {
5080ffc
 INSTALL_SCHEMES = {
5080ffc
     'unix_prefix': {
5080ffc
         'purelib': '$base/lib/python$py_version_short/site-packages',
5080ffc
-        'platlib': '$platbase/lib/python$py_version_short/site-packages',
5080ffc
+        'platlib': '$platbase/lib64/python$py_version_short/site-packages',
5080ffc
         'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
5080ffc
         'scripts': '$base/bin',
5080ffc
         'data'   : '$base',
5080ffc
         },
5080ffc
     'unix_home': {
5080ffc
         'purelib': '$base/lib/python',
5080ffc
-        'platlib': '$base/lib/python',
5080ffc
+        'platlib': '$base/lib64/python',
5080ffc
         'headers': '$base/include/python/$dist_name',
5080ffc
         'scripts': '$base/bin',
5080ffc
         'data'   : '$base',
6cd1c5f
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
d668c1e
index e07a6c8..554740d 100644
6cd1c5f
--- a/Lib/distutils/sysconfig.py
6cd1c5f
+++ b/Lib/distutils/sysconfig.py
d668c1e
@@ -129,8 +129,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
1c94c1a
             prefix = plat_specific and EXEC_PREFIX or PREFIX
5080ffc
 
5080ffc
     if os.name == "posix":
5080ffc
+        if plat_specific or standard_lib:
5080ffc
+            lib = "lib64"
5080ffc
+        else:
5080ffc
+            lib = "lib"
5080ffc
         libpython = os.path.join(prefix,
5080ffc
-                                 "lib", "python" + get_python_version())
5080ffc
+                                 lib, "python" + get_python_version())
5080ffc
         if standard_lib:
5080ffc
             return libpython
5080ffc
         else:
d668c1e
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
d668c1e
index 287ab19..d4c05e0 100644
2c6abcc
--- a/Lib/distutils/tests/test_install.py
2c6abcc
+++ b/Lib/distutils/tests/test_install.py
d668c1e
@@ -57,8 +57,9 @@ class InstallTestCase(support.TempdirManager,
2c6abcc
             self.assertEqual(got, expected)
2c6abcc
 
2c6abcc
         libdir = os.path.join(destination, "lib", "python")
2c6abcc
+        platlibdir = os.path.join(destination, "lib64", "python")
2c6abcc
         check_path(cmd.install_lib, libdir)
2c6abcc
-        check_path(cmd.install_platlib, libdir)
2c6abcc
+        check_path(cmd.install_platlib, platlibdir)
2c6abcc
         check_path(cmd.install_purelib, libdir)
2c6abcc
         check_path(cmd.install_headers,
2c6abcc
                    os.path.join(destination, "include", "python", "foopkg"))
6cd1c5f
diff --git a/Lib/site.py b/Lib/site.py
d668c1e
index 7dc1b04..85016b4 100644
6cd1c5f
--- a/Lib/site.py
6cd1c5f
+++ b/Lib/site.py
d668c1e
@@ -334,11 +334,15 @@ def getsitepackages(prefixes=None):
f5250ec
         seen.add(prefix)
bf35167
 
f5250ec
         if os.sep == '/':
5080ffc
+            sitepackages.append(os.path.join(prefix, "lib64",
5080ffc
+                                        "python" + sys.version[:3],
5080ffc
+                                        "site-packages"))
5080ffc
             sitepackages.append(os.path.join(prefix, "lib",
0424a4f
                                         "python%d.%d" % sys.version_info[:2],
5080ffc
                                         "site-packages"))
5080ffc
         else:
5080ffc
             sitepackages.append(prefix)
5080ffc
+            sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
5080ffc
             sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
cea6d60
     return sitepackages
cea6d60
 
6cd1c5f
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
d668c1e
index 9ee4d31..53c8606 100644
6cd1c5f
--- a/Lib/sysconfig.py
6cd1c5f
+++ b/Lib/sysconfig.py
6cd1c5f
@@ -20,10 +20,10 @@ __all__ = [
5080ffc
 
5080ffc
 _INSTALL_SCHEMES = {
5080ffc
     'posix_prefix': {
1c94c1a
-        'stdlib': '{installed_base}/lib/python{py_version_short}',
5080ffc
-        'platstdlib': '{platbase}/lib/python{py_version_short}',
1c94c1a
+        'stdlib': '{installed_base}/lib64/python{py_version_short}',
5080ffc
+        'platstdlib': '{platbase}/lib64/python{py_version_short}',
5080ffc
         'purelib': '{base}/lib/python{py_version_short}/site-packages',
5080ffc
-        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
5080ffc
+        'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
5080ffc
         'include':
1c94c1a
             '{installed_base}/include/python{py_version_short}{abiflags}',
5080ffc
         'platinclude':
d668c1e
@@ -62,10 +62,10 @@ _INSTALL_SCHEMES = {
1c94c1a
         'data': '{userbase}',
5080ffc
         },
5080ffc
     'posix_user': {
5080ffc
-        'stdlib': '{userbase}/lib/python{py_version_short}',
5080ffc
-        'platstdlib': '{userbase}/lib/python{py_version_short}',
5080ffc
+        'stdlib': '{userbase}/lib64/python{py_version_short}',
5080ffc
+        'platstdlib': '{userbase}/lib64/python{py_version_short}',
5080ffc
         'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
5080ffc
-        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
5080ffc
+        'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
5080ffc
         'include': '{userbase}/include/python{py_version_short}',
5080ffc
         'scripts': '{userbase}/bin',
1c94c1a
         'data': '{userbase}',
6cd1c5f
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
c9349a7
index 266adf0..e8513b6 100644
6cd1c5f
--- a/Lib/test/test_site.py
6cd1c5f
+++ b/Lib/test/test_site.py
d668c1e
@@ -275,8 +275,8 @@ class HelperFunctionsTests(unittest.TestCase):
cea6d60
         dirs = site.getsitepackages()
cea6d60
         if os.sep == '/':
cea6d60
             # OS X, Linux, FreeBSD, etc
Matej Stuchlik abb2ff8
-            self.assertEqual(len(dirs), 1)
0424a4f
-            wanted = os.path.join('xoxo', 'lib',
Matej Stuchlik abb2ff8
+            self.assertEqual(len(dirs), 2)
0424a4f
+            wanted = os.path.join('xoxo', 'lib64',
0424a4f
                                   'python%d.%d' % sys.version_info[:2],
5080ffc
                                   'site-packages')
5080ffc
             self.assertEqual(dirs[0], wanted)
6cd1c5f
diff --git a/Makefile.pre.in b/Makefile.pre.in
c9349a7
index 59ba9d4..5780ed8 100644
6cd1c5f
--- a/Makefile.pre.in
6cd1c5f
+++ b/Makefile.pre.in
d668c1e
@@ -133,7 +133,7 @@ LIBDIR=		@libdir@
5080ffc
 MANDIR=		@mandir@
5080ffc
 INCLUDEDIR=	@includedir@
5080ffc
 CONFINCLUDEDIR=	$(exec_prefix)/include
5080ffc
-SCRIPTDIR=	$(prefix)/lib
5080ffc
+SCRIPTDIR=	$(prefix)/lib64
5080ffc
 ABIFLAGS=	@ABIFLAGS@
5080ffc
 
5080ffc
 # Detailed destination directories
6cd1c5f
diff --git a/Modules/getpath.c b/Modules/getpath.c
c9349a7
index 85e737b..2a1fc79 100644
6cd1c5f
--- a/Modules/getpath.c
6cd1c5f
+++ b/Modules/getpath.c
c9349a7
@@ -500,7 +500,7 @@ calculate_exec_prefix(const _PyCoreConfig *core_config,
5080ffc
                 "Could not find platform dependent libraries <exec_prefix>\n");
c9349a7
         }
c9349a7
         wcsncpy(exec_prefix, calculate->exec_prefix, MAXPATHLEN);
5080ffc
-        joinpath(exec_prefix, L"lib/lib-dynload");
5080ffc
+        joinpath(exec_prefix, L"lib64/lib-dynload");
5080ffc
     }
5080ffc
     /* If we found EXEC_PREFIX do *not* reduce it!  (Yet.) */
c9349a7
 }
c9349a7
@@ -742,7 +742,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix)
c9349a7
     else {
c9349a7
         wcsncpy(calculate->zip_path, calculate->prefix, MAXPATHLEN);
c9349a7
     }
c9349a7
-    joinpath(calculate->zip_path, L"lib/python00.zip");
c9349a7
+    joinpath(calculate->zip_path, L"lib64/python00.zip");
5080ffc
 
c9349a7
     /* Replace "00" with version */
c9349a7
     size_t bufsz = wcslen(calculate->zip_path);
c9349a7
@@ -867,7 +867,7 @@ calculate_init(PyCalculatePath *calculate,
c9349a7
     if (!calculate->prefix) {
c9349a7
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
c9349a7
     }
c9349a7
-    calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len;;
c9349a7
+    calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len;;
c9349a7
     if (!calculate->lib_python) {
c9349a7
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
c9349a7
     }
6cd1c5f
diff --git a/setup.py b/setup.py
c9349a7
index f1933f7..450cd8a 100644
6cd1c5f
--- a/setup.py
6cd1c5f
+++ b/setup.py
c9349a7
@@ -531,7 +531,7 @@ class PyBuildExt(build_ext):
5080ffc
         # directories (i.e. '.' and 'Include') must be first.  See issue
5080ffc
         # 10520.
62d7207
         if not cross_compiling:
62d7207
-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
62d7207
+            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
62d7207
             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
62d7207
         # only change this for cross builds for 3.3, issues on Mageia
62d7207
         if cross_compiling:
c9349a7
@@ -830,11 +830,11 @@ class PyBuildExt(build_ext):
5080ffc
             elif curses_library:
5080ffc
                 readline_libs.append(curses_library)
5080ffc
             elif self.compiler.find_library_file(lib_dirs +
5080ffc
-                                                     ['/usr/lib/termcap'],
5080ffc
+                                                     ['/usr/lib64/termcap'],
5080ffc
                                                      'termcap'):
5080ffc
                 readline_libs.append('termcap')
5080ffc
             exts.append( Extension('readline', ['readline.c'],
5080ffc
-                                   library_dirs=['/usr/lib/termcap'],
5080ffc
+                                   library_dirs=['/usr/lib64/termcap'],
5080ffc
                                    extra_link_args=readline_extra_link_args,
5080ffc
                                    libraries=readline_libs) )
5080ffc
         else: