Skip to contentSkip to conversation

leveldb: Disable ptests to allow to build with CMake 4+

PATCH In review Moritz Haase 2 participants 12 messages Jul 14, 2025 – Jul 15, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/10 leveldb: Disable ptests to allow to build with CMake 4+

The component itself builds just fine with CMake 4, but the tests don't as they rely on a bundled version of GTest that is six years old. Since upstream is inactive, the simplest course of action is to not build the tests and disable ptest support.

---
 ...s.txt-fix-googletest-related-options.patch | 55 -------------------
 meta-oe/recipes-dbs/leveldb/leveldb/run-ptest | 10 ----
 meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb   | 10 +---
 3 files changed, 2 insertions(+), 73 deletions(-)
 delete mode 100644 meta-oe/recipes-dbs/leveldb/leveldb/0001-CMakeLists.txt-fix-googletest-related-options.patch
 delete mode 100644 meta-oe/recipes-dbs/leveldb/leveldb/run-ptest
meta-oe/recipes-dbs/leveldb/leveldb/0001-CMakeLists.txt-fix-googletest-related-options.patch deleted +0 -55
deleted file mode 100644
index b0bfb8bf16..0000000000
@@ -1,55 +0,0 @@
-From 77da477840f89da7ced29da315de77571e8f190e Mon Sep 17 00:00:00 2001
-From: Martin Jansa <[email protected]>
-Date: Fri, 20 Oct 2023 22:57:48 +0200
-Subject: [PATCH] CMakeLists.txt: fix googletest related options
-
-* https://cmake.org/cmake/help/book/mastering-cmake/chapter/Writing%20CMakeLists%20Files.html
-  says that CMake options are case-sensitive and I don't see lower-case version in
-  currently used googletest submodules and gtest is indeed installed with leveldb
-
-* install_gmock option I don't see at all, so I've kept it as is, INSTALL_GTEST, BUILD_GMOCK
-  do exist as upper-case
-
-$ grep -Ri install_.*mock .
-./CMakeLists.txt:  set(install_gmock OFF)
-./third_party/googletest/googlemock/CMakeLists.txt:install_project(gmock gmock_main)
-$ grep -Ri build_gmock .
-./CMakeLists.txt:  set(BUILD_GMOCK ON)
-./third_party/googletest/googletest/README.md:cmake .. -DBUILD_GMOCK=OFF
-./third_party/googletest/CMakeLists.txt:option(BUILD_GMOCK "Builds the googlemock subproject" ON)
-./third_party/googletest/CMakeLists.txt:if(BUILD_GMOCK)
-$ grep -Ri install_gtest .
-./CMakeLists.txt:  set(INSTALL_GTEST OFF)
-./third_party/googletest/googletest/cmake/internal_utils.cmake:  if(INSTALL_GTEST)
-./third_party/googletest/googletest/CMakeLists.txt:if (INSTALL_GTEST)
-./third_party/googletest/CMakeLists.txt:option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
-
-* also use CACHE and FORCE as sugested in:
-  https://cmake.org/cmake/help/latest/command/set.html
-  https://stackoverflow.com/questions/20239334/cmake-set-subdirectory-options
-  for the value to correctly propagate into third_party/googletest subdirectory
-
-Signed-off-by: Martin Jansa <[email protected]>
----
-Upstream-Status: Submitted [https://github.com/google/leveldb/pull/1152]
-
- CMakeLists.txt | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index fda9e01..f8a2629 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -295,9 +295,9 @@ if(LEVELDB_BUILD_TESTS)
- 
-   # Prevent overriding the parent project's compiler/linker settings on Windows.
-   set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
--  set(install_gtest OFF)
--  set(install_gmock OFF)
--  set(build_gmock ON)
-+  set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
-+  set(install_gmock OFF CACHE BOOL "" FORCE)
-+  set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
- 
-   # This project is tested using GoogleTest.
-   add_subdirectory("third_party/googletest")
meta-oe/recipes-dbs/leveldb/leveldb/run-ptest deleted +0 -10
deleted file mode 100644
index 9ae70c1284..0000000000
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-for test in *_test; do
-    if ./${test}; then
-        echo "PASS: ${test}"
-    else
-        echo "FAIL: ${test}"
-    fi
-done
-
meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb +2 -8
index 9cefc528ae..0ee0c8c075 100644
@@ -5,30 +5,24 @@ LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d"
 
 SRC_URI = "gitsm://github.com/google/${BPN}.git;branch=main;protocol=https \
-    file://0001-CMakeLists.txt-fix-googletest-related-options.patch \
     file://0001-Fix-printing-64-bit-integer-types.patch \
-    file://run-ptest \
 "
 
 SRCREV = "068d5ee1a3ac40dabd00d211d5013af44be55bea"
 
-inherit cmake ptest
+inherit cmake
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[benchmarks] = "-DLEVELDB_BUILD_BENCHMARKS=ON,-DLEVELDB_BUILD_BENCHMARKS=OFF,sqlite"
 PACKAGECONFIG[snappy] = ",,snappy"
 PACKAGECONFIG[tcmalloc] = ",,gperftools"
 
 EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DCMAKE_SKIP_RPATH=ON \
-                 -DLEVELDB_BUILD_TESTS=${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'ON', 'OFF', d)}"
+                 -DLEVELDB_BUILD_TESTS=OFF"
 
 do_install:append() {
     install -D -m 0755 ${B}/leveldbutil ${D}${bindir}/leveldbutil
 }
 
