open62541: update to v1.4

Use the latest commit from the 1.4 branch; the last 1.4 release was 3
months ago so it contains important fixes.

- The contents of /usr/share/ are slightly different, so change the path
slightly.
- The new patch fixes the .pc file generation (it also ensures that
there are no references to absolute paths in the .pc file which would
need to be removed again).
- PubSub information model is now enabled by default, add a new option
to disable it (disabling only pubsub isn't enough).

Signed-off-by: Johannes Kauffmann <johanneskauffmann@hotmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
Johannes Kauffmann 2026-01-15 11:53:25 +01:00 committed by Khem Raj
parent 121b5f89c8
commit 3e3f0eac0f
No known key found for this signature in database
GPG Key ID: BB053355919D3314
3 changed files with 123 additions and 32 deletions

View File

@ -1,24 +0,0 @@
From a490e82dca5a669b0af27a13d74759d8f77e2333 Mon Sep 17 00:00:00 2001
From: Vyacheslav Yurkov <v.yurkov@precitec.de>
Date: Mon, 3 Oct 2022 18:25:15 +0200
Subject: [PATCH] fix(build): do not install git files
Signed-off-by: Vyacheslav Yurkov <v.yurkov@precitec.de>
---
Upstream-Status: Backport [https://github.com/open62541/open62541/commit/a0328d4cb527f9778a262fc4a6b42bfbdffc38e9]
CMakeLists.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1934374e..bc5c8bad 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1703,6 +1703,7 @@ install(DIRECTORY ${UA_install_tools_dirs}
FILES_MATCHING
PATTERN "*"
PATTERN "*.pyc" EXCLUDE
+ PATTERN ".git*" EXCLUDE
)
install(FILES ${UA_install_tools_files} DESTINATION ${open62541_install_tools_dir})

View File

@ -0,0 +1,114 @@
From a725a263124ae8c87fe6af34a9b3a7981b7f116d Mon Sep 17 00:00:00 2001
From: Johannes Kauffmann <johanneskauffmann@hotmail.com>
Date: Wed, 10 Dec 2025 09:36:55 +0100
Subject: [PATCH] fix(build): List private dependencies in .pc file
In the "normal" case of linking to open62541.so, only -lopen62541 is
needed in `Libs` because open62541's dependencies are not exposed via
its public header files.
All the other dependencies (`Requires.private` and `Libs.private`) only
matter using open62541.a (linking statically via `pkg-config --static`).
The crypto libraries and TMP2 library provide .pc files themselves, so
we can list them in `Requires.private`. The other (direct) open62541
dependencies are listed in `Libs.private`.
Also reorder the .pc file (`Libs` comes last and `Requires(.private)
comes` before `Cflags`).
Fixes: #7574
Upstream-Status: Submitted [https://github.com/open62541/open62541/pull/7588]
---
CMakeLists.txt | 22 +++++++++++-----------
tools/open62541.pc.in | 4 +++-
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 91bf382fd71..6ef54a67847 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -493,13 +493,18 @@ endif()
set(open62541_LIBRARIES "")
set(open62541_PUBLIC_LIBRARIES "")
+set(pkgcfg_libsprivate "")
+set(pkgcfg_requiresprivate "")
if("${UA_ARCHITECTURE}" STREQUAL "posix")
list(APPEND open62541_LIBRARIES "m")
+ list(APPEND pkgcfg_libsprivate "-lm")
if(UA_MULTITHREADING GREATER_EQUAL 100 OR UA_BUILD_UNIT_TESTS)
list(APPEND open62541_PUBLIC_LIBRARIES "pthread")
+ list(APPEND pkgcfg_libsprivate "-lpthread")
endif()
if(NOT APPLE AND (NOT ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD"))
list(APPEND open62541_LIBRARIES "rt")
+ list(APPEND pkgcfg_libsprivate "-lrt")
endif()
elseif("${UA_ARCHITECTURE}" STREQUAL "win32")
list(APPEND open62541_LIBRARIES "ws2_32")
@@ -511,6 +516,7 @@ if(UA_ENABLE_ENCRYPTION_OPENSSL)
# https://cmake.org/cmake/help/v3.13/module/FindOpenSSL.html
find_package(OpenSSL REQUIRED)
list(APPEND open62541_LIBRARIES "${OPENSSL_LIBRARIES}")
+ list(APPEND pkgcfg_requiresprivate "openssl")
if(WIN32)
# Add bestcrypt for windows systems
list(APPEND open62541_LIBRARIES bcrypt)
@@ -521,6 +527,7 @@ if(UA_ENABLE_ENCRYPTION_LIBRESSL)
# See https://github.com/libressl-portable/portable/blob/master/FindLibreSSL.cmake
find_package(LibreSSL REQUIRED)
list(APPEND open62541_LIBRARIES ${LIBRESSL_LIBRARIES})
+ list(APPEND pkgcfg_requiresprivate "openssl")
if(WIN32)
# Add bestcrypt for random generator and ws2_32 for crypto
list(APPEND open62541_LIBRARIES ws2_32 bcrypt)
@@ -533,6 +540,7 @@ if(UA_ENABLE_ENCRYPTION_MBEDTLS OR UA_ENABLE_PUBSUB_ENCRYPTION)
# defined in /tools/cmake/FindMbedTLS.cmake.
find_package(MbedTLS REQUIRED)
list(APPEND open62541_LIBRARIES ${MBEDTLS_LIBRARIES})
+ list(APPEND pkgcfg_requiresprivate "mbedtls")
if(WIN32)
# Add bestcrypt for windows systems
list(APPEND open62541_LIBRARIES bcrypt)
@@ -541,6 +549,7 @@ endif()
if(UA_ENABLE_TPM2_SECURITY)
list(APPEND open62541_LIBRARIES ${TPM2_LIB})
+ list(APPEND pkgcfg_requiresprivate "tpm2-pkcs11")
endif()
if(MINGW)
@@ -1531,17 +1540,8 @@ if(UA_ENABLE_AMALGAMATION)
set(PC_EXTRA_CFLAGS "-DUA_ENABLE_AMALGAMATION")
endif()
-set(pkgcfgpubliclibs "")
-foreach(lib ${open62541_PUBLIC_LIBRARIES})
- set(pkgcfgpubliclibs "${pkgcfgpubliclibs}-l${lib} ")
-endforeach()
-
-if(BUILD_SHARED_LIBS)
- foreach(lib ${open62541_LIBRARIES})
- set(pkgcfgpubliclibs "${pkgcfgpubliclibs}-l${lib} ")
- endforeach()
-endif()
-
+string(REPLACE ";" " " pkgcfg_requiresprivate "${pkgcfg_requiresprivate}")
+string(REPLACE ";" " " pkgcfg_libsprivate "${pkgcfg_libsprivate}")
configure_file(tools/open62541.pc.in ${PROJECT_BINARY_DIR}/src_generated/open62541.pc @ONLY)
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
diff --git a/tools/open62541.pc.in b/tools/open62541.pc.in
index 50abf00af4e..a5986013c8e 100644
--- a/tools/open62541.pc.in
+++ b/tools/open62541.pc.in
@@ -5,5 +5,7 @@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@
Name: open62541
Description: open62541 is an open source C (C99) implementation of OPC UA
Version: @OPEN62541_VER_MAJOR@.@OPEN62541_VER_MINOR@.@OPEN62541_VER_PATCH@@OPEN62541_VER_LABEL@
-Libs: -L${libdir} -lopen62541 @pkgcfgpubliclibs@
+Requires.private: @pkgcfg_requiresprivate@
Cflags: -I${includedir} @PC_EXTRA_CFLAGS@
+Libs: -L${libdir} -lopen62541
+Libs.private: @pkgcfg_libsprivate@

View File

@ -8,17 +8,17 @@ LIC_FILES_CHKSUM = "\
" "
SRCREV_FORMAT = "opcua_mdnsd_ua-nodeset_mqtt-c" SRCREV_FORMAT = "opcua_mdnsd_ua-nodeset_mqtt-c"
SRCREV_opcua = "3eed1a6d5c5b207c531b2d35ed88aa0a4a4541e5" SRCREV_opcua = "95dc4c1e9c8c4d3619f90b9c3fc3af194acb8b30"
SRCREV_mdnsd = "488d24fb9d427aec77df180268f0291eeee7fb8b" SRCREV_mdnsd = "488d24fb9d427aec77df180268f0291eeee7fb8b"
SRCREV_ua-nodeset = "f71b3f411d5cb16097c3ae0c744f67ad45535ffb" SRCREV_ua-nodeset = "d1bb6a22125bd7cd986272b1ee98a18a91d76fff"
SRCREV_mqtt-c = "f69ce1e7fd54f3b1834c9c9137ce0ec5d703cb4d" SRCREV_mqtt-c = "0f4c34c8cc00b16cfee094745d68b8cdbaecd8e0"
SRC_URI = " \ SRC_URI = " \
git://github.com/open62541/open62541.git;name=opcua;branch=1.3;protocol=https \ git://github.com/open62541/open62541.git;name=opcua;branch=1.4;protocol=https \
git://github.com/Pro/mdnsd.git;name=mdnsd;protocol=https;branch=master;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/deps/mdnsd \ git://github.com/Pro/mdnsd.git;name=mdnsd;protocol=https;branch=master;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/deps/mdnsd \
git://github.com/OPCFoundation/UA-Nodeset;name=ua-nodeset;protocol=https;branch=v1.04;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/deps/ua-nodeset \ git://github.com/OPCFoundation/UA-Nodeset;name=ua-nodeset;protocol=https;branch=latest;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/deps/ua-nodeset \
git://github.com/LiamBindle/MQTT-C.git;name=mqtt-c;protocol=https;branch=master;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/deps/mqtt-c \ git://github.com/LiamBindle/MQTT-C.git;name=mqtt-c;protocol=https;branch=master;destsuffix=${BB_GIT_DEFAULT_DESTSUFFIX}/deps/mqtt-c \
file://0001-fix-build-do-not-install-git-files.patch \ file://a725a263124ae8c87fe6af34a9b3a7981b7f116d.patch \
" "
@ -34,9 +34,9 @@ FILES:${PN} = "${libdir}/lib*${SOLIBS}"
# The tools package contains scripts to generate certificates and OPC UA schema definitions + nodeset descriptions. # The tools package contains scripts to generate certificates and OPC UA schema definitions + nodeset descriptions.
PACKAGES += "${PN}-tools" PACKAGES += "${PN}-tools"
FILES:${PN}-tools = "${datadir}/${BPN}/tools/*" FILES:${PN}-tools = "${datadir}/${BPN}/*"
PACKAGECONFIG ?= "encryption-mbedtls pubsub pubsub-eth subscriptions subscriptions-events namespace-full" PACKAGECONFIG ?= "encryption-mbedtls pubsub pubsub-eth pubsub-informationmodel subscriptions subscriptions-events namespace-full"
PACKAGECONFIG[encryption-mbedtls] = "-DUA_ENABLE_ENCRYPTION=MBEDTLS, , mbedtls, , , encryption-openssl" PACKAGECONFIG[encryption-mbedtls] = "-DUA_ENABLE_ENCRYPTION=MBEDTLS, , mbedtls, , , encryption-openssl"
PACKAGECONFIG[encryption-openssl] = "-DUA_ENABLE_ENCRYPTION=OPENSSL, , openssl, , , encryption-mbedtls" PACKAGECONFIG[encryption-openssl] = "-DUA_ENABLE_ENCRYPTION=OPENSSL, , openssl, , , encryption-mbedtls"
PACKAGECONFIG[multithreading] = "-DUA_MULTITHREADING=100, -DUA_MULTITHREADING=0" PACKAGECONFIG[multithreading] = "-DUA_MULTITHREADING=100, -DUA_MULTITHREADING=0"
@ -44,6 +44,7 @@ PACKAGECONFIG[namespace-full] = "-DUA_NAMESPACE_ZERO=FULL, , , , , namespace-red
PACKAGECONFIG[namespace-reduced] = "-DUA_NAMESPACE_ZERO=REDUCED, , , , , namespace-full" PACKAGECONFIG[namespace-reduced] = "-DUA_NAMESPACE_ZERO=REDUCED, , , , , namespace-full"
PACKAGECONFIG[pubsub] = "-DUA_ENABLE_PUBSUB=ON, -DUA_ENABLE_PUBSUB=OFF" PACKAGECONFIG[pubsub] = "-DUA_ENABLE_PUBSUB=ON, -DUA_ENABLE_PUBSUB=OFF"
PACKAGECONFIG[pubsub-eth] = "-DUA_ENABLE_PUBSUB_ETH_UADP=ON, -DUA_ENABLE_PUBSUB_ETH_UADP=OFF" PACKAGECONFIG[pubsub-eth] = "-DUA_ENABLE_PUBSUB_ETH_UADP=ON, -DUA_ENABLE_PUBSUB_ETH_UADP=OFF"
PACKAGECONFIG[pubsub-informationmodel] = "-DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON, -DUA_ENABLE_PUBSUB_INFORMATIONMODEL=OFF"
PACKAGECONFIG[subscriptions] = "-DUA_ENABLE_SUBSCRIPTIONS=ON, -DUA_ENABLE_SUBSCRIPTIONS=OFF" PACKAGECONFIG[subscriptions] = "-DUA_ENABLE_SUBSCRIPTIONS=ON, -DUA_ENABLE_SUBSCRIPTIONS=OFF"
PACKAGECONFIG[subscriptions-events] = "-DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON, -DUA_ENABLE_SUBSCRIPTIONS_EVENTS=OFF" PACKAGECONFIG[subscriptions-events] = "-DUA_ENABLE_SUBSCRIPTIONS_EVENTS=ON, -DUA_ENABLE_SUBSCRIPTIONS_EVENTS=OFF"
PACKAGECONFIG[werror] = "-DUA_FORCE_WERROR=ON, -DUA_FORCE_WERROR=OFF" PACKAGECONFIG[werror] = "-DUA_FORCE_WERROR=ON, -DUA_FORCE_WERROR=OFF"