diff mbox series

[meta-openembedded,1/9] liblightmodbus: Upgrade 2.0.2 -> 3.0 to allow CMake 4+ compatibility

Message ID 20250707225407.1558421-1-alperyasinak1@gmail.com
State New
Headers show
Series [meta-openembedded,1/9] liblightmodbus: Upgrade 2.0.2 -> 3.0 to allow CMake 4+ compatibility | expand

Commit Message

Alper Ak July 7, 2025, 10:53 p.m. UTC
- Drop 0001-cmake-Use-GNUInstallDirs-instead-of-hardcoding-lib-p.patch because it's no longer exists.
- Drop pkgconfig and cmake inherit since library is now header-only and does not require build tools
- Install lightmodbusConfig.cmake for consumers using CMake.

Changelog: https://github.com/Jacajack/liblightmodbus/releases/tag/v3.0

Fix:

| CMake Error at CMakeLists.txt:2 (cmake_minimum_required):
|   Compatibility with CMake < 3.5 has been removed from CMake.
|
|   Update the VERSION argument <min> value.  Or, use the <min>...<max> syntax
|   to tell CMake that the project requires at least <min> but has been updated
|   to work with policies introduced by <max> or earlier.
|
|   Or, add -DCMAKE_POLICY_VERSION_MINIMUM=3.5 to try configuring anyway.

Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
---
 ...tallDirs-instead-of-hardcoding-lib-p.patch | 37 -------------------
 .../liblightmodbus/liblightmodbus_2.0.2.bb    | 14 -------
 .../liblightmodbus/liblightmodbus_3.0.bb      | 17 +++++++++
 3 files changed, 17 insertions(+), 51 deletions(-)
 delete mode 100644 meta-oe/recipes-extended/liblightmodbus/liblightmodbus/0001-cmake-Use-GNUInstallDirs-instead-of-hardcoding-lib-p.patch
 delete mode 100644 meta-oe/recipes-extended/liblightmodbus/liblightmodbus_2.0.2.bb
 create mode 100644 meta-oe/recipes-extended/liblightmodbus/liblightmodbus_3.0.bb
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/liblightmodbus/liblightmodbus/0001-cmake-Use-GNUInstallDirs-instead-of-hardcoding-lib-p.patch b/meta-oe/recipes-extended/liblightmodbus/liblightmodbus/0001-cmake-Use-GNUInstallDirs-instead-of-hardcoding-lib-p.patch
deleted file mode 100644
index 321b41289d..0000000000
--- a/meta-oe/recipes-extended/liblightmodbus/liblightmodbus/0001-cmake-Use-GNUInstallDirs-instead-of-hardcoding-lib-p.patch
+++ /dev/null
@@ -1,37 +0,0 @@ 
-From 066c49158a71ea77598c9e1ae16bba63d6ac6bb5 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Thu, 19 Dec 2019 23:41:35 -0800
-Subject: [PATCH] cmake: Use GNUInstallDirs instead of hardcoding lib path
-
-Upstream-Status: Submitted [https://github.com/Jacajack/liblightmodbus/pull/12]
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
- CMakeLists.txt | 6 +++---
- 1 file changed, 3 insertions(+), 3 deletions(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index ce6cc88..bee83aa 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -242,14 +242,14 @@ if ( DEFINED AVR )
- 	)
- endif( )
- 
--
-+include(GNUInstallDirs)
- #Installation
- install( 
- 	TARGETS lightmodbus
--	ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/"
-+	ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/"
- )
- 
- #Install headers
- install(
- 	DIRECTORY "${CMAKE_SOURCE_DIR}/include/" DESTINATION "${CMAKE_INSTALL_PREFIX}/include/" FILES_MATCHING PATTERN "*.h"
--)
-\ No newline at end of file
-+)
--- 
-2.24.1
-
diff --git a/meta-oe/recipes-extended/liblightmodbus/liblightmodbus_2.0.2.bb b/meta-oe/recipes-extended/liblightmodbus/liblightmodbus_2.0.2.bb
deleted file mode 100644
index c310e0f527..0000000000
--- a/meta-oe/recipes-extended/liblightmodbus/liblightmodbus_2.0.2.bb
+++ /dev/null
@@ -1,14 +0,0 @@ 
-SUMMARY = "A cross-platform, lightweight Modbus RTU library"
-DESCRIPTION = "liblightmodbus is a very lightweight, highly configurable, \
-	       platform-independent Modbus RTU library."
-
-LICENSE = "GPL-3.0-only"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=84dcc94da3adb52b53ae4fa38fe49e5d"
-
-inherit cmake pkgconfig
-
-SRC_URI = "git://github.com/Jacajack/liblightmodbus.git;protocol=https;branch=master \
-           file://0001-cmake-Use-GNUInstallDirs-instead-of-hardcoding-lib-p.patch \
-          "
-SRCREV = "59d2b405f95701e5b04326589786dbb43ce49e81"
-
diff --git a/meta-oe/recipes-extended/liblightmodbus/liblightmodbus_3.0.bb b/meta-oe/recipes-extended/liblightmodbus/liblightmodbus_3.0.bb
new file mode 100644
index 0000000000..5f1233b2b4
--- /dev/null
+++ b/meta-oe/recipes-extended/liblightmodbus/liblightmodbus_3.0.bb
@@ -0,0 +1,17 @@ 
+SUMMARY = "A cross-platform, lightweight Modbus RTU library"
+DESCRIPTION = "liblightmodbus is a very lightweight, highly configurable, \
+	       platform-independent Modbus RTU library."
+
+LICENSE = "GPL-3.0-only"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=84dcc94da3adb52b53ae4fa38fe49e5d"
+
+SRC_URI = "git://github.com/Jacajack/liblightmodbus.git;protocol=https;nobranch=1;tag=v${PV}"
+SRCREV = "e7be88bc65abec4a902f4e5194d7235ebd3a19aa"
+
+do_install() {
+        install -d ${D}${includedir}/lightmodbus
+        install -m 0644 ${S}/include/lightmodbus/*.h ${D}${includedir}/lightmodbus/
+
+        install -d ${D}${libdir}/cmake/lightmodbus
+        install -m 0644 ${S}/lightmodbusConfig.cmake ${D}${libdir}/cmake/lightmodbus/
+}