blob: ee1a023bee46eaff9c26aaffa8df4401ee3fda3c [file] [log] [blame]
Ed Tanousf8ce1242017-11-02 12:58:57 -07001# This recipe requires online access to build, as it uses NPM for dependency
2# management and resolution.
3
4LICENSE = "Apache-2.0"
5SRC_URI = "git://github.com/openbmc/phosphor-webui.git"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
Andrew Geissler447d6802018-05-15 08:50:06 -05007SRCREV = "0aeece60e8fbfaa25ae257f586932b6401cdbcd7"
Ed Tanousf8ce1242017-11-02 12:58:57 -07008S = "${WORKDIR}/git"
9
10DEPENDS_prepend = "nodejs-native "
11
12# allarch is required because the files this recipe produces (html and
13# javascript) are valid for any target, regardless of architecture. The allarch
14# class removes your compiler definitions, as it assumes that anything that
15# requires a compiler is platform specific. Unfortunately, one of the build
16# tools uses libsass for compiling the css templates, and it needs a compiler to
17# build the library that it then uses to compress the scss into normal css.
18# Enabling allarch, then re-adding the compiler flags was the best of the bad
19# options
20
21inherit allarch
22
23export CXX = "${BUILD_CXX}"
24export CC = "${BUILD_CC}"
25export CFLAGS = "${BUILD_CFLAGS}"
26export CPPFLAGS = "${BUILD_CPPFLAGS}"
27export CXXFLAGS = "${BUILD_CXXFLAGS}"
28
29FILES_${PN} += "${datadir}/www/*"
30
31do_compile () {
32 cd ${S}
33 rm -rf node_modules
34 npm --loglevel info --proxy=${HTTP_PROXY} --https-proxy=${HTTPS_PROXY} install
35 npm run-script build
36}
37
38do_install () {
39 # create directory structure
40 install -d ${D}${datadir}/www
41 cp -r ${S}/dist/** ${D}${datadir}/www
42 find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' +
43 find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' +
44}
45