Blame SOURCES/00102-lib64.patch

1a5cfa
From be6b9803109c3702dbff0ed8b0953913206008ca Mon Sep 17 00:00:00 2001
6551b0
From: David Malcolm <dmalcolm@redhat.com>
6551b0
Date: Wed, 13 Jan 2010 21:25:18 +0000
6551b0
Subject: [PATCH] 00102: Change the various install paths to use /usr/lib64/
6551b0
 instead or /usr/lib/
6551b0
MIME-Version: 1.0
6551b0
Content-Type: text/plain; charset=UTF-8
6551b0
Content-Transfer-Encoding: 8bit
6551b0
6551b0
Only used when "%{_lib}" == "lib64".
6551b0
6551b0
Co-authored-by: David Malcolm <dmalcolm@redhat.com>
6551b0
Co-authored-by: Thomas Spura <tomspur@fedoraproject.org>
6551b0
Co-authored-by: Slavek Kabrda <bkabrda@redhat.com>
6551b0
Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
6551b0
Co-authored-by: Tomas Orsava <torsava@redhat.com>
6551b0
Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
6551b0
Co-authored-by: Petr Viktorin <pviktori@redhat.com>
6551b0
Co-authored-by: Miro HronĨok <miro@hroncok.cz>
6551b0
Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
6551b0
---
6551b0
 Lib/distutils/command/install.py    |  4 ++--
6551b0
 Lib/distutils/sysconfig.py          |  6 +++++-
6551b0
 Lib/distutils/tests/test_install.py |  3 ++-
6551b0
 Lib/site.py                         |  4 ++++
6551b0
 Lib/sysconfig.py                    | 12 ++++++------
6551b0
 Lib/test/test_site.py               |  4 ++--
6551b0
 Makefile.pre.in                     |  2 +-
6551b0
 Modules/getpath.c                   |  6 +++---
6551b0
 configure                           |  4 ++--
6551b0
 configure.ac                        |  4 ++--
6551b0
 setup.py                            |  6 +++---
6551b0
 11 files changed, 32 insertions(+), 23 deletions(-)
