blob: fc25b364409ad5101c6cad8f35a420bca046edbe [file] [log] [blame]
Gunnar Mills584fe712020-01-24 13:35:33 -06001# This recipe requires online access to build, as it uses NPM for dependency
2# management and resolution.
3PR = "r1"
4PV = "1.0+git${SRCPV}"
5LICENSE = "Apache-2.0"
6LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
7
8SRC_URI = "git://github.com/openbmc/webui-vue.git"
Andrew Geissler27cd1022021-07-22 19:51:38 +00009SRCREV = "30731f1e320fab026580471a2b8e164390c6507b"
Gunnar Mills584fe712020-01-24 13:35:33 -060010S = "${WORKDIR}/git"
11
Jason M. Bills28d31532021-04-15 13:52:23 -070012DEPENDS_prepend = "nodejs-native nlf-native "
Gunnar Mills584fe712020-01-24 13:35:33 -060013
14# allarch is required because the files this recipe produces (html and
15# javascript) are valid for any target, regardless of architecture. The allarch
16# class removes your compiler definitions, as it assumes that anything that
17# requires a compiler is platform specific. Unfortunately, one of the build
18# tools uses libsass for compiling the css templates, and it needs a compiler to
19# build the library that it then uses to compress the scss into normal css.
20# Enabling allarch, then re-adding the compiler flags was the best of the bad
21# options
22
23inherit allarch
24
25export CXX = "${BUILD_CXX}"
26export CC = "${BUILD_CC}"
27export CFLAGS = "${BUILD_CFLAGS}"
28export CPPFLAGS = "${BUILD_CPPFLAGS}"
29export CXXFLAGS = "${BUILD_CXXFLAGS}"
30
31FILES_${PN} += "${datadir}/www/*"
32
33do_compile () {
34 cd ${S}
35 rm -rf node_modules
36 npm --loglevel info --proxy=${http_proxy} --https-proxy=${https_proxy} install
37 npm run build
38}
39
40do_install () {
41 # create directory structure
42 install -d ${D}${datadir}/www
43 cp -r ${S}/dist/** ${D}${datadir}/www
44 find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' +
45 find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' +
46}
47
Jason M. Bills28d31532021-04-15 13:52:23 -070048do_find_node_licenses() {
49 cd ${S}
50 nlf -s detail > ${LICENSE_DIRECTORY}/${PN}/node-licenses
51}
52
53addtask find_node_licenses after do_compile before do_build