Skip to content

Commit

Permalink
ose: enact-sandstone=r6
Browse files Browse the repository at this point in the history
:Release Notes:
Move sandstone from PRO layer to OSE layer

:Detailed Notes:
Move sandstone from PRO layer to OSE layer
Move sandstone related code from PRO layer to OSE layer

:Testing Performed:
Verf built and locally tested

:QA Notes:

:Issues Addressed:
[WRN-6874] Move sandstone from PRO layer to OSE layer
[WRN-8410] CCC: Move sandstone from PRO layer to OSE layer

Change-Id: Iaab04d02b91486f0bde103b0340a72db4927a87f
  • Loading branch information
hong6316 authored and Hyunjae Shin committed Oct 27, 2021
1 parent b6378bd commit 4714046
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 2 deletions.
15 changes: 13 additions & 2 deletions meta-webos/classes/webos_enactjs_app.bbclass
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ inherit webos_enactjs_env
# Dependencies:
# - ilib-webapp so we can override NPM ilib dependency with device submission
# - mksnapshot-cross to use the mksnapshot binary to build v8 app snapshot blobs
# - enact-framework to use a shared Enact framework libraries
# - enact-framework, enact-sandstone to use a shared Enact framework libraries
# - coreutils-native to use timeout utility to prevent frozen NPM processes
WEBOS_ENACTJS_APP_DEPENDS = "ilib-webapp mksnapshot-cross-${TARGET_ARCH} enact-framework coreutils-native"
WEBOS_ENACTJS_APP_DEPENDS = "ilib-webapp mksnapshot-cross-${TARGET_ARCH} enact-framework enact-sandstone coreutils-native"
DEPENDS_append = " ${WEBOS_ENACTJS_APP_DEPENDS}"

# chromium doesn't build for armv[45]*
Expand Down Expand Up @@ -111,6 +111,17 @@ do_compile() {

cp -f package.json package.json.bak

if [ -f ${S}/${WEBOS_ENACTJS_PROJECT_PATH}/package.json ] ; then
export ENACTJS_FRAMEWORK_VARIANT=$(${WEBOS_NODE_BIN} -e " \
try { \
const deps = require(process.argv[1]).dependencies || []; \
if (Object.keys(deps).includes('@enact/sandstone')) { \
console.log('-sandstone'); \
}
} catch(e) {} \
" ${S}/${WEBOS_ENACTJS_PROJECT_PATH}/package.json)
fi

# apply shrinkwrap override, rerouting to shared enact framework tarballs as needed
if [ "${WEBOS_ENACTJS_SHRINKWRAP_OVERRIDE}" = "true" ] ; then
bbnote "Attempting to use submission enact framework"
Expand Down
128 changes: 128 additions & 0 deletions meta-webos/recipes-webos/enactjs-apps/enact-sandstone.bb
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
# Copyright (c) 2020-2021 LG Electronics, Inc.

SUMMARY = "Enact Sandstone standard override used for Enact apps"
AUTHOR = "Jason Robitaille <[email protected]>"
SECTION = "webos/apps"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://enact/LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"

inherit webos_enact_repo
inherit webos_arch_indep
inherit webos_enactjs_env

S = "${WORKDIR}/git"

SRC_URI = " \
${ENACTJS_GIT_REPO}/sandstone.git;name=main;nobranch=1;destsuffix=git/sandstone \
${ENACTJS_GIT_REPO}/enact;name=enact;nobranch=1;destsuffix=git/enact \
"

# NOTE: PV is the Sandstone version (which uses the Semantic Versioning spec),
# with the hyphen converted to a tilde so that the dpkg-style version-comparison
# algorithm properly recognizes that a pre-release precedes the associated final
# release (e.g., 1.0-pre.1 < 1.0).

PV = "2.0.1"

SRCREV = "d82b4339adb6b89b060775fc12af0904c6eb8879"
SRCREV_enact = "e5c7a0c9d3b8d15321f5fff3c0d17bc0ae9a786e"

do_fetch[vardeps] += "SRCREV_enact"
SRCREV_FORMAT = "main_enact"

# Ordered dependency list for Sandstone; provides shrink-wrap style locking in of package versions
WEBOS_ENACT_DEPENDENCIES ??= "\
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
[email protected] \
"

# NOTE: We only need to bump PR if we change something OTHER than
# PV, SRCREV or the dependencies statement above.

PR = "r6"

# Skip unneeded tasks
do_configure[noexec] = "1"

do_compile() {
cd ${S}/sandstone
${ENACT_JSDOC_TO_TS}

for LIB in core ui spotlight i18n webos ; do
cd ${S}/enact/packages/$LIB
${ENACT_JSDOC_TO_TS}
done

cd ${S}

# cleanup any previous do_compile
rm -fr node_modules
rm -fr package

${WEBOS_NPM_BIN} pack --loglevel=error ./sandstone
${WEBOS_NPM_BIN} pack --loglevel=error ./enact/packages/core
${WEBOS_NPM_BIN} pack --loglevel=error ./enact/packages/ui
${WEBOS_NPM_BIN} pack --loglevel=error ./enact/packages/spotlight
${WEBOS_NPM_BIN} pack --loglevel=error ./enact/packages/i18n
${WEBOS_NPM_BIN} pack --loglevel=error ./enact/packages/webos
${WEBOS_NPM_BIN} pack --loglevel=error ${WEBOS_ENACT_DEPENDENCIES}

for ARCHIVE in $(find . -name "*.tgz") ; do
tar --warning=no-unknown-keyword -xzf ${ARCHIVE} package/package.json
PKG=$(${WEBOS_NODE_BIN} -p "require('./package/package.json').name")
mkdir -p node_modules/${PKG}
mv -f ${ARCHIVE} node_modules/${PKG}/package.tgz
done
rm -fr package
}

do_install() {
install -d ${D}${datadir}/javascript/enact-sandstone/@enact
cp -R --no-dereference --preserve=mode,links -v ${S}/node_modules/* ${D}${datadir}/javascript/enact-sandstone
}

sysroot_stage_all_append() {
# files don't get staged by default so we must force /opt to be staged
sysroot_stage_dir ${D}${datadir} ${SYSROOT_DESTDIR}${datadir}
}

FILES_${PN} += "${datadir}"

0 comments on commit 4714046

Please sign in to comment.