diff -Nru brltty-6.4/debian/changelog brltty-6.4/debian/changelog --- brltty-6.4/debian/changelog 2022-03-18 14:26:01.000000000 +0000 +++ brltty-6.4/debian/changelog 2022-03-18 16:59:59.000000000 +0000 @@ -1,3 +1,10 @@ +brltty (6.4-4ubuntu2) jammy; urgency=medium + + * Support python3.10's change to the default sysconfig scheme, fixing FTBFS + with Python 3.10 by default. (Closes: Bug#1007927) + + -- Stefano Rivera Fri, 18 Mar 2022 12:59:59 -0400 + brltty (6.4-4ubuntu1) jammy; urgency=medium * Resynchornize on Debian, fix the build diff -Nru brltty-6.4/debian/patches/py310-sysconfig brltty-6.4/debian/patches/py310-sysconfig --- brltty-6.4/debian/patches/py310-sysconfig 1970-01-01 00:00:00.000000000 +0000 +++ brltty-6.4/debian/patches/py310-sysconfig 2022-03-18 16:59:51.000000000 +0000 @@ -0,0 +1,46 @@ +Description: Handle Debian's default posix_prefix sysconfig layout + 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. + . + 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). + . + As far as I can see, pythoncmd is only used in detecting the installed system + python, not determining where the built module will be installed, so this + patch is sufficient. To control where the module is installed, the approach + would be to pass the selected prefix to sysconfig, when querying the install + path. +Bug-Debian: https://bugs.debian.org/1007927 +Forwarded: https://github.com/brltty/brltty/pull/362 + +--- a/Tools/pythoncmd ++++ b/Tools/pythoncmd +@@ -46,15 +46,22 @@ + try: + import sysconfig + # putProgramMessage("sysconfig") ++ if hasattr(sysconfig, 'get_default_scheme'): ++ scheme = sysconfig.get_default_scheme() ++ else: ++ 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' + + def getIncludeDirectory(): +- return sysconfig.get_path("include") ++ return sysconfig.get_path("include", scheme) + + def getLibraryDirectory(): +- return sysconfig.get_path("stdlib") ++ return sysconfig.get_path("stdlib", scheme) + + def getPackageDirectory(): +- return sysconfig.get_path("platlib") ++ return sysconfig.get_path("platlib", scheme) + + def getConfigurationVariable(name): + return sysconfig.get_config_var(name) diff -Nru brltty-6.4/debian/patches/series brltty-6.4/debian/patches/series --- brltty-6.4/debian/patches/series 2021-11-16 16:25:42.000000000 +0000 +++ brltty-6.4/debian/patches/series 2022-03-18 16:59:56.000000000 +0000 @@ -3,3 +3,4 @@ 41-java-bytecode-compat.patch disable-synth-callback.patch socket-permissions +py310-sysconfig