zlog: upgrade 1.2.16 -> 1.2.18

Switched to cmake. Added a backported patch to be able to use
the latest version of cmake.

Also, add a new patch to avoid overwritingg all the CFLAGS set by Yocto,
which helps with avoiding the inclusion of TMPDIR in the generated files.

License-Update: License changed to Apache2:
1a7b1a6fb9

Changelog:
1.2.18:
- patched severe vulnerability CVE-2024-22857
- restructured build system

1.2.17:
- Change Lience to Apache 2.0, for more people

Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Gyorgy Sarvari 2025-09-24 11:41:22 +02:00 committed by Khem Raj
parent 6ac3bc3950
commit 8891ca8748
No known key found for this signature in database
GPG Key ID: BB053355919D3314
4 changed files with 68 additions and 16 deletions

View File

@ -0,0 +1,31 @@
From ee35b6507993e79fc594e3b7ad50174e33e68daa Mon Sep 17 00:00:00 2001
From: Gyorgy Sarvari <skandigraun@gmail.com>
Date: Wed, 24 Sep 2025 11:22:29 +0200
Subject: [PATCH] Don't overwrite systemwide cflags
Instead of overriding the cflags from the system, just append to them.
Upstream-Status: Submitted [https://github.com/HardySimpson/zlog/pull/306]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
CMakeLists.txt | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8981934..f2bd574 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,9 +33,9 @@ SET(ZLOG_SO_VERSION ${CPACK_PACKAGE_VERSION_MAJOR})
message(STATUS "platform : ${CMAKE_SYSTEM}")
add_definitions("-g -Wall -Wstrict-prototypes")
-set(CMAKE_C_FLAGS "-std=c99 -pedantic -D_DEFAULT_SOURCE")
-set(CMAKE_C_FLAGS_DEBUG "-ggdb3 -DDEBUG")
-set(CMAKE_C_FLAGS_RELEASE "-O2")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -pedantic -D_DEFAULT_SOURCE")
+set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb3 -DDEBUG")
+set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O2")
if (WIN32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 ")

View File

@ -0,0 +1,25 @@
From 3715879775f725260aeda14f94887bbc7a007e29 Mon Sep 17 00:00:00 2001
From: haydenZhou <mfkhao2009@outlook.com>
Date: Sun, 8 Jun 2025 10:45:05 +0800
Subject: [PATCH] upgrade cmake minimum version
Upstream-Status: Backport [https://github.com/HardySimpson/zlog/commit/3715879775f725260aeda14f94887bbc7a007e29]
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
---
CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5ddaf8d..31a1553 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,7 @@
# limitations under the License.
#/
-cmake_minimum_required(VERSION 2.8.5)
+cmake_minimum_required(VERSION 3.12)
message(STATUS "path : ${CMAKE_FIND_ROOT_PATH}")
project(zlog)

View File

@ -1,16 +0,0 @@
DESCRIPTION = "Zlog is a pure C logging library"
HOMEPAGE = "https://github.com/HardySimpson/zlog"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = "file://COPYING;md5=4fbd65380cdd255951079008b364516c"
SRCREV = "dc2c284664757fce6ef8f96f8b3ab667a53ef489"
SRC_URI = "git://github.com/HardySimpson/zlog;branch=master;protocol=https"
inherit pkgconfig
EXTRA_OEMAKE = "CC='${CC}' LD='${LD}' LIBRARY_PATH=${baselib}"
do_install() {
oe_runmake install PREFIX=${D}${exec_prefix} INSTALL=install
}

View File

@ -0,0 +1,12 @@
DESCRIPTION = "Zlog is a pure C logging library"
HOMEPAGE = "https://github.com/HardySimpson/zlog"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://LICENSE;md5=86d3f3a95c324c9479bd8986968f4327"
SRC_URI = "git://github.com/HardySimpson/zlog;branch=master;protocol=https;tag=${PV} \
file://upgrade_cmake_minimum_version.patch \
file://0001-Don-t-overwrite-systemwide-cflags.patch"
SRCREV = "7fe61ca6265516e9327a51fc394b2adb126c2ef3"
inherit cmake