blob: 3fc20a4f8f3e6a723b1874f4a8c1a30b51e2656f [file] [log] [blame]
Gunnar Mills584fe712020-01-24 13:35:33 -06001# allarch is required because the files this recipe produces (html and
2# javascript) are valid for any target, regardless of architecture. The allarch
3# class removes your compiler definitions, as it assumes that anything that
4# requires a compiler is platform specific. Unfortunately, one of the build
5# tools uses libsass for compiling the css templates, and it needs a compiler to
6# build the library that it then uses to compress the scss into normal css.
7# Enabling allarch, then re-adding the compiler flags was the best of the bad
8# options
Ed Tanous9936f862022-09-19 09:13:20 -07009LICENSE = "Apache-2.0"
10LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e"
11DEPENDS:prepend = "nodejs-native "
Andrew Geisslerc75a9182022-09-26 10:21:22 -050012SRCREV = "112dbb266e659e252e42f2230ddb4a80a467da20"
Ed Tanous9936f862022-09-19 09:13:20 -070013PV = "1.0+git${SRCPV}"
14# This recipe requires online access to build, as it uses NPM for dependency
15# management and resolution.
16PR = "r1"
17
18SRC_URI = "git://github.com/openbmc/webui-vue.git;branch=master;protocol=https"
19
20S = "${WORKDIR}/git"
Gunnar Mills584fe712020-01-24 13:35:33 -060021
22inherit allarch
23
Ed Tanous9936f862022-09-19 09:13:20 -070024EXTRA_OENPM ?= ""
25
Gunnar Mills584fe712020-01-24 13:35:33 -060026export CXX = "${BUILD_CXX}"
27export CC = "${BUILD_CC}"
28export CFLAGS = "${BUILD_CFLAGS}"
29export CPPFLAGS = "${BUILD_CPPFLAGS}"
30export CXXFLAGS = "${BUILD_CXXFLAGS}"
31
Ed Tanous9936f862022-09-19 09:13:20 -070032# Workaround
Jorge Cisneros14cef4e2022-02-15 21:01:20 +000033# Network access from task are disabled by default on Yocto 3.5
34# https://git.yoctoproject.org/poky/tree/documentation/migration-guides/migration-3.5.rst#n25
35do_compile[network] = "1"
Gunnar Mills584fe712020-01-24 13:35:33 -060036do_compile () {
37 cd ${S}
38 rm -rf node_modules
39 npm --loglevel info --proxy=${http_proxy} --https-proxy=${https_proxy} install
Abhishek Patel0b4f5492021-07-19 08:24:26 -050040 npm run build ${EXTRA_OENPM}
Gunnar Mills584fe712020-01-24 13:35:33 -060041}
Gunnar Mills584fe712020-01-24 13:35:33 -060042do_install () {
43 # create directory structure
44 install -d ${D}${datadir}/www
45 cp -r ${S}/dist/** ${D}${datadir}/www
46 find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' +
47 find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' +
48}
49
Ed Tanous9936f862022-09-19 09:13:20 -070050FILES:${PN} += "${datadir}/www/*"