churchyard / rpms / python38

Forked from rpms/python38 2 years ago
Clone
6cd1c5
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
0424a4
index 9474e9c..c0ce4c6 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
0424a4
index 026cca7..6d3e077 100644
6cd1c5
--- a/Lib/distutils/sysconfig.py
6cd1c5
+++ b/Lib/distutils/sysconfig.py
6cd1c5
@@ -132,8 +132,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:
6cd1c5
diff --git a/Lib/site.py b/Lib/site.py
0424a4
index a84e3bb..ba0d3ea 100644
6cd1c5
--- a/Lib/site.py
6cd1c5
+++ b/Lib/site.py
6cd1c5
@@ -303,11 +303,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"))
5080ff
         if sys.platform == "darwin":
5080ff
             # for framework builds *only* we add the standard Apple
6cd1c5
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
0424a4
index b9bbfe5..2a5f29c 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':
6cd1c5
@@ -61,10 +61,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
0424a4
index f698927..bc977b5 100644
6cd1c5
--- a/Lib/test/test_site.py
6cd1c5
+++ b/Lib/test/test_site.py
6cd1c5
@@ -248,8 +248,8 @@ class HelperFunctionsTests(unittest.TestCase):
Matej Stuchlik abb2ff
             self.assertEqual(dirs[1], wanted)
5080ff
         elif os.sep == '/':
288566
             # OS X non-framwework builds, 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
0424a4
index 8fa7934..a693917 100644
6cd1c5
--- a/Makefile.pre.in
6cd1c5
+++ b/Makefile.pre.in
0424a4
@@ -126,7 +126,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
0424a4
index 65b47a3..eaa756c 100644
6cd1c5
--- a/Modules/getpath.c
6cd1c5
+++ b/Modules/getpath.c
6cd1c5
@@ -494,7 +494,7 @@ calculate_path(void)
Matej Stuchlik abb2ff
     _pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
Matej Stuchlik abb2ff
     _prefix = Py_DecodeLocale(PREFIX, NULL);
Matej Stuchlik abb2ff
     _exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
Matej Stuchlik abb2ff
-    lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
Matej Stuchlik abb2ff
+    lib_python = Py_DecodeLocale("lib64/python" VERSION, NULL);
5080ff
 
bf3516
     if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
bf3516
         Py_FatalError(
6cd1c5
@@ -683,7 +683,7 @@ calculate_path(void)
5080ff
     }
5080ff
     else
5080ff
         wcsncpy(zip_path, _prefix, MAXPATHLEN);
5080ff
-    joinpath(zip_path, L"lib/python00.zip");
5080ff
+    joinpath(zip_path, L"lib64/python00.zip");
5080ff
     bufsz = wcslen(zip_path);   /* Replace "00" with version */
5080ff
     zip_path[bufsz - 6] = VERSION[0];
5080ff
     zip_path[bufsz - 5] = VERSION[2];
6cd1c5
@@ -695,7 +695,7 @@ calculate_path(void)
5080ff
             fprintf(stderr,
5080ff
                 "Could not find platform dependent libraries <exec_prefix>\n");
5080ff
         wcsncpy(exec_prefix, _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.) */
5080ff
 
6cd1c5
diff --git a/setup.py b/setup.py
0424a4
index 0f2dfc4..da37896 100644
6cd1c5
--- a/setup.py
6cd1c5
+++ b/setup.py
6cd1c5
@@ -492,7 +492,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:
6cd1c5
@@ -780,11 +780,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:
6cd1c5
@@ -821,8 +821,8 @@ class PyBuildExt(build_ext):
5080ff
             if krb5_h:
5080ff
                 ssl_incs += krb5_h
5080ff
         ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
5080ff
-                                     ['/usr/local/ssl/lib',
5080ff
-                                      '/usr/contrib/ssl/lib/'
5080ff
+                                     ['/usr/local/ssl/lib64',
5080ff
+                                      '/usr/contrib/ssl/lib64/'
5080ff
                                      ] )
5080ff
 
5080ff
         if (ssl_incs is not None and