churchyard / rpms / python3

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