diff --git a/0001-Sphinx-Specify-encoding-when-opening-files-for-title.patch b/0001-Sphinx-Specify-encoding-when-opening-files-for-title.patch new file mode 100644 index 0000000..e086c44 --- /dev/null +++ b/0001-Sphinx-Specify-encoding-when-opening-files-for-title.patch @@ -0,0 +1,44 @@ +From 853f069103f00b3f487833787b5388c7e79ff3c3 Mon Sep 17 00:00:00 2001 +From: Craig Scott +Date: Fri, 7 Apr 2023 18:11:05 +1000 +Subject: [PATCH 1/5] Sphinx: Specify encoding when opening files for title + extraction +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +When the encoding is not specified, open() may choose an encoding +based on the locale in use. That encoding may have no relationship +to the encoding of the file being opened. Use the locale from the +document settings instead, which should better match the file's +encoding. + +Fixes: #24679 +Signed-off-by: Björn Esser +--- + Utilities/Sphinx/cmake.py | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Utilities/Sphinx/cmake.py b/Utilities/Sphinx/cmake.py +index 47e4909ba0..e4e06aba1a 100644 +--- a/Utilities/Sphinx/cmake.py ++++ b/Utilities/Sphinx/cmake.py +@@ -224,12 +224,13 @@ class CMakeTransform(Transform): + The cmake --help-*-list commands also depend on this convention. + Return the title or False if the document file does not exist. + """ +- env = self.document.settings.env ++ settings = self.document.settings ++ env = settings.env + title = self.titles.get(docname) + if title is None: + fname = os.path.join(env.srcdir, docname+'.rst') + try: +- f = open(fname, 'r') ++ f = open(fname, 'r', encoding=settings.input_encoding) + except IOError: + title = False + else: +-- +2.40.1 + diff --git a/0002-Sphinx-Modernize-UTF-8-encoding-handling-when-updati.patch b/0002-Sphinx-Modernize-UTF-8-encoding-handling-when-updati.patch new file mode 100644 index 0000000..f16a500 --- /dev/null +++ b/0002-Sphinx-Modernize-UTF-8-encoding-handling-when-updati.patch @@ -0,0 +1,44 @@ +From fc2b60ca6b23a7204043075e0c04a727d5b6a06b Mon Sep 17 00:00:00 2001 +From: Craig Scott +Date: Fri, 7 Apr 2023 18:14:18 +1000 +Subject: [PATCH 2/5] Sphinx: Modernize UTF-8 encoding handling when updating + CMake.qhp +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Björn Esser +--- + Utilities/Sphinx/create_identifiers.py | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Utilities/Sphinx/create_identifiers.py b/Utilities/Sphinx/create_identifiers.py +index 0ff39a0c2a..61dd819b42 100755 +--- a/Utilities/Sphinx/create_identifiers.py ++++ b/Utilities/Sphinx/create_identifiers.py +@@ -6,12 +6,12 @@ if len(sys.argv) != 2: + sys.exit(-1) + name = sys.argv[1] + "/CMake.qhp" + +-f = open(name, "rb") ++f = open(name, "r", encoding="utf-8") + + if not f: + sys.exit(-1) + +-lines = f.read().decode("utf-8").splitlines() ++lines = f.read().splitlines() + + if not lines: + sys.exit(-1) +@@ -47,5 +47,5 @@ for line in lines: + line = part1 + prefix + "id=\"" + domain_object_type + "/" + domain_object + "\" " + part2 + newlines.append(line + "\n") + +-f = open(name, "wb") +-f.writelines(map(lambda line: line.encode("utf-8"), newlines)) ++f = open(name, "w", encoding="utf-8") ++f.writelines(newlines) +-- +2.40.1 + diff --git a/0003-Tests-Always-load-presets-schema-as-UTF-8.patch b/0003-Tests-Always-load-presets-schema-as-UTF-8.patch new file mode 100644 index 0000000..cb7573c --- /dev/null +++ b/0003-Tests-Always-load-presets-schema-as-UTF-8.patch @@ -0,0 +1,45 @@ +From e4f26edc1c1bb999b12df83f41459fe7174bef29 Mon Sep 17 00:00:00 2001 +From: Craig Scott +Date: Fri, 7 Apr 2023 18:21:27 +1000 +Subject: [PATCH 3/5] Tests: Always load presets schema as UTF-8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +We know the encoding of the schema file, so we should specify it +when we open it for reading. Previously, by not specifying it, the test +was open to using an encoding based on the active locale when +running the test. We may have been enforcing a "C" locale at a higher +level, but we don't need to rely on that here, we can force correct +behavior without that assumption. + +Issue: #24679 +Signed-off-by: Björn Esser +--- + Tests/RunCMake/CMakePresets/validate_schema.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/Tests/RunCMake/CMakePresets/validate_schema.py b/Tests/RunCMake/CMakePresets/validate_schema.py +index b2a67fc4b9..836147aab2 100644 +--- a/Tests/RunCMake/CMakePresets/validate_schema.py ++++ b/Tests/RunCMake/CMakePresets/validate_schema.py +@@ -4,13 +4,13 @@ import os.path + import sys + + +-with open(sys.argv[1], "rb") as f: +- contents = json.loads(f.read().decode("utf-8-sig")) ++with open(sys.argv[1], "r", encoding="utf-8-sig") as f: ++ contents = json.load(f) + + schema_file = os.path.join( + os.path.dirname(__file__), + "..", "..", "..", "Help", "manual", "presets", "schema.json") +-with open(schema_file) as f: ++with open(schema_file, "r", encoding="utf-8") as f: + schema = json.load(f) + + jsonschema.validate(contents, schema) +-- +2.40.1 + diff --git a/0004-CMakeDetermineCompilerABI-Avoid-removing-the-flag-af.patch b/0004-CMakeDetermineCompilerABI-Avoid-removing-the-flag-af.patch new file mode 100644 index 0000000..5c97dc8 --- /dev/null +++ b/0004-CMakeDetermineCompilerABI-Avoid-removing-the-flag-af.patch @@ -0,0 +1,38 @@ +From cec6f980181d9ca88ff53f0b1626713ed98a3369 Mon Sep 17 00:00:00 2001 +From: Raul Tambre +Date: Mon, 29 May 2023 17:18:55 +0300 +Subject: [PATCH 4/5] CMakeDetermineCompilerABI: Avoid removing the flag after + -Werror +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +The matching became too eager after commit 079ea66468 +(CMakeDetermineCompilerABI: Handle NVCC-style -Werror flags, 2020-10-04, +v3.19.0-rc1~45^2). When -Werror was specified without a value we would +eat the following flag. Prevent this by disallowing "-" as the first +character of the flag's value. + +Fixes: 079ea66468a6ffe0b02c3d6622bc0230fdf455b0 +See-also: https://discourse.cmake.org/t/8230 +Signed-off-by: Björn Esser +--- + Modules/CMakeDetermineCompilerABI.cmake | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Modules/CMakeDetermineCompilerABI.cmake b/Modules/CMakeDetermineCompilerABI.cmake +index 3fd54cc7ef..df177968c3 100644 +--- a/Modules/CMakeDetermineCompilerABI.cmake ++++ b/Modules/CMakeDetermineCompilerABI.cmake +@@ -42,7 +42,7 @@ function(CMAKE_DETERMINE_COMPILER_ABI lang src) + __TestCompiler_setTryCompileTargetType() + + # Avoid failing ABI detection on warnings. +- string(REGEX REPLACE "(^| )-Werror([= ][^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}") ++ string(REGEX REPLACE "(^| )-Werror([= ][^-][^ ]*)?( |$)" " " CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS}") + + # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables + # and set them to "C" that way GCC's "search starts here" text is in +-- +2.40.1 + diff --git a/0005-FindBoost-Add-support-for-Boost-1.82.patch b/0005-FindBoost-Add-support-for-Boost-1.82.patch new file mode 100644 index 0000000..318bfca --- /dev/null +++ b/0005-FindBoost-Add-support-for-Boost-1.82.patch @@ -0,0 +1,60 @@ +From 5cbbe55de85bdd0d6d90241a9b18683f13375fc1 Mon Sep 17 00:00:00 2001 +From: huangqinjin +Date: Sun, 28 May 2023 17:13:18 +0800 +Subject: [PATCH 5/5] FindBoost: Add support for Boost 1.82 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Update the list of known versions. + +There is a new header-only library, Boost.MySQL. It has no +dependencies and has a core header ``. + +Run the command + + cmake -DBOOST_DIR=/path/to/boost_1_82_0 \ + -P Utilities/Scripts/BoostScanDeps.cmake + +to extract dependencies from the 1.82.0 source tree. +They are the same as 1.81's dependencies, so just update +the version check for warning about newer versions. + +Signed-off-by: Björn Esser +--- + Modules/FindBoost.cmake | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake +index 72a9a4c192..f2e4804d04 100644 +--- a/Modules/FindBoost.cmake ++++ b/Modules/FindBoost.cmake +@@ -1380,7 +1380,7 @@ function(_Boost_COMPONENT_DEPENDENCIES component _ret) + set(_Boost_TIMER_DEPENDENCIES chrono) + set(_Boost_WAVE_DEPENDENCIES filesystem serialization thread chrono atomic) + set(_Boost_WSERIALIZATION_DEPENDENCIES serialization) +- if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.82.0 AND NOT Boost_NO_WARN_NEW_VERSIONS) ++ if(Boost_VERSION_STRING VERSION_GREATER_EQUAL 1.83.0 AND NOT Boost_NO_WARN_NEW_VERSIONS) + message(WARNING "New Boost version may have incorrect or missing dependencies and imported targets") + endif() + endif() +@@ -1445,6 +1445,7 @@ function(_Boost_COMPONENT_HEADERS component _hdrs) + set(_Boost_MATH_TR1L_HEADERS "boost/math/tr1.hpp") + set(_Boost_MPI_HEADERS "boost/mpi.hpp") + set(_Boost_MPI_PYTHON_HEADERS "boost/mpi/python/config.hpp") ++ set(_Boost_MYSQL_HEADERS "boost/mysql.hpp") + set(_Boost_NUMPY_HEADERS "boost/python/numpy.hpp") + set(_Boost_NOWIDE_HEADERS "boost/nowide/cstdlib.hpp") + set(_Boost_PRG_EXEC_MONITOR_HEADERS "boost/test/prg_exec_monitor.hpp") +@@ -1654,7 +1655,7 @@ else() + # _Boost_COMPONENT_HEADERS. See the instructions at the top of + # _Boost_COMPONENT_DEPENDENCIES. + set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} +- "1.81.0" "1.81" "1.80.0" "1.80" "1.79.0" "1.79" ++ "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" + "1.68.0" "1.68" "1.67.0" "1.67" "1.66.0" "1.66" "1.65.1" "1.65.0" "1.65" +-- +2.40.1 + diff --git a/cmake.spec b/cmake.spec index 05c07e9..d92b248 100644 --- a/cmake.spec +++ b/cmake.spec @@ -76,7 +76,7 @@ %endif # For handling bump release by rpmdev-bumpspec and mass rebuild -%global baserelease 3 +%global baserelease 4 # Uncomment if building for EPEL #global name_suffix %%{major_version} @@ -121,6 +121,13 @@ Patch102: %{name}-mingw-dl.patch Patch1: %{name}-rename.patch %endif +# Backported from upstream. +Patch10001: 0001-Sphinx-Specify-encoding-when-opening-files-for-title.patch +Patch10002: 0002-Sphinx-Modernize-UTF-8-encoding-handling-when-updati.patch +Patch10003: 0003-Tests-Always-load-presets-schema-as-UTF-8.patch +Patch10004: 0004-CMakeDetermineCompilerABI-Avoid-removing-the-flag-af.patch +Patch10005: 0005-FindBoost-Add-support-for-Boost-1.82.patch + BuildRequires: coreutils BuildRequires: findutils BuildRequires: gcc-c++ @@ -539,6 +546,9 @@ popd %changelog +* Thu Jun 01 2023 Björn Esser - 3.26.4-4 +- Backport several bugfixes and support for Boost v1.82 from upstream + * Sat May 27 2023 Björn Esser - 3.26.4-3 - Rename macros.cmake -> macros.cmake.in - macros: Fix formatting and indentation