aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2018-06-17 11:14:43 -0400
committerMichał Górny <mgorny@gentoo.org>2020-04-22 12:14:31 +0200
commit215596d83a23edb6acfc8a15e677a2200c50cd3d (patch)
tree9b88f7472e377eddb93a1f0a371f69e208fbd0f6
parentDisable modules and SSL (diff)
downloadcpython-215596d83a23edb6acfc8a15e677a2200c50cd3d.tar.gz
cpython-215596d83a23edb6acfc8a15e677a2200c50cd3d.tar.bz2
cpython-215596d83a23edb6acfc8a15e677a2200c50cd3d.zip
Gentoo libdir
-rw-r--r--Lib/distutils/command/install.py4
-rw-r--r--Lib/distutils/sysconfig.py2
-rw-r--r--Lib/site.py4
-rw-r--r--Lib/sysconfig.py16
-rw-r--r--Lib/test/test_site.py4
-rw-r--r--Makefile.pre.in2
-rw-r--r--Modules/Setup.dist2
-rw-r--r--Modules/getpath.c6
-rw-r--r--setup.py25
9 files changed, 30 insertions, 35 deletions
diff --git a/Lib/distutils/command/install.py b/Lib/distutils/command/install.py
index b9f1c6c566f..a2822e86e96 100644
--- a/Lib/distutils/command/install.py
+++ b/Lib/distutils/command/install.py
@@ -41,8 +41,8 @@ else:
INSTALL_SCHEMES = {
'unix_prefix': {
- 'purelib': '$base/lib/python$py_version_short/site-packages',
- 'platlib': '$platbase/lib/python$py_version_short/site-packages',
+ 'purelib': '$base/@@GENTOO_LIBDIR@@/python$py_version_short/site-packages',
+ 'platlib': '$platbase/@@GENTOO_LIBDIR@@/python$py_version_short/site-packages',
'headers': '$base/include/python$py_version_short/$dist_name',
'scripts': '$base/bin',
'data' : '$base',
diff --git a/Lib/distutils/sysconfig.py b/Lib/distutils/sysconfig.py
index 1a4b7926441..a749178ce95 100644
--- a/Lib/distutils/sysconfig.py
+++ b/Lib/distutils/sysconfig.py
@@ -130,7 +130,7 @@ def get_python_lib(plat_specific=0, standard_lib=0, prefix=None):
if os.name == "posix":
libpython = os.path.join(prefix,
- "lib", "python" + get_python_version())
+ "@@GENTOO_LIBDIR@@", "python" + get_python_version())
if standard_lib:
return libpython
else:
diff --git a/Lib/site.py b/Lib/site.py
index 3b51e81d4a1..9ce73b543b1 100644
--- a/Lib/site.py
+++ b/Lib/site.py
@@ -288,10 +288,10 @@ def getsitepackages():
if sys.platform in ('os2emx', 'riscos'):
sitepackages.append(os.path.join(prefix, "Lib", "site-packages"))
elif os.sep == '/':
- sitepackages.append(os.path.join(prefix, "lib",
+ sitepackages.append(os.path.join(prefix, "@@GENTOO_LIBDIR@@",
"python" + sys.version[:3],
"site-packages"))
- sitepackages.append(os.path.join(prefix, "lib", "site-python"))
+ sitepackages.append(os.path.join(prefix, "@@GENTOO_LIBDIR@@", "site-python"))
else:
sitepackages.append(prefix)
sitepackages.append(os.path.join(prefix, "lib", "site-packages"))
diff --git a/Lib/sysconfig.py b/Lib/sysconfig.py
index 9c8350d953d..972c03be440 100644
--- a/Lib/sysconfig.py
+++ b/Lib/sysconfig.py
@@ -7,10 +7,10 @@ from os.path import pardir, realpath
_INSTALL_SCHEMES = {
'posix_prefix': {
- 'stdlib': '{base}/lib/python{py_version_short}',
- 'platstdlib': '{platbase}/lib/python{py_version_short}',
- 'purelib': '{base}/lib/python{py_version_short}/site-packages',
- 'platlib': '{platbase}/lib/python{py_version_short}/site-packages',
+ 'stdlib': '{base}/@@GENTOO_LIBDIR@@/python{py_version_short}',
+ 'platstdlib': '{platbase}/@@GENTOO_LIBDIR@@/python{py_version_short}',
+ 'purelib': '{base}/@@GENTOO_LIBDIR@@/python{py_version_short}/site-packages',
+ 'platlib': '{platbase}/@@GENTOO_LIBDIR@@/python{py_version_short}/site-packages',
'include': '{base}/include/python{py_version_short}',
'platinclude': '{platbase}/include/python{py_version_short}',
'scripts': '{base}/bin',
@@ -65,10 +65,10 @@ _INSTALL_SCHEMES = {
'data' : '{userbase}',
},
'posix_user': {
- 'stdlib': '{userbase}/lib/python{py_version_short}',
- 'platstdlib': '{userbase}/lib/python{py_version_short}',
- 'purelib': '{userbase}/lib/python{py_version_short}/site-packages',
- 'platlib': '{userbase}/lib/python{py_version_short}/site-packages',
+ 'stdlib': '{userbase}/@@GENTOO_LIBDIR@@/python{py_version_short}',
+ 'platstdlib': '{userbase}/@@GENTOO_LIBDIR@@/python{py_version_short}',
+ 'purelib': '{userbase}/@@GENTOO_LIBDIR@@/python{py_version_short}/site-packages',
+ 'platlib': '{userbase}/@@GENTOO_LIBDIR@@/python{py_version_short}/site-packages',
'include': '{userbase}/include/python{py_version_short}',
'scripts': '{userbase}/bin',
'data' : '{userbase}',
diff --git a/Lib/test/test_site.py b/Lib/test/test_site.py
index b4384ee2cf8..b1101409b8f 100644
--- a/Lib/test/test_site.py
+++ b/Lib/test/test_site.py
@@ -255,10 +255,10 @@ class HelperFunctionsTests(unittest.TestCase):
elif os.sep == '/':
# OS X, Linux, FreeBSD, etc
self.assertEqual(len(dirs), 2)
- wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3],
+ wanted = os.path.join('xoxo', '@@GENTOO_LIBDIR@@', 'python' + sys.version[:3],
'site-packages')
self.assertEqual(dirs[0], wanted)
- wanted = os.path.join('xoxo', 'lib', 'site-python')
+ wanted = os.path.join('xoxo', '@@GENTOO_LIBDIR@@', 'site-python')
self.assertEqual(dirs[1], wanted)
else:
# other platforms
diff --git a/Makefile.pre.in b/Makefile.pre.in
index cec0c3c489b..c8779f302c7 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -110,7 +110,7 @@ LIBDIR= @libdir@
MANDIR= @mandir@
INCLUDEDIR= @includedir@
CONFINCLUDEDIR= $(exec_prefix)/include
-SCRIPTDIR= $(prefix)/lib
+SCRIPTDIR= $(prefix)/@@GENTOO_LIBDIR@@
# Detailed destination directories
BINLIBDEST= $(LIBDIR)/python$(VERSION)
diff --git a/Modules/Setup.dist b/Modules/Setup.dist
index bbc92221296..da175ec75aa 100644
--- a/Modules/Setup.dist
+++ b/Modules/Setup.dist
@@ -464,7 +464,7 @@ GLHACK=-Dclear=__GLclear
# Andrew Kuchling's zlib module.
# This require zlib 1.1.3 (or later).
# See http://www.gzip.org/zlib/
-#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
+#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/@@GENTOO_LIBDIR@@ -lz
# Interface to the Expat XML parser
# More information on Expat can be found at www.libexpat.org.
diff --git a/Modules/getpath.c b/Modules/getpath.c
index 092ccc712f9..eee75c45c50 100644
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -108,7 +108,7 @@ static char prefix[MAXPATHLEN+1];
static char exec_prefix[MAXPATHLEN+1];
static char progpath[MAXPATHLEN+1];
static char *module_search_path = NULL;
-static char lib_python[] = "lib/python" VERSION;
+static char lib_python[] = "@@GENTOO_LIBDIR@@/python" VERSION;
static void
reduce(char *dir)
@@ -520,7 +520,7 @@ calculate_path(void)
}
else
strncpy(zip_path, PREFIX, MAXPATHLEN);
- joinpath(zip_path, "lib/python00.zip");
+ joinpath(zip_path, "@@GENTOO_LIBDIR@@/python00.zip");
bufsz = strlen(zip_path); /* Replace "00" with version */
zip_path[bufsz - 6] = VERSION[0];
zip_path[bufsz - 5] = VERSION[2];
@@ -530,7 +530,7 @@ calculate_path(void)
fprintf(stderr,
"Could not find platform dependent libraries <exec_prefix>\n");
strncpy(exec_prefix, EXEC_PREFIX, MAXPATHLEN);
- joinpath(exec_prefix, "lib/lib-dynload");
+ joinpath(exec_prefix, "@@GENTOO_LIBDIR@@/lib-dynload");
}
/* If we found EXEC_PREFIX do *not* reduce it! (Yet.) */
diff --git a/setup.py b/setup.py
index cc423edcb23..fad7c39f256 100644
--- a/setup.py
+++ b/setup.py
@@ -514,7 +514,7 @@ class PyBuildExt(build_ext):
global disable_ssl
# Ensure that /usr/local is always used
if not cross_compiling:
- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib')
+ add_dir_to_list(self.compiler.library_dirs, '/usr/local/@@GENTOO_LIBDIR@@')
add_dir_to_list(self.compiler.include_dirs, '/usr/local/include')
if cross_compiling:
self.add_gcc_paths()
@@ -581,8 +581,7 @@ class PyBuildExt(build_ext):
):
add_dir_to_list(inc_dirs, d)
for d in (
- '/lib64', '/usr/lib64',
- '/lib', '/usr/lib',
+ '/@@GENTOO_LIBDIR@@', '/usr/@@GENTOO_LIBDIR@@',
):
add_dir_to_list(lib_dirs, d)
exts = []
@@ -840,11 +839,11 @@ class PyBuildExt(build_ext):
elif curses_library:
readline_libs.append(curses_library)
elif self.compiler.find_library_file(lib_dirs +
- ['/usr/lib/termcap'],
+ ['/usr/@@GENTOO_LIBDIR@@/termcap'],
'termcap'):
readline_libs.append('termcap')
exts.append( Extension('readline', ['readline.c'],
- library_dirs=['/usr/lib/termcap'],
+ library_dirs=['/usr/@@GENTOO_LIBDIR@@/termcap'],
extra_link_args=readline_extra_link_args,
libraries=readline_libs) )
else:
@@ -1110,8 +1109,7 @@ class PyBuildExt(build_ext):
# check lib directories parallel to the location of the header
db_dirs_to_check = [
- db_incdir.replace("include", 'lib64'),
- db_incdir.replace("include", 'lib'),
+ db_incdir.replace("include", '@@GENTOO_LIBDIR@@'),
]
if host_platform != 'darwin':
@@ -1224,10 +1222,8 @@ class PyBuildExt(build_ext):
if sqlite_incdir:
sqlite_dirs_to_check = [
- os.path.join(sqlite_incdir, '..', 'lib64'),
- os.path.join(sqlite_incdir, '..', 'lib'),
- os.path.join(sqlite_incdir, '..', '..', 'lib64'),
- os.path.join(sqlite_incdir, '..', '..', 'lib'),
+ os.path.join(sqlite_incdir, '..', '@@GENTOO_LIBDIR@@'),
+ os.path.join(sqlite_incdir, '..', '..', '@@GENTOO_LIBDIR@@'),
]
sqlite_libfile = self.compiler.find_library_file(
sqlite_dirs_to_check + lib_dirs, 'sqlite3')
@@ -1994,15 +1990,14 @@ class PyBuildExt(build_ext):
added_lib_dirs.append('/usr/openwin/lib')
elif os.path.exists('/usr/X11R6/include'):
include_dirs.append('/usr/X11R6/include')
- added_lib_dirs.append('/usr/X11R6/lib64')
- added_lib_dirs.append('/usr/X11R6/lib')
+ added_lib_dirs.append('/usr/X11R6/@@GENTOO_LIBDIR@@')
elif os.path.exists('/usr/X11R5/include'):
include_dirs.append('/usr/X11R5/include')
- added_lib_dirs.append('/usr/X11R5/lib')
+ added_lib_dirs.append('/usr/X11R5/@@GENTOO_LIBDIR@@')
else:
# Assume default location for X11
include_dirs.append('/usr/X11/include')
- added_lib_dirs.append('/usr/X11/lib')
+ added_lib_dirs.append('/usr/X11/@@GENTOO_LIBDIR@@')
# If Cygwin, then verify that X is installed before proceeding
if host_platform == 'cygwin':