Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add aul option #85

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')]
Expand Down Expand Up @@ -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'],
Expand Down
12 changes: 11 additions & 1 deletion deps/node/node.gyp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
'variables': {
'enable_aul%': 'false',
'v8_use_siphash%': 0,
'v8_trace_maps%': 0,
'v8_enable_pointer_compression%': 0,
Expand Down Expand Up @@ -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': {
Expand Down
2 changes: 1 addition & 1 deletion deps/node/src/lwnode/aul-event-receiver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions deps/node/src/lwnode/aul-event-receiver.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

#ifdef HOST_TIZEN
#if defined(HOST_TIZEN) && defined(LWNODE_TIZEN_AUL)
#include <app_common.h>
#include <aul.h>
#include <bundle.h>
Expand All @@ -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[]);
Expand Down
12 changes: 6 additions & 6 deletions deps/node/src/lwnode/lwnode-public.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -51,9 +54,6 @@ bool InitScriptRootPath(const std::string path) {
}

return true;
#else
return false;
#endif
}

int Start(int argc, char** argv) {
Expand Down
8 changes: 4 additions & 4 deletions include/lwnode/lwnode-public.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 1 addition & 5 deletions packaging/lwnode.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading