churchyard / rpms / python38

Forked from rpms/python38 5 years ago
Clone
157a31f
From 331d11692ff564f152157bffbcaaf97e4c2676d2 Mon Sep 17 00:00:00 2001
7fd9466
From: David Malcolm <dmalcolm@redhat.com>
7fd9466
Date: Wed, 13 Jan 2010 21:25:18 +0000
d60dd4f
Subject: [PATCH] 00102: Change the various install paths to use /usr/lib64/
d60dd4f
 instead or /usr/lib/
7fd9466
MIME-Version: 1.0
7fd9466
Content-Type: text/plain; charset=UTF-8
7fd9466
Content-Transfer-Encoding: 8bit
7fd9466
7fd9466
Only used when "%{_lib}" == "lib64".
7fd9466
7fd9466
Co-authored-by: David Malcolm <dmalcolm@redhat.com>
7fd9466
Co-authored-by: Thomas Spura <tomspur@fedoraproject.org>
7fd9466
Co-authored-by: Slavek Kabrda <bkabrda@redhat.com>
7fd9466
Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
7fd9466
Co-authored-by: Tomas Orsava <torsava@redhat.com>
7fd9466
Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
7fd9466
Co-authored-by: Petr Viktorin <pviktori@redhat.com>
7fd9466
Co-authored-by: Miro HronĨok <miro@hroncok.cz>
7fd9466
Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
7fd9466
---
7fd9466
 Lib/distutils/command/install.py    |  4 ++--
7fd9466
 Lib/distutils/sysconfig.py          |  6 +++++-
7fd9466
 Lib/distutils/tests/test_install.py |  3 ++-
7fd9466
 Lib/site.py                         |  4 ++++
7fd9466
 Lib/sysconfig.py                    | 12 ++++++------
7fd9466
 Lib/test/test_site.py               |  4 ++--
7fd9466
 Makefile.pre.in                     |  2 +-
7fd9466
 Modules/getpath.c                   |  6 +++---
74db11e
 configure                           |  4 ++--
74db11e
 configure.ac                        |  4 ++--
7fd9466
 setup.py                            |  6 +++---
74db11e
 11 files changed, 32 insertions(+), 23 deletions(-)
7fd9466
6cd1c5f
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
7fd9466
index c625c95bf7..ae4f915669 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
7fd9466
index b51629eb94..9a4892a737 100644
6cd1c5f
--- a/Lib/distutils/sysconfig.py
6cd1c5f
+++ b/Lib/distutils/sysconfig.py
7fd9466
@@ -146,8 +146,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
7fd9466
index 287ab1989e..d4c05e0ab1 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
ec69e79
index a065ab0b5d..22d53fa562 100644
6cd1c5f
--- a/Lib/site.py
6cd1c5f
+++ b/Lib/site.py
ec69e79
@@ -335,11 +335,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
ec69e79
index e76e6927cb..0cfbea54b9 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
7fd9466
index 41c4229919..543c88432a 100644
6cd1c5f
--- a/Lib/test/test_site.py
6cd1c5f
+++ b/Lib/test/test_site.py
6f3b5ba
@@ -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
d60dd4f
index 6a9f4b5270..61d650882f 100644
6cd1c5f
--- a/Makefile.pre.in
6cd1c5f
+++ b/Makefile.pre.in
7fd9466
@@ -143,7 +143,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
826480a
index 5f80738188..73d7913441 100644
6cd1c5f
--- a/Modules/getpath.c
6cd1c5f
+++ b/Modules/getpath.c
826480a
@@ -689,7 +689,7 @@ calculate_exec_prefix(const PyConfig *config,
6f3b5ba
         if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) {
6f3b5ba
             return PATHLEN_ERR();
6f3b5ba
         }
826480a
-        status = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len);
826480a
+        status = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len);
826480a
         if (_PyStatus_EXCEPTION(status)) {
826480a
             return status;
6f3b5ba
         }
826480a
@@ -1016,7 +1016,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix)
6f3b5ba
             return PATHLEN_ERR();
c9349a7
         }
5080ffc
     }
826480a
-    status = joinpath(calculate->zip_path, L"lib/python00.zip", zip_path_len);
826480a
+    status = joinpath(calculate->zip_path, L"lib64/python00.zip", zip_path_len);
826480a
     if (_PyStatus_EXCEPTION(status)) {
826480a
         return status;
c9349a7
     }
826480a
@@ -1145,7 +1145,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
     }
74db11e
diff --git a/configure b/configure
157a31f
index 3cd9b8866c..7d4cbab2c0 100755
74db11e
--- a/configure
74db11e
+++ b/configure
157a31f
@@ -15197,9 +15197,9 @@ fi
74db11e
 
74db11e
 
74db11e
 if test x$PLATFORM_TRIPLET = x; then
74db11e
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
74db11e
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
74db11e
 else
74db11e
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
74db11e
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
74db11e
 fi
74db11e
 
74db11e
 
74db11e
diff --git a/configure.ac b/configure.ac
157a31f
index 033a93cd3f..5c8a04f61e 100644
74db11e
--- a/configure.ac
74db11e
+++ b/configure.ac
157a31f
@@ -4665,9 +4665,9 @@ fi
74db11e
 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
74db11e
 AC_SUBST(PY_ENABLE_SHARED)
74db11e
 if test x$PLATFORM_TRIPLET = x; then
74db11e
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
74db11e
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
74db11e
 else
74db11e
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
74db11e
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
74db11e
 fi
74db11e
 AC_SUBST(LIBPL)
74db11e
 
6cd1c5f
diff --git a/setup.py b/setup.py
157a31f
index be2ac0b01d..624274a75b 100644
6cd1c5f
--- a/setup.py
6cd1c5f
+++ b/setup.py
826480a
@@ -648,7 +648,7 @@ class PyBuildExt(build_ext):
5080ffc
         # directories (i.e. '.' and 'Include') must be first.  See issue
5080ffc
         # 10520.
6f3b5ba
         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
6f3b5ba
         if CROSS_COMPILING:
157a31f
@@ -946,11 +946,11 @@ class PyBuildExt(build_ext):
5080ffc
             elif curses_library:
5080ffc
                 readline_libs.append(curses_library)
6f3b5ba
             elif self.compiler.find_library_file(self.lib_dirs +
5080ffc
-                                                     ['/usr/lib/termcap'],
5080ffc
+                                                     ['/usr/lib64/termcap'],
5080ffc
                                                      'termcap'):
5080ffc
                 readline_libs.append('termcap')
6f3b5ba
             self.add(Extension('readline', ['readline.c'],
6f3b5ba
-                               library_dirs=['/usr/lib/termcap'],
6f3b5ba
+                               library_dirs=['/usr/lib64/termcap'],
6f3b5ba
                                extra_link_args=readline_extra_link_args,
6f3b5ba
                                libraries=readline_libs))
5080ffc
         else:
7fd9466
-- 
7fd9466
2.21.0
7fd9466