6551b0
6551b0
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
6551b0
index c625c95bf7..ae4f915669 100644
6551b0
--- a/Lib/distutils/command/install.py
6551b0
+++ b/Lib/distutils/command/install.py
6551b0
@@ -30,14 +30,14 @@ WINDOWS_SCHEME = {
6551b0
 INSTALL_SCHEMES = {
6551b0
     'unix_prefix': {
6551b0
         'purelib': '$base/lib/python$py_version_short/site-packages',
6551b0
-        'platlib': '$platbase/lib/python$py_version_short/site-packages',
6551b0
+        'platlib': '$platbase/lib64/python$py_version_short/site-packages',
6551b0
         'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
6551b0
         'scripts': '$base/bin',
6551b0
         'data'   : '$base',
6551b0
         },
6551b0
     'unix_home': {
6551b0
         'purelib': '$base/lib/python',
6551b0
-        'platlib': '$base/lib/python',
6551b0
+        'platlib': '$base/lib64/python',
6551b0
         'headers': '$base/include/python/$dist_name',
6551b0
         'scripts': '$base/bin',
6551b0
         'data'   : '$base',
6551b0
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
6551b0
index b51629eb94..9a4892a737 100644
6551b0
--- a/Lib/distutils/sysconfig.py
6551b0
+++ b/Lib/distutils/sysconfig.py
6551b0
@@ -146,8 +146,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
6551b0
             prefix = plat_specific and EXEC_PREFIX or PREFIX
6551b0
 
6551b0
     if os.name == "posix":
6551b0
+        if plat_specific or standard_lib:
6551b0
+            lib = "lib64"
6551b0
+        else:
6551b0
+            lib = "lib"
6551b0
         libpython = os.path.join(prefix,
6551b0
-                                 "lib", "python" + get_python_version())
6551b0
+                                 lib, "python" + get_python_version())
6551b0
         if standard_lib:
6551b0
             return libpython
6551b0
         else:
6551b0
diff --git a/Lib/distutils/tests/test_install.py b/Lib/distutils/tests/test_install.py
6551b0
index 287ab1989e..d4c05e0ab1 100644
6551b0
--- a/Lib/distutils/tests/test_install.py
6551b0
+++ b/Lib/distutils/tests/test_install.py
6551b0
@@ -57,8 +57,9 @@ class InstallTestCase(support.TempdirManager,
6551b0
             self.assertEqual(got, expected)
6551b0
 
6551b0
         libdir = os.path.join(destination, "lib", "python")
6551b0
+        platlibdir = os.path.join(destination, "lib64", "python")
6551b0
         check_path(cmd.install_lib, libdir)
6551b0
-        check_path(cmd.install_platlib, libdir)
6551b0
+        check_path(cmd.install_platlib, platlibdir)
6551b0
         check_path(cmd.install_purelib, libdir)
6551b0
         check_path(cmd.install_headers,
6551b0
                    os.path.join(destination, "include", "python", "foopkg"))
6551b0
diff --git a/Lib/site.py b/Lib/site.py
6551b0
index a065ab0b5d..22d53fa562 100644
6551b0
--- a/Lib/site.py
6551b0
+++ b/Lib/site.py
6551b0
@@ -335,11 +335,15 @@ def getsitepackages(prefixes=None):
6551b0
         seen.add(prefix)
6551b0
 
6551b0
         if os.sep == '/':
6551b0
+            sitepackages.append(os.path.join(prefix, "lib64",
6551b0
+                                        "python" + sys.version[:3],
6551b0
+                                        "site-packages"))
6551b0
             sitepackages.append(os.path.join(prefix, "lib",
6551b0
                                         "python%d.%d" % sys.version_info[:2],
6551b0
                                         "site-packages"))
6551b0
         else:
6551b0
             sitepackages.append(prefix)
6551b0
+            sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
6551b0
             sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
6551b0
     return sitepackages
6551b0
 
6551b0
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
6551b0
index b9e2fafbc0..0ae6d35b69 100644
6551b0
--- a/Lib/sysconfig.py
6551b0
+++ b/Lib/sysconfig.py
6551b0
@@ -20,10 +20,10 @@ __all__ = [
6551b0
 
6551b0
 _INSTALL_SCHEMES = {
6551b0
     'posix_prefix': {
6551b0
-        'stdlib': '{installed_base}/lib/python{py_version_short}',
6551b0
-        'platstdlib': '{platbase}/lib/python{py_version_short}',
6551b0
+        'stdlib': '{installed_base}/lib64/python{py_version_short}',
6551b0
+        'platstdlib': '{platbase}/lib64/python{py_version_short}',
6551b0
         'purelib': '{base}/lib/python{py_version_short}/site-packages',
6551b0
-        'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
6551b0
+        'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
6551b0
         'include':
6551b0
             '{installed_base}/include/python{py_version_short}{abiflags}',
6551b0
         'platinclude':
6551b0
@@ -62,10 +62,10 @@ _INSTALL_SCHEMES = {
6551b0
         'data': '{userbase}',
6551b0
         },
6551b0
     'posix_user': {
6551b0
-        'stdlib': '{userbase}/lib/python{py_version_short}',
6551b0
-        'platstdlib': '{userbase}/lib/python{py_version_short}',
6551b0
+        'stdlib': '{userbase}/lib64/python{py_version_short}',
6551b0
+        'platstdlib': '{userbase}/lib64/python{py_version_short}',
6551b0
         'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
6551b0
-        'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
6551b0
+        'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
6551b0
         'include': '{userbase}/include/python{py_version_short}',
6551b0
         'scripts': '{userbase}/bin',
6551b0
         'data': '{userbase}',
6551b0
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
1a5cfa
index 1bbc697936..9a7e80dfa0 100644
6551b0
--- a/Lib/test/test_site.py
6551b0
+++ b/Lib/test/test_site.py
1a5cfa
@@ -267,8 +267,8 @@ class HelperFunctionsTests(unittest.TestCase):
6551b0
         dirs = site.getsitepackages()
6551b0
         if os.sep == '/':
6551b0
             # OS X, Linux, FreeBSD, etc
6551b0
-            self.assertEqual(len(dirs), 1)
6551b0
-            wanted = os.path.join('xoxo', 'lib',
6551b0
+            self.assertEqual(len(dirs), 2)
6551b0
+            wanted = os.path.join('xoxo', 'lib64',
6551b0
                                   'python%d.%d' % sys.version_info[:2],
6551b0
                                   'site-packages')
6551b0
             self.assertEqual(dirs[0], wanted)
6551b0
diff --git a/Makefile.pre.in b/Makefile.pre.in
1a5cfa
index a914a9c70f..406a441082 100644
6551b0
--- a/Makefile.pre.in
6551b0
+++ b/Makefile.pre.in
6551b0
@@ -143,7 +143,7 @@ LIBDIR=		@libdir@
6551b0
 MANDIR=		@mandir@
6551b0
 INCLUDEDIR=	@includedir@
6551b0
 CONFINCLUDEDIR=	$(exec_prefix)/include
6551b0
-SCRIPTDIR=	$(prefix)/lib
6551b0
+SCRIPTDIR=	$(prefix)/lib64
6551b0
 ABIFLAGS=	@ABIFLAGS@
6551b0
 
6551b0
 # Detailed destination directories
6551b0
diff --git a/Modules/getpath.c b/Modules/getpath.c
6551b0
index b727f66953..a0c5fb6139 100644
6551b0
--- a/Modules/getpath.c
6551b0
+++ b/Modules/getpath.c
6551b0
@@ -730,7 +730,7 @@ calculate_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
6551b0
         if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) {
6551b0
             return PATHLEN_ERR();
6551b0
         }
6551b0
-        status = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len);
6551b0
+        status = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len);
6551b0
         if (_PyStatus_EXCEPTION(status)) {
6551b0
             return status;
6551b0
         }
6551b0
@@ -1067,7 +1067,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix,
6551b0
             return PATHLEN_ERR();
6551b0
         }
6551b0
     }
6551b0
-    status = joinpath(zip_path, L"lib/python00.zip", zip_path_len);
6551b0
+    status = joinpath(zip_path, L"lib64/python00.zip", zip_path_len);
6551b0
     if (_PyStatus_EXCEPTION(status)) {
6551b0
         return status;
6551b0
     }
6551b0
@@ -1197,7 +1197,7 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config)
6551b0
     if (!calculate->exec_prefix) {
6551b0
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
6551b0
     }
6551b0
-    calculate->lib_python = Py_DecodeLocale("lib/python" VERSION, &len;;
6551b0
+    calculate->lib_python = Py_DecodeLocale("lib64/python" VERSION, &len;;
6551b0
     if (!calculate->lib_python) {
6551b0
         return DECODE_LOCALE_ERR("EXEC_PREFIX define", len);
6551b0
     }
6551b0
diff --git a/configure b/configure
1a5cfa
index 8886561645..78867c6ffc 100755
6551b0
--- a/configure
6551b0
+++ b/configure
1a5cfa
@@ -15214,9 +15214,9 @@ fi
6551b0
 
6551b0
 
6551b0
 if test x$PLATFORM_TRIPLET = x; then
6551b0
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
6551b0
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
6551b0
 else
6551b0
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
6551b0
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
6551b0
 fi
6551b0
 
6551b0
 
6551b0
diff --git a/configure.ac b/configure.ac
1a5cfa
index d8de9d4943..477a5ff1cb 100644
6551b0
--- a/configure.ac
6551b0
+++ b/configure.ac
1a5cfa
@@ -4689,9 +4689,9 @@ fi
6551b0
 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
6551b0
 AC_SUBST(PY_ENABLE_SHARED)
6551b0
 if test x$PLATFORM_TRIPLET = x; then
6551b0
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
6551b0
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
6551b0
 else
6551b0
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
6551b0
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
6551b0
 fi
6551b0
 AC_SUBST(LIBPL)
6551b0
 
6551b0
diff --git a/setup.py b/setup.py
1a5cfa
index b168ed4082..8628b9d1cd 100644
6551b0
--- a/setup.py
6551b0
+++ b/setup.py
6551b0
@@ -649,7 +649,7 @@ class PyBuildExt(build_ext):
6551b0
         # directories (i.e. '.' and 'Include') must be first.  See issue
6551b0
         # 10520.
6551b0
         if not CROSS_COMPILING:
6551b0
-            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
6551b0
+            add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
6551b0
             add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
6551b0
         # only change this for cross builds for 3.3, issues on Mageia
6551b0
         if CROSS_COMPILING:
6551b0
@@ -953,11 +953,11 @@ class PyBuildExt(build_ext):
6551b0
             elif curses_library:
6551b0
                 readline_libs.append(curses_library)
6551b0
             elif self.compiler.find_library_file(self.lib_dirs +
6551b0
-                                                     ['/usr/lib/termcap'],
6551b0
+                                                     ['/usr/lib64/termcap'],
6551b0
                                                      'termcap'):
6551b0
                 readline_libs.append('termcap')
6551b0
             self.add(Extension('readline', ['readline.c'],
6551b0
-                               library_dirs=['/usr/lib/termcap'],
6551b0
+                               library_dirs=['/usr/lib64/termcap'],
6551b0
                                extra_link_args=readline_extra_link_args,
6551b0
                                libraries=readline_libs))
6551b0
         else:
6551b0
-- 
1a5cfa
2.26.2
6551b0