diff --git a/0002-feat-for-embedded-fix-eventhandler-compile-errors.patch b/0002-feat-for-embedded-fix-eventhandler-compile-errors.patch new file mode 100644 index 0000000..0f3b769 --- /dev/null +++ b/0002-feat-for-embedded-fix-eventhandler-compile-errors.patch @@ -0,0 +1,91 @@ +From 53cabe6ad687bac70f51cb39d265116ff8c8d883 Mon Sep 17 00:00:00 2001 +From: s_c_c +Date: Mon, 25 Mar 2024 17:04:16 +0800 +Subject: [PATCH] feat for embedded fix eventhandler compile errors + +--- + frameworks/eventhandler/BUILD.gn | 3 ++- + frameworks/eventhandler/include/event_handler_utils.h | 3 ++- + frameworks/napi/BUILD.gn | 3 ++- + frameworks/native/BUILD.gn | 6 +++--- + 4 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/frameworks/eventhandler/BUILD.gn b/frameworks/eventhandler/BUILD.gn +index 7342337..a4be522 100644 +--- a/frameworks/eventhandler/BUILD.gn ++++ b/frameworks/eventhandler/BUILD.gn +@@ -14,11 +14,12 @@ + import("//build/ohos.gni") + import("../../eventhandler.gni") + import("inner_api_sources.gni") ++import("//build/config/sysroot.gni") + + config("libeventhandler_config") { + include_dirs = [ + "${inner_api_path}", +- "//commonlibrary/c_utils/base/include", ++ "${sysroot}/usr/include/c_utils", + "include", + ] + } +diff --git a/frameworks/eventhandler/include/event_handler_utils.h b/frameworks/eventhandler/include/event_handler_utils.h +index 37e862f..84be89d 100644 +--- a/frameworks/eventhandler/include/event_handler_utils.h ++++ b/frameworks/eventhandler/include/event_handler_utils.h +@@ -94,7 +94,8 @@ static inline bool AllowHiTraceOutPut(const std::shared_ptr& traceId, + static inline void GetLastErr(char *errmsg, size_t size = MAX_ERRORMSG_LEN) + { + size = size > MAX_ERRORMSG_LEN ? MAX_ERRORMSG_LEN : size; +- strerror_r(errno, errmsg, size); ++ char *ret = strerror_r(errno, errmsg, size); ++ (void)ret; + } + } // namespace AppExecFwk + } // namespace OHOS +diff --git a/frameworks/napi/BUILD.gn b/frameworks/napi/BUILD.gn +index 7b6f32f..d946e4e 100644 +--- a/frameworks/napi/BUILD.gn ++++ b/frameworks/napi/BUILD.gn +@@ -14,6 +14,7 @@ + import("//build/ohos.gni") + import("//build/ohos/ace/ace.gni") + import("../../eventhandler.gni") ++import("//build/config/sysroot.gni") + + ohos_shared_library("emitter") { + include_dirs = [ +@@ -21,7 +22,7 @@ ohos_shared_library("emitter") { + "${inner_api_path}", + "//third_party/node/src", + "//third_party/libuv/include", +- "//commonlibrary/c_utils/base/include", ++ "${sysroot}/usr/include/c_utils", + ] + + sources = [ +diff --git a/frameworks/native/BUILD.gn b/frameworks/native/BUILD.gn +index 55e8208..6c98a96 100644 +--- a/frameworks/native/BUILD.gn ++++ b/frameworks/native/BUILD.gn +@@ -13,15 +13,15 @@ + + import("//build/ohos.gni") + import("../../eventhandler.gni") ++import("//build/config/sysroot.gni") + + ohos_shared_library("eventhandler_native") { + sources = [ "src/native_interface_eventhandler.cpp" ] + + include_dirs = [ + "${kits_path}/native", +- "//commonlibrary/c_utils/base/include", +- "//base/hiviewdfx/interfaces/innerkits/libhilog/include", +- "//base/hiviewdfx/interfaces/innerkits/libhitrace/include", ++ "${sysroot}/usr/include/c_utils", ++ "${sysroot}/usr/include/hilog", + ] + + cflags = [ "-Wno-error=inconsistent-missing-override" ] +-- +2.20.1 (Apple Git-117) + diff --git a/eventhandler.BUILD.gn b/eventhandler.BUILD.gn index 1b7662c..bcff0fb 100644 --- a/eventhandler.BUILD.gn +++ b/eventhandler.BUILD.gn @@ -1,7 +1,8 @@ import("//build/ohos.gni") +import("//build/config/sysroot.gni") config("libeventhandler_config") { - include_dirs = [ "/usr/include/eventhandler" ] + include_dirs = [ "${sysroot}/usr/include/eventhandler" ] libs = ["eventhandler.z"] } group("libeventhandler") { @@ -9,7 +10,7 @@ group("libeventhandler") { } config("eventhandler_native_config") { - include_dirs = [ "/usr/include/eventhandler" ] + include_dirs = [ "${sysroot}/usr/include/eventhandler" ] libs = ["eventhandler_native.z"] } group("eventhandler_native") { diff --git a/notification_eventhandler.spec b/notification_eventhandler.spec index f5875c6..e1e6982 100644 --- a/notification_eventhandler.spec +++ b/notification_eventhandler.spec @@ -12,7 +12,7 @@ Name: notification_eventhandler # rpm包版本号 Version: 1.0.0 # rpm包Release号,每次修改需要+1,changelog同步修改 -Release: 1 +Release: 2 # rpm简介 Summary: C++ common basic library for distributed module construction and operation # License openHarmony的应该都是Apache License 2.0 @@ -27,6 +27,7 @@ Source2: eventhandler.bundle.json Source3: eventhandler.BUILD.gn # 补丁定义 Patch0001: 0001-notification-eventhandler.patch +Patch0002: 0002-feat-for-embedded-fix-eventhandler-compile-errors.patch # 编译依赖,提交代码时需要分析依赖层级,从底往上提交代码。 @@ -57,6 +58,7 @@ mkdir -p %{eventhandler_path} mv %{name}-%{oh_version} %{eventhandler_path}/eventhandler # patch命令统一使用-P来指定第几个patch %patch -P1 -p1 -d %{eventhandler_path}/eventhandler +%patch -P2 -p1 -d %{eventhandler_path}/eventhandler # 拷贝依赖的组件的gn文件 mkdir -p %{_builddir}/base/hiviewdfx @@ -113,6 +115,9 @@ cp -rf %{SOURCE3} %{buildroot}%{bundle_dir}/BUILD.gn # 变更日志 %changelog +* Tue Mar 19 2024 s_c_c - 1.0.0-2 +- Fix compile errors and sysroot path for embedded + * Thu Jun 15 2023 chrisshangguan - 1.0.0-1 - Init and adapt to openeuler