Skip to content

Commit eb5f8e0

Browse files
davidmalcolmtomspurbkabrdasYnfotorsava
authored andcommitted
00102: Change the various install paths to use /usr/lib64/ instead or /usr/lib/
Only used when "%{_lib}" == "lib64". Co-authored-by: David Malcolm <[email protected]> Co-authored-by: Thomas Spura <[email protected]> Co-authored-by: Slavek Kabrda <[email protected]> Co-authored-by: Matej Stuchlik <[email protected]> Co-authored-by: Tomas Orsava <[email protected]> Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Petr Viktorin <[email protected]> Co-authored-by: Miro Hrončok <[email protected]> Co-authored-by: Iryna Shcherbina <[email protected]>
1 parent 7a25632 commit eb5f8e0

File tree

10 files changed

+32
-23
lines changed

10 files changed

+32
-23
lines changed

Lib/distutils/command/install.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@
3030
INSTALL_SCHEMES = {
3131
'unix_prefix': {
3232
'purelib': '$base/lib/python$py_version_short/site-packages',
33-
'platlib': '$platbase/lib/python$py_version_short/site-packages',
33+
'platlib': '$platbase/lib64/python$py_version_short/site-packages',
3434
'headers': '$base/include/python$py_version_short$abiflags/$dist_name',
3535
'scripts': '$base/bin',
3636
'data' : '$base',
3737
},
3838
'unix_home': {
3939
'purelib': '$base/lib/python',
40-
'platlib': '$base/lib/python',
40+
'platlib': '$base/lib64/python',
4141
'headers': '$base/include/python/$dist_name',
4242
'scripts': '$base/bin',
4343
'data' : '$base',

Lib/distutils/sysconfig.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,12 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
129129
prefix = plat_specific and EXEC_PREFIX or PREFIX
130130

131131
if os.name == "posix":
132+
if plat_specific or standard_lib:
133+
lib = "lib64"
134+
else:
135+
lib = "lib"
132136
libpython = os.path.join(prefix,
133-
"lib", "python" + get_python_version())
137+
lib, "python" + get_python_version())
134138
if standard_lib:
135139
return libpython
136140
else:

Lib/distutils/tests/test_install.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,9 @@ def check_path(got, expected):
5757
self.assertEqual(got, expected)
5858

5959
libdir = os.path.join(destination, "lib", "python")
60+
platlibdir = os.path.join(destination, "lib64", "python")
6061
check_path(cmd.install_lib, libdir)
61-
check_path(cmd.install_platlib, libdir)
62+
check_path(cmd.install_platlib, platlibdir)
6263
check_path(cmd.install_purelib, libdir)
6364
check_path(cmd.install_headers,
6465
os.path.join(destination, "include", "python", "foopkg"))

Lib/site.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,11 +304,15 @@ def getsitepackages(prefixes=None):
304304
seen.add(prefix)
305305

306306
if os.sep == '/':
307+
sitepackages.append(os.path.join(prefix, "lib64",
308+
"python" + sys.version[:3],
309+
"site-packages"))
307310
sitepackages.append(os.path.join(prefix, "lib",
308311
"python%d.%d" % sys.version_info[:2],
309312
"site-packages"))
310313
else:
311314
sitepackages.append(prefix)
315+
sitepackages.append(os.path.join(prefix, "lib64", "site-packages"))
312316
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
313317
if sys.platform == "darwin":
314318
# for framework builds *only* we add the standard Apple

Lib/sysconfig.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020

2121
_INSTALL_SCHEMES = {
2222
'posix_prefix': {
23-
'stdlib': '{installed_base}/lib/python{py_version_short}',
24-
'platstdlib': '{platbase}/lib/python{py_version_short}',
23+
'stdlib': '{installed_base}/lib64/python{py_version_short}',
24+
'platstdlib': '{platbase}/lib64/python{py_version_short}',
2525
'purelib': '{base}/lib/python{py_version_short}/site-packages',
26-
'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
26+
'platlib': '{platbase}/lib64/python{py_version_short}/site-packages',
2727
'include':
2828
'{installed_base}/include/python{py_version_short}{abiflags}',
2929
'platinclude':
@@ -61,10 +61,10 @@
6161
'data': '{userbase}',
6262
},
6363
'posix_user': {
64-
'stdlib': '{userbase}/lib/python{py_version_short}',
65-
'platstdlib': '{userbase}/lib/python{py_version_short}',
64+
'stdlib': '{userbase}/lib64/python{py_version_short}',
65+
'platstdlib': '{userbase}/lib64/python{py_version_short}',
6666
'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
67-
'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
67+
'platlib': '{userbase}/lib64/python{py_version_short}/site-packages',
6868
'include': '{userbase}/include/python{py_version_short}',
6969
'scripts': '{userbase}/bin',
7070
'data': '{userbase}',

Lib/test/test_site.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,8 +264,8 @@ def test_getsitepackages(self):
264264
self.assertEqual(dirs[1], wanted)
265265
elif os.sep == '/':
266266
# OS X non-framework builds, Linux, FreeBSD, etc
267-
self.assertEqual(len(dirs), 1)
268-
wanted = os.path.join('xoxo', 'lib',
267+
self.assertEqual(len(dirs), 2)
268+
wanted = os.path.join('xoxo', 'lib64',
269269
'python%d.%d' % sys.version_info[:2],
270270
'site-packages')
271271
self.assertEqual(dirs[0], wanted)

Makefile.pre.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ LIBDIR= @libdir@
139139
MANDIR= @mandir@
140140
INCLUDEDIR= @includedir@
141141
CONFINCLUDEDIR= $(exec_prefix)/include
142-
SCRIPTDIR= $(prefix)/lib
142+
SCRIPTDIR= $(prefix)/lib64
143143
ABIFLAGS= @ABIFLAGS@
144144

145145
# Detailed destination directories

Modules/getpath.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -494,7 +494,7 @@ calculate_path(void)
494494
_pythonpath = Py_DecodeLocale(PYTHONPATH, NULL);
495495
_prefix = Py_DecodeLocale(PREFIX, NULL);
496496
_exec_prefix = Py_DecodeLocale(EXEC_PREFIX, NULL);
497-
lib_python = Py_DecodeLocale("lib/python" VERSION, NULL);
497+
lib_python = Py_DecodeLocale("lib64/python" VERSION, NULL);
498498

499499
if (!_pythonpath || !_prefix || !_exec_prefix || !lib_python) {
500500
Py_FatalError(
@@ -683,7 +683,7 @@ calculate_path(void)
683683
}
684684
else
685685
wcsncpy(zip_path, _prefix, MAXPATHLEN);
686-
joinpath(zip_path, L"lib/python00.zip");
686+
joinpath(zip_path, L"lib64/python00.zip");
687687
bufsz = wcslen(zip_path); /* Replace "00" with version */
688688
zip_path[bufsz - 6] = VERSION[0];
689689
zip_path[bufsz - 5] = VERSION[2];
@@ -695,7 +695,7 @@ calculate_path(void)
695695
fprintf(stderr,
696696
"Could not find platform dependent libraries <exec_prefix>\n");
697697
wcsncpy(exec_prefix, _exec_prefix, MAXPATHLEN);
698-
joinpath(exec_prefix, L"lib/lib-dynload");
698+
joinpath(exec_prefix, L"lib64/lib-dynload");
699699
}
700700
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
701701

configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4771,9 +4771,9 @@ AC_MSG_RESULT($LDVERSION)
47714771
dnl define LIBPL after ABIFLAGS and LDVERSION is defined.
47724772
AC_SUBST(PY_ENABLE_SHARED)
47734773
if test x$PLATFORM_TRIPLET = x; then
4774-
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}"
4774+
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}"
47754775
else
4776-
LIBPL='$(prefix)'"/lib/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
4776+
LIBPL='$(prefix)'"/lib64/python${VERSION}/config-${LDVERSION}-${PLATFORM_TRIPLET}"
47774777
fi
47784778
AC_SUBST(LIBPL)
47794779

setup.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ def detect_modules(self):
521521
# directories (i.e. '.' and 'Include') must be first. See issue
522522
# 10520.
523523
if not cross_compiling:
524-
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
524+
add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib64')
525525
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
526526
# only change this for cross builds for 3.3, issues on Mageia
527527
if cross_compiling:
@@ -818,11 +818,11 @@ def detect_modules(self):
818818
elif curses_library:
819819
readline_libs.append(curses_library)
820820
elif self.compiler.find_library_file(lib_dirs +
821-
['/usr/lib/termcap'],
821+
['/usr/lib64/termcap'],
822822
'termcap'):
823823
readline_libs.append('termcap')
824824
exts.append( Extension('readline', ['readline.c'],
825-
library_dirs=['/usr/lib/termcap'],
825+
library_dirs=['/usr/lib64/termcap'],
826826
extra_link_args=readline_extra_link_args,
827827
libraries=readline_libs) )
828828
else:
@@ -859,8 +859,8 @@ def detect_modules(self):
859859
if krb5_h:
860860
ssl_incs += krb5_h
861861
ssl_libs = find_library_file(self.compiler, 'ssl',lib_dirs,
862-
['/usr/local/ssl/lib',
863-
'/usr/contrib/ssl/lib/'
862+
['/usr/local/ssl/lib64',
863+
'/usr/contrib/ssl/lib64/'
864864
] )
865865

866866
if (ssl_incs is not None and

0 commit comments

Comments
 (0)