From: Youngsoo Choi Date: Mon, 21 Aug 2017 06:34:22 +0000 (+0900) Subject: Add scripts for launching electron on desktop X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bbbb7a18c50e44319307aa05bb82b9628db375e5;p=platform%2Fframework%2Fweb%2Fcrosswalk-tizen.git Add scripts for launching electron on desktop This adds scripts for launching electron on desktop. Change-Id: I91d9df8829049e435c391fcd1dff129e80834623 Signed-off-by: Youngsoo Choi --- diff --git a/efl/build/desktop/electron.sh b/efl/build/desktop/electron.sh new file mode 100755 index 0000000..9061e05 --- /dev/null +++ b/efl/build/desktop/electron.sh @@ -0,0 +1,4 @@ +#!/bin/sh + +SCRIPTDIR=$(readlink -e $(dirname $0)) +${SCRIPTDIR}/launch.sh electron "$@" diff --git a/efl/build/desktop/launch.sh b/efl/build/desktop/launch.sh new file mode 100755 index 0000000..5d041e9 --- /dev/null +++ b/efl/build/desktop/launch.sh @@ -0,0 +1,63 @@ +#!/bin/sh + +EXECUTABLE=$1 +MAIN_JS=$2 +CHROMIUM_EFL_PATH=$3 + +echo "CHROMIUM_EFL_PATH: $CHROMIUM_EFL_PATH" + +if [ ! $EXECUTABLE ]; then + echo launch_exec.sh takes the name of an executable argument >&2 + exit 1 +fi + +shift + +HOST_ARCH=$(uname -m) + +if [ $HOST_ARCH = "x86_64" -o $HOST_ARCH = "amd64" ]; then + _LIBDIR=lib64 +else + _LIBDIR=lib +fi + +SCRIPTDIR=$(readlink -e $(dirname $0)) +OUT_DIR=$(echo $SCRIPTDIR | grep -Po "(?<=/)out\..*?(?=/)") + +if echo $SCRIPTDIR | grep -qw "Debug"; then + BUILD_MODE=Debug +else + BUILD_MODE=Release +fi + +# [M56_2924] ELECTRON_EFL_LIBDIR should be fixed. +# ELECTRON_EFL_LIBDIR=$(readlink -e $SCRIPTDIR/lib) +ELECTRON_EFL_LIBDIR=$(readlink -e $SCRIPTDIR) +ELECTRON_EFL_DEPENDENCIES_LIBDIR=$(readlink -e $SCRIPTDIR/../Dependencies/Root/$_LIBDIR) +echo "ELECTRON_EFL_LIBDIR: $ELECTRON_EFL_LIBDIR" +echo "ELECTRON_EFL_DEPENDENCIES_LIBDIR: $ELECTRON_EFL_DEPENDENCIES_LIBDIR" + +export LD_LIBRARY_PATH=$ELECTRON_EFL_DEPENDENCIES_LIBDIR:$ELECTRON_EFL_LIBDIR:$CHROMIUM_EFL_PATH:${LD_LIBRARY_PATH} +echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" + +# Allow chromium-efl to work with llvmpipe or softpipe mesa backends +export EVAS_GL_NO_BLACKLIST=1 + +debug=0 +while [ $# -gt 0 ]; do + case "$1" in + -g | --debug ) + debug=1 + shift + ;; + * ) + break + ;; + esac +done + +if [ $debug -eq 1 ] ; then + exec gdb --args ${SCRIPTDIR}/$EXECUTABLE "$@" +else + exec ${SCRIPTDIR}/$EXECUTABLE "$MAIN_JS" +fi diff --git a/electron.gyp b/electron.gyp index 9fc0032..fa56224 100644 --- a/electron.gyp +++ b/electron.gyp @@ -363,6 +363,7 @@ '<(DEPTH)/efl/build/system.gyp:elementary', '<(DEPTH)/efl/build/system.gyp:evas', '<(DEPTH)/efl/build/system.gyp:icu', + 'electron_shell_copy', ], 'sources': [ 'chromium_src/chrome/browser/icon_loader_efllinux.cc', @@ -390,6 +391,19 @@ ], }, # target <(product_name)_lib { + 'target_name': 'electron_shell_copy', + 'type': 'none', + 'copies': [ + { + 'destination': '<(PRODUCT_DIR)', + 'files': [ + '<(DEPTH)/efl/build/desktop/electron.sh', + '<(DEPTH)/efl/build/desktop/launch.sh', + ], + }, + ], + }, # target atom_js2c_copy + { 'target_name': 'js2asar', 'type': 'none', 'actions': [