-do_install_ptest() {
-    install -m 0755 ${B}/*_test ${D}${PTEST_PATH}
-}
-
 # Do not try to build lib32-leveldb for mips64, but allow libn32-leveldb.
 #
 COMPATIBLE_HOST:mipsarcho32:pn-lib32-leveldb = "null"
#1 lore raw

PATCH 2/10 libubox: Update to latest tip of trunk

Fixes builds with CMake 4+. All patches that are still required have been refreshed and a new patch for CMake 4 compatibility has been added.

---
 ...x-array-out-of-bounds-GCC-10-warning.patch | 42 -------------------
 ...h => 0001-cmake-Set-library-version.patch} | 19 ++++++---
 ...-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch} | 15 +++----
 ...ude-lua-and-examples-directories-if-.patch | 35 ++++++++++++++++
 .../recipes-devtools/libubox/libubox_git.bb   |  8 ++--
 5 files changed, 61 insertions(+), 58 deletions(-)
 delete mode 100644 meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch
 rename meta-oe/recipes-devtools/libubox/libubox/{0001-version-libraries.patch => 0001-cmake-Set-library-version.patch} (65%)
 rename meta-oe/recipes-devtools/libubox/libubox/{fix-libdir.patch => 0002-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch} (69%)
 create mode 100644 meta-oe/recipes-devtools/libubox/libubox/0003-cmake-Don-t-include-lua-and-examples-directories-if-.patch
meta-oe/recipes-devtools/libubox/libubox/0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch deleted +0 -42
deleted file mode 100644
index 4f1dd76326..0000000000
@@ -1,42 +0,0 @@
-From a12325a0cbf3bf1d66a0b0f8d85e08083bae6066 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Petr=20=C5=A0tetiar?= <[email protected]>
-Date: Wed, 25 Dec 2019 10:27:59 +0100
-Subject: [PATCH] blobmsg: fix array out of bounds GCC 10 warning
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Fixes following warning reported by GCC 10.0.0 20191203:
-
- blobmsg.c:234:2: error: 'strcpy' offset 6 from the object at 'attr' is out of the bounds of referenced subobject 'name' with type 'uint8_t[0]' {aka 'unsigned char[0]'} at offset 6 [-Werror=array-bounds]
-   234 |  strcpy((char *) hdr->name, (const char *)name);
-       |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- In file included from blobmsg.c:16:
- blobmsg.h:42:10: note: subobject 'name' declared here
-    42 |  uint8_t name[];
-       |          ^~~~
-
-Upstream-Status: Submitted [https://gitlab.com/ynezz/openwrt-libubox/commit/3775b3aa28de8c20d96b6f02786a327423b0748a]
-Reported-by: Khem Raj <[email protected]>
-Signed-off-by: Petr Štetiar <[email protected]>
----
- blobmsg.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/blobmsg.c b/blobmsg.c
-index a860483..b6b7535 100644
---- a/blobmsg.c
-+++ b/blobmsg.c
-@@ -195,7 +195,7 @@ blobmsg_new(struct blob_buf *buf, int type, const char *name, int payload_len, v
- 	attr->id_len |= be32_to_cpu(BLOB_ATTR_EXTENDED);
- 	hdr = blob_data(attr);
- 	hdr->namelen = cpu_to_be16(namelen);
--	strcpy((char *) hdr->name, (const char *)name);
-+	memcpy(hdr->name, name, namelen);
- 	pad_end = *data = blobmsg_data(attr);
- 	pad_start = (char *) &hdr->name[namelen];
- 	if (pad_start < pad_end)
--- 
-2.24.1
-
meta-oe/recipes-devtools/libubox/libubox/0001-cmake-Set-library-version.patch renamed from meta-oe/recipes-devtools/libubox/libubox/0001-version-libraries.patch +14 -5
similarity index 65%
rename from meta-oe/recipes-devtools/libubox/libubox/0001-version-libraries.patch
rename to meta-oe/recipes-devtools/libubox/libubox/0001-cmake-Set-library-version.patch
index f82c31ad07..737d143287 100644
@@ -1,18 +1,27 @@
+From 0d97421370d1c52d0db798134420796a960df743 Mon Sep 17 00:00:00 2001
+From: Ioan-Adrian Ratiu <[email protected]>
+Date: Thu, 1 Oct 2015 17:31:36 +0300
+Subject: [PATCH 1/3] cmake: Set library version
+
 Upstream-Status: Pending
+Signed-off-by: Moritz Haase <[email protected]>
+---
+ CMakeLists.txt | 3 +++
+ 1 file changed, 3 insertions(+)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 57804cf..1aa7f27 100644
+index f40eaa6..cb089a2 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -18,6 +18,7 @@ ENDIF()
- SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c safe_list.c runqueue.c md5.c kvlist.c ulog.c base64.c)
+@@ -21,6 +21,7 @@ INCLUDE_DIRECTORIES(${JSONC_INCLUDE_DIRS})
+ SET(SOURCES avl.c avl-cmp.c blob.c blobmsg.c uloop.c usock.c ustream.c ustream-fd.c vlist.c utils.c safe_list.c runqueue.c md5.c kvlist.c ulog.c base64.c udebug.c udebug-remote.c)
  
  ADD_LIBRARY(ubox SHARED ${SOURCES})
 +SET_TARGET_PROPERTIES(ubox PROPERTIES VERSION 1.0.1 SOVERSION 1)
  ADD_LIBRARY(ubox-static STATIC ${SOURCES})
  SET_TARGET_PROPERTIES(ubox-static PROPERTIES OUTPUT_NAME ubox)
  
-@@ -46,6 +47,7 @@ find_library(json NAMES json-c)
+@@ -65,6 +66,7 @@ find_library(json NAMES json-c)
  IF(EXISTS ${json})
  	ADD_LIBRARY(blobmsg_json SHARED blobmsg_json.c)
  	TARGET_LINK_LIBRARIES(blobmsg_json ubox ${json})
@@ -20,7 +29,7 @@ index 57804cf..1aa7f27 100644
  
  	ADD_LIBRARY(blobmsg_json-static STATIC blobmsg_json.c)
  	SET_TARGET_PROPERTIES(blobmsg_json-static
-@@ -55,6 +57,7 @@ IF(EXISTS ${json})
+@@ -78,6 +80,7 @@ IF(EXISTS ${json})
  	TARGET_LINK_LIBRARIES(jshn blobmsg_json ${json})
  
  	ADD_LIBRARY(json_script SHARED json_script.c)
meta-oe/recipes-devtools/libubox/libubox/0002-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch renamed from meta-oe/recipes-devtools/libubox/libubox/fix-libdir.patch +8 -7
similarity index 69%
rename from meta-oe/recipes-devtools/libubox/libubox/fix-libdir.patch
rename to meta-oe/recipes-devtools/libubox/libubox/0002-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch
index 6f09c8b293..853ce9b5e4 100644
@@ -1,19 +1,23 @@
-[PATCH] fix the CMAKE_INSTALL_LIBDIR
+From ff1f1c6c67ca9c955385a967b1b6609da76c5944 Mon Sep 17 00:00:00 2001
+From: Roy Li <[email protected]>
+Date: Fri, 30 Oct 2015 13:06:03 +0800
+Subject: [PATCH 2/3] cmake: fix the CMAKE_INSTALL_LIBDIR
 
 Upstream-Status: Pending
 
 libdir maybe /usr/lib64 for 64bit machine
 
 Signed-off-by: Roy Li <[email protected]>
+Signed-off-by: Moritz Haase <[email protected]>
 ---
  CMakeLists.txt | 8 ++++----
  1 file changed, 4 insertions(+), 4 deletions(-)
 
 diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 57804cf..2c7bdc1 100644
+index cb089a2..783fa0a 100644
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -35,8 +35,8 @@ INSTALL(FILES ${headers}
+@@ -42,8 +42,8 @@ INSTALL(FILES ${headers}
  	DESTINATION include/libubox
  )
  INSTALL(TARGETS ubox ubox-static
@@ -24,7 +28,7 @@ index 57804cf..2c7bdc1 100644
  )
  
  ADD_SUBDIRECTORY(lua)
-@@ -58,8 +58,8 @@ IF(EXISTS ${json})
+@@ -84,8 +84,8 @@ IF(EXISTS ${json})
  	TARGET_LINK_LIBRARIES(json_script ubox)
  
  	INSTALL(TARGETS blobmsg_json blobmsg_json-static jshn json_script
@@ -35,6 +39,3 @@ index 57804cf..2c7bdc1 100644
  		RUNTIME DESTINATION bin
  	)
  
--- 
-1.9.1
-
meta-oe/recipes-devtools/libubox/libubox/0003-cmake-Don-t-include-lua-and-examples-directories-if-.patch new file +35 -0
new file mode 100644
index 0000000000..b38989ef9e
@@ -0,0 +1,35 @@
+From 93e7b9014a14193e39e5d414c81da2d32f94ed43 Mon Sep 17 00:00:00 2001
+From: Moritz Haase <[email protected]>
+Date: Mon, 14 Jul 2025 09:23:09 +0200
+Subject: [PATCH 3/3] cmake: Don't include 'lua' and 'examples' directories if
+ disabled
+
+It's the sensible thing to do and unblocks builds with CMake 4+, since both
+CMakeLists.txt files in the directories in question have
+'cmake_minimum_required(VERSION 2.6)'.
+
+Upstream-Status: Pending
+Signed-off-by: Moritz Haase <[email protected]>
+---
+ CMakeLists.txt | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 783fa0a..61e152c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -46,8 +46,12 @@ INSTALL(TARGETS ubox ubox-static
+ 	LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+ 
+-ADD_SUBDIRECTORY(lua)
+-ADD_SUBDIRECTORY(examples)
++IF(BUILD_LUA)
++	ADD_SUBDIRECTORY(lua)
++ENDIF()
++IF(BUILD_EXAMPLES)
++	ADD_SUBDIRECTORY(examples)
++ENDIF()
+ 
+ MACRO(ADD_UNIT_TEST_SAN name)
+   ADD_EXECUTABLE(${name}-san ${name}.c)
meta-oe/recipes-devtools/libubox/libubox_git.bb +4 -4
index 394cf9c000..3c51d36848 100644
@@ -14,12 +14,12 @@ LIC_FILES_CHKSUM = "\
 
 SRC_URI = "\
     git://git.openwrt.org/project/libubox.git;branch=master \
-    file://0001-version-libraries.patch \
-    file://fix-libdir.patch \
-    file://0001-blobmsg-fix-array-out-of-bounds-GCC-10-warning.patch \
+    file://0001-cmake-Set-library-version.patch \
+    file://0002-cmake-fix-the-CMAKE_INSTALL_LIBDIR.patch \
+    file://0003-cmake-Don-t-include-lua-and-examples-directories-if-.patch \
 "
 
-SRCREV = "07413cce72e19520af55dfcbc765484f5ab41dd9"
+SRCREV = "b7acc8e6fd5e13611ad90a593e98f9589af4009a"
 PV = "1.0.1+git"
 
 # Upstream repo does not tag
#2 lore raw

PATCH 3/10 soci: upgrade 4.0.3 -> 4.1.2

In reply to Moritz Haase

New version includes support to build against CMake 4+.

---
 ...Do-not-use-std-shuffle-with-clang-15.patch | 32 -------------------
 .../soci/{soci_4.0.3.bb => soci_4.1.2.bb}     |  5 ++-
 2 files changed, 2 insertions(+), 35 deletions(-)
 delete mode 100644 meta-oe/recipes-dbs/soci/soci/0001-Do-not-use-std-shuffle-with-clang-15.patch
 rename meta-oe/recipes-dbs/soci/{soci_4.0.3.bb => soci_4.1.2.bb} (90%)
meta-oe/recipes-dbs/soci/soci/0001-Do-not-use-std-shuffle-with-clang-15.patch deleted +0 -32
deleted file mode 100644
index eb29627c6d..0000000000
@@ -1,32 +0,0 @@
-From e5f72c656829402c6f70e7416039bc18f0c26485 Mon Sep 17 00:00:00 2001
-From: Khem Raj <[email protected]>
-Date: Tue, 30 Aug 2022 22:17:14 -0700
-Subject: [PATCH] Do not use std::shuffle with clang 15
-
-This fails to compile although its preferred approach for c++11 and
-newer
-
-See
-https://github.com/SOCI/soci/issues/984
-
-Upstream-Status: Inappropriate [Workaround]
-Signed-off-by: Khem Raj <[email protected]>
----
- cmake/SociConfig.cmake | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/cmake/SociConfig.cmake b/cmake/SociConfig.cmake
-index 492e1837..f24fd9a6 100644
---- a/cmake/SociConfig.cmake
-+++ b/cmake/SociConfig.cmake
-@@ -94,6 +94,7 @@ else()
-     set(SOCI_CXX11 ON)
-     set(SOCI_CXX_VERSION_FLAGS "-std=c++11")
-     add_definitions(-DCATCH_CONFIG_CPP11_NO_IS_ENUM)
-+    add_definitions(-DCATCH_CONFIG_CPP11_NO_SHUFFLE)
- 
-     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SOCI_GCC_CLANG_COMMON_FLAGS} ${SOCI_CXX_VERSION_FLAGS}")
- 
--- 
-2.37.3
-
meta-oe/recipes-dbs/soci/soci_4.1.2.bb renamed from meta-oe/recipes-dbs/soci/soci_4.0.3.bb +2 -3
similarity index 90%
rename from meta-oe/recipes-dbs/soci/soci_4.0.3.bb
rename to meta-oe/recipes-dbs/soci/soci_4.1.2.bb
index 315f5d515e..d199f5350c 100644
@@ -5,9 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE_1_0.txt;md5=e4224ccaecb14d942c71d31bef20d78c"
 SECTION = "libs"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/project/${BPN}/${BPN}/${BP}/${BP}.tar.gz \
-           file://0001-Do-not-use-std-shuffle-with-clang-15.patch \
            "
-SRC_URI[sha256sum] = "615e5f7e4b52007f3a3b4050a99aadf6346b56b5098eb08b3a650836083c6a33"
+SRC_URI[sha256sum] = "b79afe73db241f762ddb611fe11184cbf6da44ba99f90721515daa2f978ff38e"
 
 TESTCONFIG = '-DSOCI_TEST_EMPTY_CONNSTR="dummy" -DSOCI_TEST_SQLITE3_CONNSTR="test.db" \
               -DSOCI_TEST_POSTGRESQL_CONNSTR:STRING="dbname=soci_test" \
@@ -44,5 +43,5 @@ FILES:${PN}-odbc = "${libdir}/lib${BPN}_odbc.so.*"
 FILES:${PN}-oracle = "${libdir}/lib${BPN}_oracle.so.*"
 
 do_install:append() {
-    sed -i 's|${RECIPE_SYSROOT}${prefix}|${_IMPORT_PREFIX}|g' ${D}${libdir}/cmake/SOCI/SOCITargets*.cmake
+    sed -i 's|${RECIPE_SYSROOT}${prefix}|${_IMPORT_PREFIX}|g' ${D}${libdir}/cmake/${BPN}-${PV}/SOCI*Targets.cmake
 }
#3 lore raw

PATCH 4/10 czmq: Allow to build with CMake 4+

In reply to Moritz Haase

There hasn't been an upstream release in four years. Latest HEAD supports builds with CMake 4+, but the corresponding patches at [0] and [1] are considered to be too invasive to backport. Instead, apply the 'minimum policy version' override.

[0]: https://github.com/zeromq/czmq/commit/00d7750304f1c144f47225274b22ea8d638641ed
[1]: https://github.com/zeromq/czmq/commit/53b46d63b41c51e32b5d539aa78ca91846f6a2a1

---
 meta-oe/recipes-connectivity/zeromq/czmq_4.2.1.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-connectivity/zeromq/czmq_4.2.1.bb +1 -0
index 33a339f5c3..9a71c2e0eb 100644
@@ -16,6 +16,7 @@ inherit cmake pkgconfig
 PACKAGES = "lib${BPN} lib${BPN}-dev lib${BPN}-staticdev ${PN} ${PN}-dbg"
 
 EXTRA_OECMAKE = " \
+    -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
     -DCMAKECONFIG_INSTALL_DIR:PATH=${@os.path.relpath(d.getVar('libdir'), d.getVar('prefix') + '/') + "/cmake/"} \
 "
 
#4 lore raw

PATCH 5/10 libvncserver: upgrade 0.9.14 -> 0.9.15

In reply to Moritz Haase

Also pull in a patch to support builds with CMake 4+ that hasn't made it into a release yet.

Release notes are available at [0].

[0]: https://github.com/LibVNC/libvncserver/releases/tag/LibVNCServer-0.9.15

---
 ...001-CMake-require-at-least-CMake-3.5.patch | 25 +++++++++++++++++++
 ...erver_0.9.14.bb => libvncserver_0.9.15.bb} |  6 +++--
 2 files changed, 29 insertions(+), 2 deletions(-)
 create mode 100644 meta-oe/recipes-graphics/libvncserver/libvncserver/0001-CMake-require-at-least-CMake-3.5.patch
 rename meta-oe/recipes-graphics/libvncserver/{libvncserver_0.9.14.bb => libvncserver_0.9.15.bb} (92%)
meta-oe/recipes-graphics/libvncserver/libvncserver/0001-CMake-require-at-least-CMake-3.5.patch new file +25 -0
new file mode 100644
index 0000000000..68e3a08acb
@@ -0,0 +1,25 @@
+From e64fa928170f22a2e21b5bbd6d46c8f8e7dd7a96 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Matti=20Lehtim=C3=A4ki?= <[email protected]>
+Date: Tue, 13 May 2025 08:37:07 +0300
+Subject: [PATCH] CMake: require at least CMake 3.5
+
+CMake 4 dropped support for version requirements < 3.5.
+
+Fixes building with CMake >= 4.
+
+Upstream-Status: Backport [e64fa928170f22a2e21b5bbd6d46c8f8e7dd7a96]
+Signed-off-by: Moritz Haase <[email protected]>
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 205f3928..9b8118c8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,4 +1,4 @@
+-cmake_minimum_required(VERSION 3.4)
++cmake_minimum_required(VERSION 3.5)
+ 
+ set(PROJECT_LANGUAGES C)
+ 
meta-oe/recipes-graphics/libvncserver/libvncserver_0.9.15.bb renamed from meta-oe/recipes-graphics/libvncserver/libvncserver_0.9.14.bb +4 -2
similarity index 92%
rename from meta-oe/recipes-graphics/libvncserver/libvncserver_0.9.14.bb
rename to meta-oe/recipes-graphics/libvncserver/libvncserver_0.9.15.bb
index ff5df428e8..9d2d0a5743 100644
@@ -44,8 +44,10 @@ FILES:libvncclient = "${libdir}/libvncclient.*"
 
 inherit cmake
 
-SRC_URI = "git://github.com/LibVNC/libvncserver;branch=master;protocol=https"
-SRCREV = "10e9eb75f73e973725dc75c373de5d89807af028"
+SRC_URI = "git://github.com/LibVNC/libvncserver;branch=master;protocol=https;tag=LibVNCServer-${PV} \
+           file://0001-CMake-require-at-least-CMake-3.5.patch \
+"
+SRCREV = "9b54b1ec32731bd23158ca014dc18014db4194c3"
 
 
 EXTRA_OECMAKE = "-DMAKE_INSTALL_LIBDIR=${libdir}"
#5 lore raw

PATCH 6/10 freerdp: Allow to build with CMake 4+

In reply to Moritz Haase

The 2.x branch of freerdp is in maintenance mode and upstream has ruled out changes to officially support builds with CMake 4+ (see [0]). Thus, apply the 'minimum policy version' override.

[0]: https://github.com/FreeRDP/FreeRDP/issues/11707

---
 meta-oe/recipes-support/freerdp/freerdp_2.11.7.bb | 1 +
 1 file changed, 1 insertion(+)
meta-oe/recipes-support/freerdp/freerdp_2.11.7.bb +1 -0
index 18af3229d7..a78724b925 100644
@@ -25,6 +25,7 @@ SRC_URI = "git://github.com/FreeRDP/FreeRDP.git;branch=stable-2.0;protocol=https
 
 
 EXTRA_OECMAKE += " \
+    -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
     -DWITH_FFMPEG=OFF \
     -DWITH_CUNIT=OFF \
     -DWITH_NEON=OFF \
#6 lore raw

PATCH 7/10 dnfdragora: Allow to build with CMake 4+

In reply to Moritz Haase

The 2.x branch of dnfdragora is in maintenance mode. Official support to build with CMake 4+ is only available in preview versions of v3 (named 2.99.x, see [0]) which are only compatible with dnf v5. Thus, apply the 'minimum policy version' override.

[0]: https://github.com/manatools/dnfdragora/commit/0b84709de2b6e981b6359f1ad9806eca5e267462

---
 meta-oe/recipes-graphics/dnfdragora/dnfdragora_2.1.6.bb | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta-oe/recipes-graphics/dnfdragora/dnfdragora_2.1.6.bb +2 -1
index ef6dc14ca6..50fff7de54 100644
@@ -20,7 +20,8 @@ DEPENDS += "dnf python3 "
 RDEPENDS:${PN}:class-target = " python3-core libyui libyui-ncurses "
 
 # manpages generation requires http://www.sphinx-doc.org/
-EXTRA_OECMAKE = " -DWITH_MAN=OFF -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
+EXTRA_OECMAKE += "-DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
+                  -DWITH_MAN=OFF -DPYTHON_INSTALL_DIR=${PYTHON_SITEPACKAGES_DIR} -DPYTHON_DESIRED=3"
 
 BBCLASSEXTEND = "nativesdk"
 
#7 lore raw

PATCH 8/10 opengl-es-cts: Allow to build with CMake 4+

In reply to Moritz Haase

Latest HEAD supports builds with CMake 4+, but the corresponding patch at [0] is considered to be too invasive to backport. Instead, apply the 'minimum policy version' override.

[0]: https://github.com/KhronosGroup/Vulkan-Video-Samples/commit/ab3b3b37dc120b383922dde9850cee8d185b45f3

---
 meta-oe/recipes-graphics/vk-gl-cts/opengl-es-cts_3.2.12.0.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta-oe/recipes-graphics/vk-gl-cts/opengl-es-cts_3.2.12.0.bb +3 -1
index 1bcbed1600..a98360c73f 100644
@@ -6,7 +6,9 @@ SRCREV_vk-gl-cts = "42e61858e862e153cd0fe36593a8c3f7c16c3275"
 
 require opengl-es-cts-sources.inc
 
-EXTRA_OECMAKE += "-DSELECTED_BUILD_TARGETS="cts-runner deqp-egl deqp-gles2 deqp-gles3 deqp-gles31 deqp-gl-shared de-internal-tests glcts""
+EXTRA_OECMAKE += "-DSELECTED_BUILD_TARGETS="cts-runner deqp-egl deqp-gles2 deqp-gles3 deqp-gles31 deqp-gl-shared de-internal-tests glcts" \
+                  -DCMAKE_POLICY_VERSION_MINIMUM=3.5 \
+"
 
 do_install() {
 	install -d ${D}/${CTSDIR}
#8 lore raw

PATCH 9/10 gattlib: upgrade 0.2.0 -> 0.7.2

In reply to Moritz Haase

New version includes support to build against CMake 4+.

Release notes are available at [0].

[0]: https://github.com/labapart/gattlib/releases

License-Update: Copyright year changed

---
 .../files/0001-Add-missing-include.patch      | 24 +++++++++++++++++++
 .../{gattlib_git.bb => gattlib_0.7.2.bb}      |  9 ++++---
 2 files changed, 28 insertions(+), 5 deletions(-)
 create mode 100644 meta-oe/recipes-connectivity/gattlib/files/0001-Add-missing-include.patch
 rename meta-oe/recipes-connectivity/gattlib/{gattlib_git.bb => gattlib_0.7.2.bb} (88%)
meta-oe/recipes-connectivity/gattlib/files/0001-Add-missing-include.patch new file +24 -0
new file mode 100644
index 0000000000..15fbb61ed3
@@ -0,0 +1,24 @@
+From a074af0d6a21665d3dfbd785ffd788146afeacef Mon Sep 17 00:00:00 2001
+From: Davide Cavalca <[email protected]>
+Date: Thu, 25 Apr 2024 21:39:23 -0700
+Subject: [PATCH] Add missing include
+
+Upstream-Status: Backport [a074af0d6a21665d3dfbd785ffd788146afeacef]
+Signed-off-by: Moritz Haase <[email protected]>
+---
+ common/gattlib_common_adapter.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/common/gattlib_common_adapter.c b/common/gattlib_common_adapter.c
+index d56ed5b..d4274c8 100644
+--- a/common/gattlib_common_adapter.c
++++ b/common/gattlib_common_adapter.c
+@@ -4,6 +4,8 @@
+  * Copyright (c) 2021-2024, Olivier Martin <[email protected]>
+  */
+ 
++#include <ctype.h>
++
+ #include "gattlib_internal.h"
+ 
+ // Keep track of the allocated adapters to avoid an adapter to be freed twice.
meta-oe/recipes-connectivity/gattlib/gattlib_0.7.2.bb renamed from meta-oe/recipes-connectivity/gattlib/gattlib_git.bb +4 -5
similarity index 88%
rename from meta-oe/recipes-connectivity/gattlib/gattlib_git.bb
rename to meta-oe/recipes-connectivity/gattlib/gattlib_0.7.2.bb
index 06f0b5bf0a..1ebb8350b2 100644
@@ -2,18 +2,17 @@ DESCRIPTION = "Bluetooth library with attribute support"
 SECTION = "libs/network"
 
 LICENSE = "GPL-2.0-or-later | BSD-3-Clause"
-LIC_FILES_CHKSUM = "file://CMakeLists.txt;beginline=1;endline=6;md5=a87ee154f005a6f035b8b34ac2191f3b"
+LIC_FILES_CHKSUM = "file://CMakeLists.txt;beginline=1;endline=6;md5=f44a9a14d37330e7cd454e694e714ab8"
 
 DEPENDS = "bluez5 glib-2.0 glib-2.0-native python3-packaging-native"
 
-PV = "0.2+git"
-
-SRC_URI = "git://github.com/labapart/gattlib.git;branch=master;protocol=https \
+SRC_URI = "git://github.com/labapart/gattlib.git;branch=master;protocol=https;tag=${PV} \
            file://dbus-avoid-strange-chars-from-the-build-dir.patch \
+           file://0001-Add-missing-include.patch \
            "
 
 SRCBRANCH = "master"
-SRCREV = "33a8a275928b186381bb0aea0f9778e330e57ec3"
+SRCREV = "f99558d9b8e3dbba2a952a0b292d3497aec8ee69"
 
 
 CVE_STATUS[CVE-2019-6498] = "fixed-version: patch is already included in sources"
#9 lore raw

PATCH 10/10 minifi-cpp: Backport patch to support builds with CMake 4+

In reply to Moritz Haase

There hasn't been a new upstream release yet that ships the required changes.

---
 ...MP0065-OLD-removed-in-cmake-4.0-remo.patch | 42 +++++++++++++++++++
 .../minifi-cpp/minifi-cpp_0.99.1.bb           |  1 +
 2 files changed, 43 insertions(+)
 create mode 100644 meta-oe/recipes-extended/minifi-cpp/files/0008-MINIFICPP-2553-CMP0065-OLD-removed-in-cmake-4.0-remo.patch
meta-oe/recipes-extended/minifi-cpp/files/0008-MINIFICPP-2553-CMP0065-OLD-removed-in-cmake-4.0-remo.patch new file +42 -0
new file mode 100644
index 0000000000..3e916a8081
@@ -0,0 +1,42 @@
+From 905676309a407b9a50118b31370b73ec411a6f8b Mon Sep 17 00:00:00 2001
+From: Marton Szasz <[email protected]>
+Date: Mon, 31 Mar 2025 14:48:01 +0200
+Subject: [PATCH] MINIFICPP-2553 CMP0065=OLD removed in cmake 4.0, removed
+ override
+
+Signed-off-by: Marton Szasz <[email protected]>
+Signed-off-by: Gabor Gyimesi <[email protected]>
+
+This closes #1957
+
+Upstream-Status: Backport [26aea0d8280986713b441cda3fd3858c80d21f65]
+Signed-off-by: Moritz Haase <[email protected]>
+---
+ CMakeLists.txt             | 1 -
+ minifi_main/CMakeLists.txt | 1 -
+ 2 files changed, 2 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 70c94c2f..6673e331 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -19,7 +19,6 @@
+ 
+ cmake_minimum_required(VERSION 3.24)
+ cmake_policy(SET CMP0096 NEW) # policy to preserve the leading zeros in PROJECT_VERSION_{MAJOR,MINOR,PATCH,TWEAK}
+-cmake_policy(SET CMP0065 OLD) # default export policy, required for self-dlopen
+ cmake_policy(SET CMP0135 NEW) # policy to set the timestamps of extracted contents to the time of extraction
+ 
+ project(nifi-minifi-cpp VERSION 0.99.1)
+diff --git a/minifi_main/CMakeLists.txt b/minifi_main/CMakeLists.txt
+index 62eb234f..1a2e9e0e 100644
+--- a/minifi_main/CMakeLists.txt
++++ b/minifi_main/CMakeLists.txt
+@@ -69,7 +69,6 @@ target_link_libraries(minifiexe spdlog libsodium gsl-lite argparse ${LIBMINIFI})
+ 
+ set_target_properties(minifiexe PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
+ set_target_properties(minifiexe PROPERTIES OUTPUT_NAME minifi)
+-set_target_properties(minifiexe PROPERTIES ENABLE_EXPORTS True)
+ if (WIN32)
+     target_compile_definitions(minifiexe PUBLIC SERVICE_NAME="Apache NiFi MINiFi")
+ endif()
meta-oe/recipes-extended/minifi-cpp/minifi-cpp_0.99.1.bb +1 -0
index 04f2488a61..16dc46275a 100644
@@ -26,6 +26,7 @@ SRC_URI = "git://github.com/apache/nifi-minifi-cpp.git;protocol=https;branch=mai
            file://0005-generateVersion.sh-set-correct-buildrev.patch \
            file://0006-CMakeLists.txt-do-not-use-ccache.patch \
            file://0007-libsodium-aarch64-set-compiler-attributes-after-including-arm_.patch \
+           file://0008-MINIFICPP-2553-CMP0065-OLD-removed-in-cmake-4.0-remo.patch \
            file://systemd-volatile.conf \
            file://sysvinit-volatile.conf \
           "
#10 lore raw
In reply to Moritz Haase
Quoted 5 lines · Moritz Haase via lists.openembedded.org

The component itself builds just fine with CMake 4, but the tests don't as they rely on a bundled version of GTest that is six years old. Since upstream is inactive, the simplest course of action is to not build the tests and disable ptest support.

is it possible to try using system gtest ?

Quoted 133 lines
---
 ...s.txt-fix-googletest-related-options.patch | 55 -------------------
 meta-oe/recipes-dbs/leveldb/leveldb/run-ptest | 10 ----
 meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb   | 10 +---
 3 files changed, 2 insertions(+), 73 deletions(-)
 delete mode 100644 meta-oe/recipes-dbs/leveldb/leveldb/0001-CMakeLists.txt-fix-googletest-related-options.patch
 delete mode 100644 meta-oe/recipes-dbs/leveldb/leveldb/run-ptest
meta-oe/recipes-dbs/leveldb/leveldb/0001-CMakeLists.txt-fix-googletest-related-options.patch deleted +0 -55
deleted file mode 100644
index b0bfb8bf16..0000000000
@@ -1,55 +0,0 @@
-From 77da477840f89da7ced29da315de77571e8f190e Mon Sep 17 00:00:00 2001
-From: Martin Jansa <[email protected]>
-Date: Fri, 20 Oct 2023 22:57:48 +0200
-Subject: [PATCH] CMakeLists.txt: fix googletest related options
-
-* https://cmake.org/cmake/help/book/mastering-cmake/chapter/Writing%20CMakeLists%20Files.html
-  says that CMake options are case-sensitive and I don't see lower-case version in
-  currently used googletest submodules and gtest is indeed installed with leveldb
-
-* install_gmock option I don't see at all, so I've kept it as is, INSTALL_GTEST, BUILD_GMOCK
-  do exist as upper-case
-
-$ grep -Ri install_.*mock .
-./CMakeLists.txt:  set(install_gmock OFF)
-./third_party/googletest/googlemock/CMakeLists.txt:install_project(gmock gmock_main)
-$ grep -Ri build_gmock .
-./CMakeLists.txt:  set(BUILD_GMOCK ON)
-./third_party/googletest/googletest/README.md:cmake .. -DBUILD_GMOCK=OFF
-./third_party/googletest/CMakeLists.txt:option(BUILD_GMOCK "Builds the googlemock subproject" ON)
-./third_party/googletest/CMakeLists.txt:if(BUILD_GMOCK)
-$ grep -Ri install_gtest .
-./CMakeLists.txt:  set(INSTALL_GTEST OFF)
-./third_party/googletest/googletest/cmake/internal_utils.cmake:  if(INSTALL_GTEST)
-./third_party/googletest/googletest/CMakeLists.txt:if (INSTALL_GTEST)
-./third_party/googletest/CMakeLists.txt:option(INSTALL_GTEST "Enable installation of googletest. (Projects embedding googletest may want to turn this OFF.)" ON)
-
-* also use CACHE and FORCE as sugested in:
-  https://cmake.org/cmake/help/latest/command/set.html
-  https://stackoverflow.com/questions/20239334/cmake-set-subdirectory-options
-  for the value to correctly propagate into third_party/googletest subdirectory
-
-Signed-off-by: Martin Jansa <[email protected]>
----
-Upstream-Status: Submitted [https://github.com/google/leveldb/pull/1152]
-
- CMakeLists.txt | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index fda9e01..f8a2629 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -295,9 +295,9 @@ if(LEVELDB_BUILD_TESTS)
-
-   # Prevent overriding the parent project's compiler/linker settings on Windows.
-   set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
--  set(install_gtest OFF)
--  set(install_gmock OFF)
--  set(build_gmock ON)
-+  set(INSTALL_GTEST OFF CACHE BOOL "" FORCE)
-+  set(install_gmock OFF CACHE BOOL "" FORCE)
-+  set(BUILD_GMOCK ON CACHE BOOL "" FORCE)
-
-   # This project is tested using GoogleTest.
-   add_subdirectory("third_party/googletest")
meta-oe/recipes-dbs/leveldb/leveldb/run-ptest deleted +0 -10
deleted file mode 100644
index 9ae70c1284..0000000000
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-for test in *_test; do
-    if ./${test}; then
-        echo "PASS: ${test}"
-    else
-        echo "FAIL: ${test}"
-    fi
-done
-
meta-oe/recipes-dbs/leveldb/leveldb_1.23.bb +2 -9
index 9cefc528ae..0ee0c8c075 100644
@@ -5,30 +5,24 @@ LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=92d1b128950b11ba8495b64938fc164d"
 
 SRC_URI = "gitsm://github.com/google/${BPN}.git;branch=main;protocol=https \
-    file://0001-CMakeLists.txt-fix-googletest-related-options.patch \
     file://0001-Fix-printing-64-bit-integer-types.patch \
-    file://run-ptest \
 "
 
 SRCREV = "068d5ee1a3ac40dabd00d211d5013af44be55bea"
 
-inherit cmake ptest
+inherit cmake
 PACKAGECONFIG ??= ""
 PACKAGECONFIG[benchmarks] = "-DLEVELDB_BUILD_BENCHMARKS=ON,-DLEVELDB_BUILD_BENCHMARKS=OFF,sqlite"
 PACKAGECONFIG[snappy] = ",,snappy"
 PACKAGECONFIG[tcmalloc] = ",,gperftools"
 
 EXTRA_OECMAKE = "-DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUILD_SHARED_LIBS=ON -DCMAKE_SKIP_RPATH=ON \
-                 -DLEVELDB_BUILD_TESTS=${@bb.utils.contains('DISTRO_FEATURES', 'ptest', 'ON', 'OFF', d)}"
+                 -DLEVELDB_BUILD_TESTS=OFF"
 
 do_install:append() {
     install -D -m 0755 ${B}/leveldbutil ${D}${bindir}/leveldbutil
 }
 
-do_install_ptest() {
-    install -m 0755 ${B}/*_test ${D}${PTEST_PATH}
-}
-
 # Do not try to build lib32-leveldb for mips64, but allow libn32-leveldb.
 #
 COMPATIBLE_HOST:mipsarcho32:pn-lib32-leveldb = "null"
 
-=-=-=-=-=-=-=-=-=-=-=-

Links: You receive all messages sent to this group.
View/Reply Online (#118519): https://lists.openembedded.org/g/openembedded-devel/message/118519
Mute This Topic: https://lists.openembedded.org/mt/114145341/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-