diff -pruN 3.31.6-2/debian/.gitattributes 3.31.6-2ubuntu6/debian/.gitattributes
--- 3.31.6-2/debian/.gitattributes	2025-03-31 14:09:14.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/.gitattributes	1970-01-01 00:00:00.000000000 +0000
@@ -1 +0,0 @@
-changelog merge=dpkg-mergechangelogs
diff -pruN 3.31.6-2/debian/changelog 3.31.6-2ubuntu6/debian/changelog
--- 3.31.6-2/debian/changelog	2025-03-31 14:09:14.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/changelog	2025-09-20 13:30:25.000000000 +0000
@@ -1,9 +1,58 @@
+cmake (3.31.6-2ubuntu6) questing; urgency=medium
+
+  * Re-enable tests on arm64
+  * Merge changes from Debian unstable:
+    - Sanitize test environment
+    - Fix FTBFS with curl 8.16+
+    - Allow host prefix for GNU as (Closes: #1115461)
+    - Prevent test suite failures if a '+' is in the source path
+
+ -- Graham Inggs <ginggs@ubuntu.com>  Sat, 20 Sep 2025 13:30:25 +0000
+
+cmake (3.31.6-2ubuntu5) questing; urgency=medium
+
+  * Rebuild to include updated RISC-V base ISA RVA23
+
+ -- Heinrich Schuchardt <heinrich.schuchardt@canonical.com>  Sat, 13 Sep 2025 16:03:33 +0000
+
+cmake (3.31.6-2ubuntu4) questing; urgency=medium
+
+  * Make boost 1.89 a known version.
+
+ -- Matthias Klose <doko@ubuntu.com>  Sat, 09 Aug 2025 22:01:31 +0200
+
+cmake (3.31.6-2ubuntu3) questing; urgency=medium
+
+  * Ignore test results on arm64 for a first build. See LP #2119445.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 08 Aug 2025 19:40:47 +0200
+
+cmake (3.31.6-2ubuntu2) questing; urgency=medium
+
+  * Make boost 1.88 a known version.
+
+ -- Matthias Klose <doko@ubuntu.com>  Fri, 08 Aug 2025 08:19:19 +0200
+
+cmake (3.31.6-2ubuntu1) questing; urgency=medium
+
+  * Merge with Debian unstable (LP: #2111544). Remaining changes:
+    - d/rules, d/control: do not build the GUI for i386
+
+ -- Ural Tunaboyu <ural.tunaboyu@canonical.com>  Thu, 22 May 2025 22:01:25 -0700
+
 cmake (3.31.6-2) unstable; urgency=medium
 
   * Avoid using undocumented type fo CURLOPT_NETRC values (Closes: #1101604)
 
  -- Timo Röhling <roehling@debian.org>  Mon, 31 Mar 2025 16:09:14 +0200
 
+cmake (3.31.6-1ubuntu1) plucky; urgency=medium
+
+  * Merge from Debian Unstable. Remaining changes:
+    - Do not build the GUI on i386.
+
+ -- Simon Quigley <tsimonq2@ubuntu.com>  Wed, 05 Mar 2025 14:54:17 -0600
+
 cmake (3.31.6-1) unstable; urgency=medium
 
   * New upstream version 3.31.6
@@ -11,6 +60,12 @@ cmake (3.31.6-1) unstable; urgency=mediu
 
  -- Timo Röhling <roehling@debian.org>  Tue, 25 Feb 2025 09:21:18 +0100
 
+cmake (3.31.5-2ubuntu3) plucky; urgency=medium
+
+  * Do not build the GUI on i386.
+
+ -- Simon Quigley <tsimonq2@ubuntu.com>  Sun, 09 Feb 2025 12:07:03 -0600
+
 cmake (3.31.5-2) unstable; urgency=medium
 
   * Migrate cmake-qt-gui to Qt 6
@@ -2312,7 +2367,6 @@ cmake (0.96-1) unstable; urgency=low
 
  -- A. Maitland Bottoms <bottoms@debian.org>  Wed, 28 Nov 2001 08:45:22 -0500
 
-
 cmake (2.0.5-1) unstable; urgency=low
 
   * New upstream release
@@ -2456,3 +2510,4 @@ cmake (0.96-1) unstable; urgency=low
     (Closes: #121610)
 
  -- A. Maitland Bottoms <bottoms@debian.org>  Wed, 28 Nov 2001 08:45:22 -0500
+
diff -pruN 3.31.6-2/debian/control 3.31.6-2ubuntu6/debian/control
--- 3.31.6-2/debian/control	2025-03-31 14:09:14.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/control	2025-05-23 05:01:25.000000000 +0000
@@ -1,7 +1,8 @@
 Source: cmake
 Section: devel
 Priority: optional
-Maintainer: Debian CMake Team <pkg-cmake-team@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian CMake Team <pkg-cmake-team@lists.alioth.debian.org>
 Uploaders:
  Lisandro Damián Nicanor Pérez Meyer <lisandro@debian.org>,
  Felix Geyer <fgeyer@debian.org>,
@@ -22,7 +23,7 @@ Build-Depends:
  procps [!hurd-any],
  python3-sphinx:native,
  python3-sphinxcontrib.qthelp:native,
- qt6-base-dev <!pkg.cmake.bootstrap !pkg.cmake.nogui>,
+ qt6-base-dev [!i386] <!pkg.cmake.bootstrap !pkg.cmake.nogui>,
  zlib1g-dev <!pkg.cmake.bootstrap>,
 Build-Depends-Indep:
  dh-sequence-sphinxdoc,
diff -pruN 3.31.6-2/debian/patches/0002-Fix-FTBFS-with-curl-8.16.patch 3.31.6-2ubuntu6/debian/patches/0002-Fix-FTBFS-with-curl-8.16.patch
--- 3.31.6-2/debian/patches/0002-Fix-FTBFS-with-curl-8.16.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/patches/0002-Fix-FTBFS-with-curl-8.16.patch	2025-09-17 14:13:35.000000000 +0000
@@ -0,0 +1,21 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Fri, 29 Aug 2025 12:05:53 +0200
+Subject: Fix FTBFS with curl 8.16+
+
+---
+ Source/CTest/cmCTestCurl.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/CTest/cmCTestCurl.h b/Source/CTest/cmCTestCurl.h
+index 7836f4b..9113890 100644
+--- a/Source/CTest/cmCTestCurl.h
++++ b/Source/CTest/cmCTestCurl.h
+@@ -52,7 +52,7 @@ private:
+   std::vector<std::string> HttpHeaders;
+   std::string HTTPProxyAuth;
+   std::string HTTPProxy;
+-  curl_proxytype HTTPProxyType;
++  long HTTPProxyType;
+   bool UseHttp10 = false;
+   bool Quiet = false;
+   int TimeOutSeconds = 0;
diff -pruN 3.31.6-2/debian/patches/0004-Allow-host-prefix-for-GNU-as-in-test-suite.patch 3.31.6-2ubuntu6/debian/patches/0004-Allow-host-prefix-for-GNU-as-in-test-suite.patch
--- 3.31.6-2/debian/patches/0004-Allow-host-prefix-for-GNU-as-in-test-suite.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/patches/0004-Allow-host-prefix-for-GNU-as-in-test-suite.patch	2025-09-17 14:13:35.000000000 +0000
@@ -0,0 +1,18 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Wed, 17 Sep 2025 15:35:29 +0200
+Subject: Allow host prefix for "GNU as" in test suite
+
+---
+ Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt b/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt
+index c4326ae..e07693c 100644
+--- a/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt
++++ b/Tests/RunCMake/BuildDepends/GNU-AS-stdout.txt
+@@ -1,4 +1,4 @@
+ -- The ASM compiler identification is GNU
+ -- Found assembler: [^
+-]*/as(\.exe)?
++]*[/-]as(\.exe)?
+ -- CMAKE_ASM_COMPILER_ID_VENDOR_MATCH='GNU assembler'
diff -pruN 3.31.6-2/debian/patches/0005-Prevent-test-suite-failures-if-a-is-in-the-source-pa.patch 3.31.6-2ubuntu6/debian/patches/0005-Prevent-test-suite-failures-if-a-is-in-the-source-pa.patch
--- 3.31.6-2/debian/patches/0005-Prevent-test-suite-failures-if-a-is-in-the-source-pa.patch	1970-01-01 00:00:00.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/patches/0005-Prevent-test-suite-failures-if-a-is-in-the-source-pa.patch	2025-09-17 14:13:35.000000000 +0000
@@ -0,0 +1,84 @@
+From: =?utf-8?q?Timo_R=C3=B6hling?= <roehling@debian.org>
+Date: Wed, 17 Sep 2025 16:28:57 +0200
+Subject: Prevent test suite failures if a '+' is in the source path
+
+---
+ Tests/RunCMake/GenEx-TARGET_PROPERTY/INCLUDE_DIRECTORIES-check.cmake  | 4 +++-
+ .../RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake  | 3 ++-
+ Tests/RunCMake/target_include_directories/include_after.cmake         | 3 ++-
+ Tests/RunCMake/target_include_directories/include_before.cmake        | 3 ++-
+ Tests/RunCMake/target_include_directories/include_default.cmake       | 3 ++-
+ 5 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/Tests/RunCMake/GenEx-TARGET_PROPERTY/INCLUDE_DIRECTORIES-check.cmake b/Tests/RunCMake/GenEx-TARGET_PROPERTY/INCLUDE_DIRECTORIES-check.cmake
+index ecf7bfe..b3a049c 100644
+--- a/Tests/RunCMake/GenEx-TARGET_PROPERTY/INCLUDE_DIRECTORIES-check.cmake
++++ b/Tests/RunCMake/GenEx-TARGET_PROPERTY/INCLUDE_DIRECTORIES-check.cmake
+@@ -2,7 +2,9 @@ file(READ "${RunCMake_TEST_BINARY_DIR}/out.txt" content)
+ 
+ unset(RunCMake_TEST_FAILED)
+ 
+-if (NOT content MATCHES "(INCLUDES1:${RunCMake_TEST_SOURCE_DIR}/include)")
++string(REGEX REPLACE "([][()+*^.$?|\\\\])" "\\\\\\1" regex_safe_dir "${RunCMake_TEST_SOURCE_DIR}")
++
++if (NOT content MATCHES "(INCLUDES1:${regex_safe_dir}/include)")
+   string(APPEND RunCMake_TEST_FAILED "wrong content for INCLUDES1: \"${CMAKE_MATCH_1}\"\n")
+ endif()
+ 
+diff --git a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake
+index 814f405..1c0c352 100644
+--- a/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake
++++ b/Tests/RunCMake/install/TARGETS-FILE_RPATH_CHANGE-old_rpath-check.cmake
+@@ -3,8 +3,9 @@ skip_without_rpath_change_rule()
+ string(APPEND prefix "${wsnl}" [[FILE "[^"]*/]])
+ 
+ set(target "exe1")
++string(REGEX REPLACE "([][()+*^.$?|\\\\])" "\\\\\\1" regex_safe_dir "${RunCMake_BINARY_DIR}")
+ string(CONCAT regex "${prefix}${target}\"${wsnl}"
+-              [[OLD_RPATH "]] "${RunCMake_BINARY_DIR}")
++              [[OLD_RPATH "]] "${regex_safe_dir}")
+ check()
+ 
+ if("x${CMAKE_SHARED_LIBRARY_RPATH_ORIGIN_TOKEN}" STREQUAL "x\$ORIGIN")
+diff --git a/Tests/RunCMake/target_include_directories/include_after.cmake b/Tests/RunCMake/target_include_directories/include_after.cmake
+index 68a08a7..329eb72 100644
+--- a/Tests/RunCMake/target_include_directories/include_after.cmake
++++ b/Tests/RunCMake/target_include_directories/include_after.cmake
+@@ -12,7 +12,8 @@ target_include_directories(main AFTER PRIVATE "${after_include_dir}")
+ 
+ get_target_property(actual_include_dirs main INCLUDE_DIRECTORIES)
+ set(desired_include_dirs "${include_dir}" "${after_include_dir}")
++string(REGEX REPLACE "([][()+*^.$?|\\\\])" "\\\\\\1" desired_include_dirs_regex_safe "${desired_include_dirs}")
+ 
+-if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs}")
++if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs_regex_safe}")
+     message(SEND_ERROR "include after does not work")
+ endif()
+diff --git a/Tests/RunCMake/target_include_directories/include_before.cmake b/Tests/RunCMake/target_include_directories/include_before.cmake
+index 9bebecd..aed7d70 100644
+--- a/Tests/RunCMake/target_include_directories/include_before.cmake
++++ b/Tests/RunCMake/target_include_directories/include_before.cmake
+@@ -12,7 +12,8 @@ target_include_directories(main BEFORE PRIVATE "${before_include_dir}")
+ 
+ get_target_property(actual_include_dirs main INCLUDE_DIRECTORIES)
+ set(desired_include_dirs "${before_include_dir}" "${include_dir}")
++string(REGEX REPLACE "([][()+*^.$?|\\\\])" "\\\\\\1" desired_include_dirs_regex_safe "${desired_include_dirs}")
+ 
+-if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs}")
++if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs_regex_safe}")
+     message(SEND_ERROR "include before does not work")
+ endif()
+diff --git a/Tests/RunCMake/target_include_directories/include_default.cmake b/Tests/RunCMake/target_include_directories/include_default.cmake
+index 88b2502..55b6478 100644
+--- a/Tests/RunCMake/target_include_directories/include_default.cmake
++++ b/Tests/RunCMake/target_include_directories/include_default.cmake
+@@ -12,7 +12,8 @@ target_include_directories(main AFTER PRIVATE "${default_include_dir}")
+ 
+ get_target_property(actual_include_dirs main INCLUDE_DIRECTORIES)
+ set(desired_include_dirs "${include_dir}" "${default_include_dir}")
++string(REGEX REPLACE "([][()+*^.$?|\\\\])" "\\\\\\1" desired_include_dirs_regex_safe "${desired_include_dirs}")
+ 
+-if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs}")
++if (NOT "${actual_include_dirs}" MATCHES "${desired_include_dirs_regex_safe}")
+     message(SEND_ERROR "include default does not work")
+ endif()
diff -pruN 3.31.6-2/debian/patches/boost1.88.diff 3.31.6-2ubuntu6/debian/patches/boost1.88.diff
--- 3.31.6-2/debian/patches/boost1.88.diff	1970-01-01 00:00:00.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/patches/boost1.88.diff	2025-08-08 06:19:14.000000000 +0000
@@ -0,0 +1,11 @@
+--- a/Modules/FindBoost.cmake
++++ b/Modules/FindBoost.cmake
+@@ -1699,7 +1699,7 @@ else()
+   # _Boost_COMPONENT_HEADERS.  See the instructions at the top of
+   # _Boost_COMPONENT_DEPENDENCIES.
+   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
+-    "1.87.0" "1.87" "1.86.0" "1.86" "1.85.0" "1.85" "1.84.0" "1.84"
++    "1.88.0" "1.88" "1.87.0" "1.87" "1.86.0" "1.86" "1.85.0" "1.85" "1.84.0" "1.84"
+     "1.83.0" "1.83" "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" "1.79.0" "1.79"
+     "1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75" "1.74.0" "1.74"
+     "1.73.0" "1.73" "1.72.0" "1.72" "1.71.0" "1.71" "1.70.0" "1.70" "1.69.0" "1.69"
diff -pruN 3.31.6-2/debian/patches/boost1.89.diff 3.31.6-2ubuntu6/debian/patches/boost1.89.diff
--- 3.31.6-2/debian/patches/boost1.89.diff	1970-01-01 00:00:00.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/patches/boost1.89.diff	2025-08-09 20:01:21.000000000 +0000
@@ -0,0 +1,10 @@
+--- a/Modules/FindBoost.cmake
++++ b/Modules/FindBoost.cmake
+@@ -1699,6 +1699,7 @@ else()
+   # _Boost_COMPONENT_HEADERS.  See the instructions at the top of
+   # _Boost_COMPONENT_DEPENDENCIES.
+   set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
++    "1.89.0" "1.89"
+     "1.88.0" "1.88" "1.87.0" "1.87" "1.86.0" "1.86" "1.85.0" "1.85" "1.84.0" "1.84"
+     "1.83.0" "1.83" "1.82.0" "1.82" "1.81.0" "1.81" "1.80.0" "1.80" "1.79.0" "1.79"
+     "1.78.0" "1.78" "1.77.0" "1.77" "1.76.0" "1.76" "1.75.0" "1.75" "1.74.0" "1.74"
diff -pruN 3.31.6-2/debian/patches/series 3.31.6-2ubuntu6/debian/patches/series
--- 3.31.6-2/debian/patches/series	2025-03-31 14:09:14.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/patches/series	2025-09-20 09:31:57.000000000 +0000
@@ -1,2 +1,7 @@
 0001-Prefer-default-Python-version.patch
 0002-Avoid-using-undocumented-type-for-CURLOPT_NETRC-valu.patch
+0002-Fix-FTBFS-with-curl-8.16.patch
+0004-Allow-host-prefix-for-GNU-as-in-test-suite.patch
+0005-Prevent-test-suite-failures-if-a-is-in-the-source-pa.patch
+boost1.88.diff
+boost1.89.diff
diff -pruN 3.31.6-2/debian/rules 3.31.6-2ubuntu6/debian/rules
--- 3.31.6-2/debian/rules	2025-03-31 14:09:14.000000000 +0000
+++ 3.31.6-2ubuntu6/debian/rules	2025-09-20 10:30:31.000000000 +0000
@@ -2,6 +2,11 @@
 
 include /usr/share/dpkg/pkg-info.mk
 
+# If we are on i386, never build the GUI
+ifeq "$(DEB_HOST_ARCH)" "i386"
+	export DEB_BUILD_PROFILES := pkg.cmake.nogui $(DEB_BUILD_PROFILES)
+endif
+
 # Do not build with link-time optimization, cf. https://bugs.debian.org/1034873
 export DEB_BUILD_MAINT_OPTIONS := optimize=-lto hardening=+all
 
@@ -75,7 +80,11 @@ EXCLUDED_TESTS = CTestTestUpload\|curl
 override_dh_auto_test:
 	# Pass -j1 to "make test" as a workaround, see https://gitlab.kitware.com/cmake/cmake/issues/17165
 	# The tests are still run in parallel as -jX is passed via ARGS to ctest.
-	dh_auto_test --buildsystem=cmake -- -j1 ARGS="-E $(EXCLUDED_TESTS) --timeout 5000 -j$(NUMJOBS)"
+	#
+	# Remove CFLAGS, CXXFLAGS and LDFLAGS from the test environment,
+	# see https://gitlab.kitware.com/cmake/cmake/-/issues/26836
+	env -u CFLAGS -u CXXFLAGS -u LDFLAGS \
+		dh_auto_test --buildsystem=cmake -- -j1 ARGS="-E $(EXCLUDED_TESTS) --timeout 5000 -j$(NUMJOBS)"
 
 execute_after_dh_auto_clean:
 	rm -f $(BUILD_FLAGS_FILE)
