diff options
author | Ed Tanous <ed.tanous@intel.com> | 2017-11-02 12:58:57 -0700 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2018-02-01 18:53:46 +0000 |
commit | 760881a097988bf6e7fc975ae4d656dfd66b257a (patch) | |
tree | 80613cfca5b9c17bce069fa5de52eae86811751f /meta-phosphor/common/recipes-phosphor/webui | |
parent | 7da6606471a12650f194bba63dccf6f449e1fbd0 (diff) | |
download | talos-openbmc-760881a097988bf6e7fc975ae4d656dfd66b257a.tar.gz talos-openbmc-760881a097988bf6e7fc975ae4d656dfd66b257a.zip |
Add recipes for building webui on target
This patchset adds the ability to build and package the phosphor-webui
and rest-dbus packages as static assets into the filesystem, for the
webserver to host.
Change-Id: I190eeb3172cbebe5b5ab8d895e5cc9b5647d739b
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-phosphor/common/recipes-phosphor/webui')
-rw-r--r-- | meta-phosphor/common/recipes-phosphor/webui/phosphor-webui.bb | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/meta-phosphor/common/recipes-phosphor/webui/phosphor-webui.bb b/meta-phosphor/common/recipes-phosphor/webui/phosphor-webui.bb new file mode 100644 index 000000000..68c6fcbc0 --- /dev/null +++ b/meta-phosphor/common/recipes-phosphor/webui/phosphor-webui.bb @@ -0,0 +1,45 @@ +# This recipe requires online access to build, as it uses NPM for dependency +# management and resolution. + +LICENSE = "Apache-2.0" +SRC_URI = "git://github.com/openbmc/phosphor-webui.git" +LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" +SRCREV = "bb9092a9c3b1812e5ccda800ce201d93c2ad6a6b" +S = "${WORKDIR}/git" + +DEPENDS_prepend = "nodejs-native " + +# allarch is required because the files this recipe produces (html and +# javascript) are valid for any target, regardless of architecture. The allarch +# class removes your compiler definitions, as it assumes that anything that +# requires a compiler is platform specific. Unfortunately, one of the build +# tools uses libsass for compiling the css templates, and it needs a compiler to +# build the library that it then uses to compress the scss into normal css. +# Enabling allarch, then re-adding the compiler flags was the best of the bad +# options + +inherit allarch + +export CXX = "${BUILD_CXX}" +export CC = "${BUILD_CC}" +export CFLAGS = "${BUILD_CFLAGS}" +export CPPFLAGS = "${BUILD_CPPFLAGS}" +export CXXFLAGS = "${BUILD_CXXFLAGS}" + +FILES_${PN} += "${datadir}/www/*" + +do_compile () { + cd ${S} + rm -rf node_modules + npm --loglevel info --proxy=${HTTP_PROXY} --https-proxy=${HTTPS_PROXY} install + npm run-script build +} + +do_install () { + # create directory structure + install -d ${D}${datadir}/www + cp -r ${S}/dist/** ${D}${datadir}/www + find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' + + find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' + +} + |