churchyard / rpms / python3

Forked from rpms/python3 6 years ago
Clone

Blame 00102-lib64.patch

a262879
From 16ee9d86a77c8bbca3d41c9926130d37686d3bf3 Mon Sep 17 00:00:00 2001
285f554
From: David Malcolm <dmalcolm@redhat.com>
285f554
Date: Wed, 13 Jan 2010 21:25:18 +0000
29530ba
Subject: [PATCH] 00102: Change the various install paths to use /usr/lib64/
29530ba
 instead or /usr/lib/
285f554
MIME-Version: 1.0
285f554
Content-Type: text/plain; charset=UTF-8
285f554
Content-Transfer-Encoding: 8bit
285f554
285f554
Only used when "%{_lib}" == "lib64".
285f554
285f554
Co-authored-by: David Malcolm <dmalcolm@redhat.com>
285f554
Co-authored-by: Thomas Spura <tomspur@fedoraproject.org>
285f554
Co-authored-by: Slavek Kabrda <bkabrda@redhat.com>
285f554
Co-authored-by: Matej Stuchlik <mstuchli@redhat.com>
285f554
Co-authored-by: Tomas Orsava <torsava@redhat.com>
285f554
Co-authored-by: Charalampos Stratakis <cstratak@redhat.com>
285f554
Co-authored-by: Petr Viktorin <pviktori@redhat.com>
285f554
Co-authored-by: Miro HronĨok <miro@hroncok.cz>
285f554
Co-authored-by: Iryna Shcherbina <shcherbina.iryna@gmail.com>
285f554
---
285f554
 Lib/distutils/command/install.py    |  4 ++--
285f554
 Lib/distutils/sysconfig.py          |  6 +++++-
285f554
 Lib/distutils/tests/test_install.py |  3 ++-
285f554
 Lib/site.py                         |  4 ++++
285f554
 Lib/sysconfig.py                    | 12 ++++++------
285f554
 Lib/test/test_site.py               |  4 ++--
285f554
 Makefile.pre.in                     |  2 +-
285f554
 Modules/getpath.c                   |  6 +++---
7aab0dd
 configure                           |  4 ++--
7aab0dd
 configure.ac                        |  4 ++--
285f554
 setup.py                            |  6 +++---
7aab0dd
 11 files changed, 32 insertions(+), 23 deletions(-)
285f554
6cd1c5f
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
285f554
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
285f554
index b51629eb94..9a4892a737 100644
6cd1c5f
--- a/Lib/distutils/sysconfig.py
6cd1c5f
+++ b/Lib/distutils/sysconfig.py
285f554
@@ -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
285f554
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
13257b5
index a065ab0b5d..22d53fa562 100644
6cd1c5f
--- a/Lib/site.py
6cd1c5f
+++ b/Lib/site.py
13257b5
@@ -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
9a14f3e
index b9e2fafbc0..0ae6d35b69 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
285f554
index 41c4229919..543c88432a 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
9a14f3e
index 502317aa0c..4ad3df1122 100644
6cd1c5f
--- a/Makefile.pre.in
6cd1c5f
+++ b/Makefile.pre.in
285f554
@@ -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
9a14f3e
index b727f66953..a0c5fb6139 100644
6cd1c5f
--- a/Modules/getpath.c
6cd1c5f
+++ b/Modules/getpath.c
9a14f3e
@@ -730,7 +730,7 @@ calculate_exec_prefix(PyCalculatePath *calculate, _PyPathConfig *pathconfig,
804ec7c
         if (safe_wcscpy(exec_prefix, calculate->exec_prefix, exec_prefix_len) < 0) {
804ec7c
             return PATHLEN_ERR();
804ec7c
         }
a292838
-        status = joinpath(exec_prefix, L"lib/lib-dynload", exec_prefix_len);
a292838
+        status = joinpath(exec_prefix, L"lib64/lib-dynload", exec_prefix_len);
a292838
         if (_PyStatus_EXCEPTION(status)) {
a292838
             return status;
804ec7c
         }
9a14f3e
@@ -1067,7 +1067,7 @@ calculate_zip_path(PyCalculatePath *calculate, const wchar_t *prefix,
804ec7c
             return PATHLEN_ERR();
c9349a7
         }
5080ffc
     }
9a14f3e
-    status = joinpath(zip_path, L"lib/python00.zip", zip_path_len);
9a14f3e
+    status = joinpath(zip_path, L"lib64/python00.zip", zip_path_len);
a292838
     if (_PyStatus_EXCEPTION(status)) {
a292838
         return status;
c9349a7
     }
9a14f3e
@@ -1197,7 +1197,7 @@ calculate_init(PyCalculatePath *calculate, const PyConfig *config)
9a14f3e
     if (!calculate->exec_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
     }
7aab0dd
diff --git a/configure b/configure
8d46a84
index 0914e24704..889d6b6a7f 100755
7aab0dd
--- a/configure
7aab0dd
+++ b/configure
8d46a84
@@ -15170,9 +15170,9 @@ fi
7aab0dd
 
7aab0dd
 
7aab0dd
 if test x$PLATFORM_TRIPLET = x; then
7aab0dd
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
7aab0dd
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
7aab0dd
 else
7aab0dd
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
7aab0dd
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
7aab0dd
 fi
7aab0dd
 
7aab0dd
 
7aab0dd
diff --git a/configure.ac b/configure.ac
8d46a84
index 7051dc109a..a13be153fa 100644
7aab0dd
--- a/configure.ac
7aab0dd
+++ b/configure.ac
9a14f3e
@@ -4668,9 +4668,9 @@ fi
7aab0dd
 dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
7aab0dd
 AC_SUBST(PY_ENABLE_SHARED)
7aab0dd
 if test x$PLATFORM_TRIPLET = x; then
7aab0dd
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
7aab0dd
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
7aab0dd
 else
7aab0dd
-  LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
7aab0dd
+  LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
7aab0dd
 fi
7aab0dd
 AC_SUBST(LIBPL)
7aab0dd
 
6cd1c5f
diff --git a/setup.py b/setup.py
9a14f3e
index 20d7f35652..024a1035c0 100644
6cd1c5f
--- a/setup.py
6cd1c5f
+++ b/setup.py
9a14f3e
@@ -649,7 +649,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:
9a14f3e
@@ -953,11 +953,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:
285f554
-- 
a262879
2.24.1
285f554