GNU bug report logs -
#54412
[PATCH] python: use the posix_prefix sysconfig scheme on Debian
Previous Next
Reported by: Stefano Rivera <stefanor <at> debian.org>
Date: Tue, 15 Mar 2022 23:43:02 UTC
Severity: normal
Tags: patch
Done: Karl Berry <karl <at> freefriends.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your bug report
#54412: [PATCH] python: use the posix_prefix sysconfig scheme on Debian
which was filed against the automake-patches package, has been closed.
The explanation is attached below, along with your original report.
If you require more details, please reply to 54412 <at> debbugs.gnu.org.
--
54412: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=54412
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
Guess it's time to close this one about the Python scheme to use with
Debian. We'll see how it turns out with the next pretest ... --thanks, karl.
[Message part 3 (message/rfc822, inline)]
Fixes Debian's bug: https://bugs.debian.org/1006784
Debian adds a custom sysconfig scheme to system python installs,
"posix_local". This is the default scheme, and it redirects local users'
Python module installs to /usr/local even though Python is installed
with a /usr prefix. Both are on Debian's python's sys.path module search
path.
Automake and its users understand prefixes, and are likely to select
/usr/local, explicitly. Select the "posix_prefix" scheme, with the
user-supplied prefix.
Previously this custom sysconfig scheme was specified in
distutils.sysconfig, but not sysconfig itself. As distutils is being
deprecated, the custom scheme is now specified in sysconfig, since
Debian's Python 3.10 (3.10.2-4).
Thank you, Gianfranco Costamagna <locutusofborg <at> debian.org>, for porting
the patch to automake.
* m4/python.m4: use the posix_prefix sysconfig scheme on Debian
Copyright-paperwork-exempt: yes
---
m4/python.m4 | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/m4/python.m4 b/m4/python.m4
index 6653e4d89..51e050c19 100644
--- a/m4/python.m4
+++ b/m4/python.m4
@@ -255,7 +255,11 @@ except ImportError:
am_cv_python_pythondir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
- sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'})
+ scheme = sysconfig.get_default_scheme()
+ if scheme == 'posix_local':
+ # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
+ scheme = 'posix_prefix'
+ sitedir = sysconfig.get_path('purelib', scheme, vars={'base':'$am_py_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix')
@@ -297,7 +301,11 @@ sys.stdout.write(sitedir)"`
am_cv_python_pyexecdir=`$PYTHON -c "
$am_python_setup_sysconfig
if can_use_sysconfig:
- sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'})
+ scheme = sysconfig.get_default_scheme()
+ if scheme == 'posix_local':
+ # Debian's default scheme installs to /usr/local/ but we want to find headers in /usr/
+ scheme = 'posix_prefix'
+ sitedir = sysconfig.get_path('platlib', scheme, vars={'platbase':'$am_py_exec_prefix'})
else:
from distutils import sysconfig
sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix')
--
2.35.1
This bug report was last modified 1 year and 121 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.