diff mbox series

[v4,3/7] apt: Backport patch to support builds with CMake 4+

Message ID 20250702123005.1233743-4-Moritz.Haase@bmw.de
State New
Headers show
Series cmake: Major version bump to 4.0.3 | expand

Commit Message

Haase Moritz, JD-62 July 2, 2025, 12:30 p.m. UTC
There have been a number of upstream releases that ship this patch already, but
given that the most recent ones are considered experimental, I opted to backport
instead.

Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de>
---
changes in v4:
- Fix patch formatting

changes in v3:
- Commit added to series
---

 ...mum_required-to-3.13-to-avoid-warnin.patch | 47 +++++++++++++++++++
 meta/recipes-devtools/apt/apt_2.6.1.bb        |  1 +
 2 files changed, 48 insertions(+)
 create mode 100644 meta/recipes-devtools/apt/apt/0001-Raise-cmake_minimum_required-to-3.13-to-avoid-warnin.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/apt/apt/0001-Raise-cmake_minimum_required-to-3.13-to-avoid-warnin.patch b/meta/recipes-devtools/apt/apt/0001-Raise-cmake_minimum_required-to-3.13-to-avoid-warnin.patch
new file mode 100644
index 0000000000..c3a5ded494
--- /dev/null
+++ b/meta/recipes-devtools/apt/apt/0001-Raise-cmake_minimum_required-to-3.13-to-avoid-warnin.patch
@@ -0,0 +1,47 @@ 
+From dc7a8b3050a2a43f49515a03ae19713dfced75dc Mon Sep 17 00:00:00 2001
+From: David Kalnischkies <david@kalnischkies.de>
+Date: Sat, 18 Nov 2023 13:10:05 +0000
+Subject: [PATCH] Raise cmake_minimum_required to 3.13 to avoid warnings
+
+CMake Deprecation Warning at CMakeLists.txt:6 (cmake_minimum_required):
+  Compatibility with CMake < 3.5 will be removed from a future version of
+  CMake.
+
+  Update the VERSION argument <min> value or use a ...<max> suffix to tell
+  CMake that the project does not need compatibility with older versions.
+
+Picking 3.13 here is a semi-random choice to avoid raising the requirement
+too much needlessly while also hopefully avoiding needing to raise it
+soon again based on the referenced mail.
+
+While we are at it, lets also fix the other spewed warning:
+
+CMake Warning (dev) at CMakeLists.txt:5 (project):
+  cmake_minimum_required() should be called prior to this top-level project()
+  call.  Please see the cmake-commands(7) manual for usage documentation of
+  both commands.
+
+References: https://lists.debian.org/msgid-search/20230617162957.6pklb6632zf4nijc@mail.gaussglocke.de
+
+Upstream-Status: Backport [https://salsa.debian.org/apt-team/apt/-/commit/dc7a8b3050a2a43f49515a03ae19713dfced75dc]
+Signed-off-by: Moritz Haase <Moritz.Haase@bmw.de>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 62182cddf..dae12e7c3 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -2,8 +2,8 @@
+ # Licensed under the same terms as APT; i.e. GPL 2 or later.
+
+ # set minimum version
++cmake_minimum_required(VERSION 3.13)
+ project(apt)
+-cmake_minimum_required(VERSION 3.4.0)
+ # Generic header locations
+ include_directories(${PROJECT_BINARY_DIR}/include)
+
+--
+GitLab
diff --git a/meta/recipes-devtools/apt/apt_2.6.1.bb b/meta/recipes-devtools/apt/apt_2.6.1.bb
index d605d950dd..50ac2ea812 100644
--- a/meta/recipes-devtools/apt/apt_2.6.1.bb
+++ b/meta/recipes-devtools/apt/apt_2.6.1.bb
@@ -14,6 +14,7 @@  SRC_URI = "${DEBIAN_MIRROR}/main/a/apt/${BPN}_${PV}.tar.xz \
            file://0001-aptwebserver.cc-Include-array.patch \
            file://0001-Remove-using-std-binary_function.patch \
            file://0001-strutl-Add-missing-include-cstdint-gcc-15.patch \
+           file://0001-Raise-cmake_minimum_required-to-3.13-to-avoid-warnin.patch \
            "
 
 SRC_URI:append:class-native = " \