From b55a57f1a26c7fb7887dd97e5174d77302d53e83 Mon Sep 17 00:00:00 2001 From: Hosung Kim Date: Mon, 20 Jan 2025 13:38:39 +0900 Subject: [PATCH] feat: add aul option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hosung Kim hs852.kim@samsung.com --- configure.py | 9 +++++++++ deps/node/node.gyp | 12 +++++++++++- deps/node/src/lwnode/aul-event-receiver.cc | 2 +- deps/node/src/lwnode/aul-event-receiver.h | 4 ++-- deps/node/src/lwnode/lwnode-public.cc | 12 ++++++------ include/lwnode/lwnode-public.h | 8 ++++---- packaging/lwnode.spec | 6 +----- 7 files changed, 34 insertions(+), 19 deletions(-) diff --git a/configure.py b/configure.py index a6d466689b..bca41e88f2 100755 --- a/configure.py +++ b/configure.py @@ -80,6 +80,7 @@ def lwnode_gyp_opts(opts): args += ['-Dtarget_os=' + ('tizen' if opts.tizen else 'linux')] args += ['-Dprofile=' + str(opts.profile)] if opts.tizen else [] args += ['-Drevision=' + opts.revision] + args += ['-Denable_aul=' + b(opts.aul)] # definitions (used: escargot) args += ['-Descargot_build_mode=' + ('debug' if opts.debug else 'release')] @@ -189,6 +190,14 @@ def setupCLIOptions(parser): help='Build for Tizen Platform (%default)', ) + lwnode_optgroup.add_option( + '--aul', + action='store_true', + dest='aul', + default=False, + help='Enable AUL for Tizen Platform (%default)', + ) + lwnode_optgroup.add_option( '--profile', choices=['common', 'tv', 'kiosk'], diff --git a/deps/node/node.gyp b/deps/node/node.gyp index 107f4f7c72..602e55d384 100644 --- a/deps/node/node.gyp +++ b/deps/node/node.gyp @@ -1,5 +1,6 @@ { 'variables': { + 'enable_aul%': 'false', 'v8_use_siphash%': 0, 'v8_trace_maps%': 0, 'v8_enable_pointer_compression%': 0, @@ -800,8 +801,17 @@ ['target_os=="tizen"', { 'dependencies': [ '<(lwnode_jsengine_path)/deps/tizen.gyp:dlog', - '<(lwnode_jsengine_path)/deps/tizen.gyp:appcommon', ], + 'conditions': [ + ['enable_aul=="true"', { + 'dependencies': [ + '<(lwnode_jsengine_path)/deps/tizen.gyp:appcommon', + ], + 'defines': [ + 'LWNODE_TIZEN_AUL=1', + ] + }], + ] }], ['external_builtins=="true"', { 'variables': { diff --git a/deps/node/src/lwnode/aul-event-receiver.cc b/deps/node/src/lwnode/aul-event-receiver.cc index 7ecb5e5c63..2d59b6a796 100644 --- a/deps/node/src/lwnode/aul-event-receiver.cc +++ b/deps/node/src/lwnode/aul-event-receiver.cc @@ -22,7 +22,7 @@ #include "lwnode.h" #include "trace.h" -#ifdef HOST_TIZEN +#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL) int AULEventReceiver::aulEventHandler(aul_type type, bundle* b, void* data) { switch (type) { diff --git a/deps/node/src/lwnode/aul-event-receiver.h b/deps/node/src/lwnode/aul-event-receiver.h index 897287bb56..2be8b11a51 100644 --- a/deps/node/src/lwnode/aul-event-receiver.h +++ b/deps/node/src/lwnode/aul-event-receiver.h @@ -14,7 +14,7 @@ * limitations under the License. */ -#ifdef HOST_TIZEN +#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL) #include #include #include @@ -27,7 +27,7 @@ class AULEventReceiver { public: static AULEventReceiver* getInstance(); -#ifdef HOST_TIZEN +#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL) static int aulEventHandler(aul_type type, bundle* b, void* data); bool hasAulArguments(int argc, char* argv[], std::string& parsed_bundle); bool start(int argc, char* argv[]); diff --git a/deps/node/src/lwnode/lwnode-public.cc b/deps/node/src/lwnode/lwnode-public.cc index 1c3bc456c3..f6c7339e45 100644 --- a/deps/node/src/lwnode/lwnode-public.cc +++ b/deps/node/src/lwnode/lwnode-public.cc @@ -34,15 +34,18 @@ bool ParseAULEvent(int argc, char** argv) { } bool InitScriptRootPath(const std::string path) { -#if defined(HOST_TIZEN) int result; + +#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL) if (path.empty()) { char* path = app_get_resource_path(); result = uv_chdir(path); free(path); - } else { - result = uv_chdir(path.c_str()); + return result == 0; } +#endif + + result = uv_chdir(path.c_str()); if (result != 0) { LWNODE_DEV_LOGF("ERROR: Failed to change directory. (%d)\n", -errno); @@ -51,9 +54,6 @@ bool InitScriptRootPath(const std::string path) { } return true; -#else - return false; -#endif } int Start(int argc, char** argv) { diff --git a/include/lwnode/lwnode-public.h b/include/lwnode/lwnode-public.h index f17727fb90..83b72850d4 100644 --- a/include/lwnode/lwnode-public.h +++ b/include/lwnode/lwnode-public.h @@ -26,10 +26,10 @@ namespace lwnode { LWNODE_EXPORT bool ParseAULEvent(int argc, char** argv); -// Support only Tizen platform. -// Sets the path of the root directory of the JavaScript. If you do not put the -// path argument, the root path is the app's resource path -// by default. Be sure to call this function before lwnode::Start function. +// Sets the path of the root directory of the JavaScript. If you do +// not put the path argument, the root path is the app's resource path by +// default on Tizen AUL mode. Be sure to call this function before lwnode::Start +// function. LWNODE_EXPORT bool InitScriptRootPath(const std::string path = ""); LWNODE_EXPORT int Start(int argc, char** argv); diff --git a/packaging/lwnode.spec b/packaging/lwnode.spec index dd37b5e9e8..a61a828b3a 100644 --- a/packaging/lwnode.spec +++ b/packaging/lwnode.spec @@ -38,11 +38,7 @@ BuildRequires: pkgconfig(glib-2.0) BuildRequires: nghttp2-devel BuildRequires: pkgconfig(libcares) -%if (0%{?tizen_version_major} >= 8) -BuildRequires: pkgconfig(openssl3) -%endif - -%if (0%{?tizen_version_major} == 7 || 0%{?tizen_version_major} == 6) +%if (0%{?tizen_version_major} >= 6) BuildRequires: pkgconfig(openssl1.1) %endif