Source: automake-1.16
Version: 1:1.16.5-1.1
Severity: important
tags: patch

Hello, with the changes in Python3.10, packages using automake will try to 
install into /usr/local/lib
instead of /usr/lib

The following patch, inspired from the one made by Stefano for pybind11 in 
#1006615 [1]

http://launchpadlibrarian.net/588978778/automake-1.16_1%3A1.16.5-1.1_1%3A1.16.5-1.1ubuntu1.diff.gz

diff -Nru automake-1.16-1.16.5/debian/changelog 
automake-1.16-1.16.5/debian/changelog
--- automake-1.16-1.16.5/debian/changelog       2021-11-11 11:46:00.000000000 
+0000
+++ automake-1.16-1.16.5/debian/changelog       2022-03-04 09:29:43.000000000 
+0000
@@ -1,3 +1,10 @@
+automake-1.16 (1:1.16.5-1.2) unstable; urgency=medium
+
+  * Non maintainer upload
+  * Fix search paths for new Python 3.10 LP: #1960608 (Closes: #-1)
+
+ -- Gianfranco Costamagna <locutusofb...@debian.org>  Fri, 04 Mar 2022 
10:29:43 +0100
+
 automake-1.16 (1:1.16.5-1.1) unstable; urgency=medium
* Non-maintainer upload.
diff -Nru automake-1.16-1.16.5/debian/patches/python3.10-sysconfig.patch 
automake-1.16-1.16.5/debian/patches/python3.10-sysconfig.patch
--- automake-1.16-1.16.5/debian/patches/python3.10-sysconfig.patch      
1970-01-01 00:00:00.000000000 +0000
+++ automake-1.16-1.16.5/debian/patches/python3.10-sysconfig.patch      
2022-03-04 09:29:40.000000000 +0000
@@ -0,0 +1,33 @@
+Description: Apply a similar fix from the one in 
https://github.com/pybind/pybind11/pull/3764/files to fix
+installations in /usr/local of tools using automake, fox example firewalld.
+Author: Gianfranco Costamagna <locutusofb...@debian.org>
+Last-Update: 2022-03-04
+
+--- automake-1.16-1.16.5.orig/m4/python.m4
++++ automake-1.16-1.16.5/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')
diff -Nru automake-1.16-1.16.5/debian/patches/series 
automake-1.16-1.16.5/debian/patches/series
--- automake-1.16-1.16.5/debian/patches/series  2021-11-11 11:46:00.000000000 
+0000
+++ automake-1.16-1.16.5/debian/patches/series  2022-03-04 09:28:47.000000000 
+0000
@@ -2,3 +2,4 @@
 0002-Drop-SHELL.patch
 0003-t-python-prefix.sh-Respect-PYTHON-environment-variable.patch
 python3.10.patch
+python3.10-sysconfig.patch


[1] https://github.com/pybind/pybind11/pull/3764/files

Reply via email to