blob: a55740146065890bd6874a1e64d16d2ee29ee3a7 [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 Geissler106c0e82018-04-09 15:00:24 +00007SRCREV = "83f0896ebefb6560dd975180f95456546e4304b0"
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