churchyard / rpms / python3

Forked from rpms/python3 4 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
804ec7c
@@ -140,8 +140,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
804ec7c
@@ -266,8 +266,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
804ec7c
@@ -140,7 +140,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
804ec7c
index dd188c6..6e69eed 100644
6cd1c5f
--- a/Modules/getpath.c
6cd1c5f
+++ b/Modules/getpath.c
804ec7c
@@ -688,7 +688,7 @@ calculate_exec_prefix(const _PyCoreConfig *core_config,
804ec7c
         if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) {
804ec7c
             return PATHLEN_ERR();
804ec7c
         }
804ec7c
-        err = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len);
804ec7c
+        err = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len);
804ec7c
         if (_Py_INIT_FAILED(err)) {
804ec7c
             return err;
804ec7c
         }
804ec7c
@@ -1015,7 +1015,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix)
804ec7c
             return PATHLEN_ERR();
c9349a7
         }
5080ffc
     }
804ec7c
-    err = joinpath(calculate->zip_path, L"lib/python00.zip", zip_path_len);
804ec7c
+    err = joinpath(calculate->zip_path, L"lib64/python00.zip", zip_path_len);
804ec7c
     if (_Py_INIT_FAILED(err)) {
804ec7c
         return err;
c9349a7
     }
804ec7c
@@ -1144,7 +1144,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
804ec7c
index 0258d3d..4b969bf 100644
6cd1c5f
--- a/setup.py
6cd1c5f
+++ b/setup.py
804ec7c
@@ -610,7 +610,7 @@ class PyBuildExt(build_ext):
5080ffc
         # directories (i.e. '.' and 'Include') must be first.  See issue
5080ffc
         # 10520.
804ec7c
         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
804ec7c
         if CROSS_COMPILING:
804ec7c
@@ -902,11 +902,11 @@ class PyBuildExt(build_ext):
5080ffc
             elif curses_library:
5080ffc
                 readline_libs.append(curses_library)
804ec7c
             elif self.compiler.find_library_file(self.lib_dirs +
5080ffc
-                                                     ['/usr/lib/termcap'],
5080ffc
+                                                     ['/usr/lib64/termcap'],
5080ffc
                                                      'termcap'):
5080ffc
                 readline_libs.append('termcap')
804ec7c
             self.add(Extension('readline', ['readline.c'],
804ec7c
-                               library_dirs=['/usr/lib/termcap'],
804ec7c
+                               library_dirs=['/usr/lib64/termcap'],
804ec7c
                                extra_link_args=readline_extra_link_args,
804ec7c
                                libraries=readline_libs))
5080ffc
         else: