Control: tags 1026312 + patch Control: tags 1026312 + pending Dear maintainer,
I've prepared an NMU for meson (versioned as 1.0.0-1.1) and uploaded it to DELAYED/5. Please feel free to tell me if I should delay it longer. Regards. SR
diff -Nru meson-1.0.0/debian/changelog meson-1.0.0/debian/changelog --- meson-1.0.0/debian/changelog 2022-12-23 12:24:54.000000000 -0400 +++ meson-1.0.0/debian/changelog 2022-12-24 11:22:03.000000000 -0400 @@ -1,3 +1,11 @@ +meson (1.0.0-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Patch: Correctly select the Debian python scheme with modern distutils. + Closes: #1026312. + + -- Stefano Rivera <stefa...@debian.org> Sat, 24 Dec 2022 11:22:03 -0400 + meson (1.0.0-1) unstable; urgency=medium * New upstream release. diff -Nru meson-1.0.0/debian/patches/3-debian-sysconfig-layout.patch meson-1.0.0/debian/patches/3-debian-sysconfig-layout.patch --- meson-1.0.0/debian/patches/3-debian-sysconfig-layout.patch 1969-12-31 20:00:00.000000000 -0400 +++ meson-1.0.0/debian/patches/3-debian-sysconfig-layout.patch 2022-12-24 11:22:03.000000000 -0400 @@ -0,0 +1,60 @@ +From 9cea9e351d20d58f447b06baa7bb9a3f5cc40ea4 Mon Sep 17 00:00:00 2001 +From: Stefano Rivera <stef...@rivera.za.net> +Date: Mon, 19 Dec 2022 19:56:32 -0400 +Subject: [PATCH] Update the Debian Python path detection for setuptools >= 60 + +Debian now (since Python 3.10.2-6) adds the deb_system scheme to +sysconfig. Newer distutils (such as bundled with setuptools >= 60) adds +fetch schemes from sysconfig, rather than duplicating the sysconfig +schemes statically in distutils.command.install. + +This change broke meson's deb_system check. + +This patch replaces that mechanism (for newer Debian releases) with +explicit scheme selection, which is far simpler. +But it also retains the old mechanism, for older Debian releases that +require it (Debian <= 11). + +Fixes: #8739 (for python module, and makes similar minimal changes to the python3 module) + +Fixes: https://bugs.debian.org/1026312 + +Forwarded: https://github.com/mesonbuild/meson/pull/11211 +--- + mesonbuild/modules/python.py | 14 +++++++++++--- + 1 file changed, 11 insertions(+), 3 deletions(-) + +diff --git a/mesonbuild/modules/python.py b/mesonbuild/modules/python.py +index f74d10e4c..68632af2d 100644 +--- a/mesonbuild/modules/python.py ++++ b/mesonbuild/modules/python.py +@@ -363,15 +363,23 @@ def get_distutils_paths(scheme=None, prefix=None): + # default scheme to a custom one pointing to /usr/local and replacing + # site-packages with dist-packages. + # See https://github.com/mesonbuild/meson/issues/8739. +-# XXX: We should be using sysconfig, but Debian only patches distutils. ++# Until version 3.10.2-6, Debian only patched distutils, not sysconfig. + + if 'deb_system' in distutils.command.install.INSTALL_SCHEMES: ++ # Debian systems before setuptools-bundled distutils was used by default + paths = get_distutils_paths(scheme='deb_system') + install_paths = get_distutils_paths(scheme='deb_system', prefix='') + else: +- paths = sysconfig.get_paths() ++ if 'deb_system' in sysconfig.get_scheme_names(): ++ # Use Debian's custom deb_system scheme (with our prefix) ++ scheme = 'deb_system' ++ elif sys.version_info >= (3, 10): ++ scheme = sysconfig.get_default_scheme() ++ else: ++ scheme = sysconfig._get_default_scheme() ++ paths = sysconfig.get_paths(scheme=scheme) + empty_vars = {'base': '', 'platbase': '', 'installed_base': ''} +- install_paths = sysconfig.get_paths(vars=empty_vars) ++ install_paths = sysconfig.get_paths(vars=empty_vars, scheme=scheme) + + def links_against_libpython(): + from distutils.core import Distribution, Extension +-- +2.35.1 + diff -Nru meson-1.0.0/debian/patches/series meson-1.0.0/debian/patches/series --- meson-1.0.0/debian/patches/series 2021-02-14 08:58:40.000000000 -0400 +++ meson-1.0.0/debian/patches/series 2022-12-24 11:22:03.000000000 -0400 @@ -1,2 +1,3 @@ 1-disable-openmpi.patch 2-disable-rootdir-test.patch +3-debian-sysconfig-layout.patch