From b28ae6736977beefdae997a52d5e5b6b072b8879 Mon Sep 17 00:00:00 2001 From: vucoda Date: Tue, 1 Aug 2023 17:12:46 +0930 Subject: Fix source bootstrapping for Debian and derivatives (#39107) * Fix Python package.py for Debian and derivatives to find the system Python library location When bootstrapping from source, find_library() does not contain any paths that work for Debian and derivatives. fixes #36666 * Update to pass styling * Update to styling * Update python package.py with fake config value for LIBPL * Update python package.py libpl config_vars entry to follow double quote standard * styling update --- var/spack/repos/builtin/packages/python/package.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py index eb991c42ae..5eeb2913c6 100644 --- a/var/spack/repos/builtin/packages/python/package.py +++ b/var/spack/repos/builtin/packages/python/package.py @@ -878,6 +878,9 @@ print(json.dumps(config)) "INCLUDEPY": self.prefix.include.join("python{}").format(version), "LIBDEST": self.prefix.lib.join("python{}").format(version), "LIBDIR": self.prefix.lib, + "LIBPL": self.prefix.lib.join("python{0}") + .join("config-{0}-{1}") + .format(version, sys.platform), "LDLIBRARY": "{}python{}.{}".format(lib_prefix, version, dso_suffix), "LIBRARY": "{}python{}.{}".format(lib_prefix, version, stat_suffix), "LDSHARED": "cc", @@ -947,6 +950,10 @@ print(json.dumps(config)) # in either lib or lib64, so we need to ask Python where its LIBDIR is. libdir = self.config_vars["LIBDIR"] + # Debian and derivatives use a triplet subdir under /usr/lib, LIBPL can be used + # to get the Python library directory + libpldir = self.config_vars["LIBPL"] + # The system Python installation on macOS and Homebrew installations # install libraries into a Frameworks directory frameworkprefix = self.config_vars["PYTHONFRAMEWORKPREFIX"] @@ -962,7 +969,14 @@ print(json.dumps(config)) win_bin_dir = self.config_vars["BINDIR"] win_root_dir = self.config_vars["prefix"] - directories = [libdir, frameworkprefix, macos_developerdir, win_bin_dir, win_root_dir] + directories = [ + libdir, + libpldir, + frameworkprefix, + macos_developerdir, + win_bin_dir, + win_root_dir, + ] # The Python shipped with Xcode command line tools isn't in any of these locations for subdir in ["lib", "lib64"]: -- cgit v1.2.3-60-g2f50