blob: 80d4d37c4a4425c56d844817a41b28fd09703c51 [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 Geissler17734652024-03-04 22:30:25 -060012SRCREV = "0b4c447d2c113179b99dc9fd29aed8dc4ac06498"
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
Patrick Williams3fc1d722024-01-05 15:17:12 -060024# Ideally this recipe would use npm.bbclass, but it doesn't. Since npm uses
25# python3, we need to inherit this to get the Yocto version of python3 instead
26# of the hosttools one.
27inherit python3native
28
Andrew Geissler2d866462023-09-25 10:58:58 -050029RDEPENDS:${PN}:append = " bmcweb"
30
Ed Tanous9936f862022-09-19 09:13:20 -070031EXTRA_OENPM ?= ""
32
Gunnar Mills584fe712020-01-24 13:35:33 -060033export CXX = "${BUILD_CXX}"
34export CC = "${BUILD_CC}"
35export CFLAGS = "${BUILD_CFLAGS}"
36export CPPFLAGS = "${BUILD_CPPFLAGS}"
37export CXXFLAGS = "${BUILD_CXXFLAGS}"
38
Ed Tanous9936f862022-09-19 09:13:20 -070039# Workaround
Jorge Cisneros14cef4e2022-02-15 21:01:20 +000040# Network access from task are disabled by default on Yocto 3.5
41# https://git.yoctoproject.org/poky/tree/documentation/migration-guides/migration-3.5.rst#n25
42do_compile[network] = "1"
Gunnar Mills584fe712020-01-24 13:35:33 -060043do_compile () {
44 cd ${S}
45 rm -rf node_modules
46 npm --loglevel info --proxy=${http_proxy} --https-proxy=${https_proxy} install
Abhishek Patel0b4f5492021-07-19 08:24:26 -050047 npm run build ${EXTRA_OENPM}
Gunnar Mills584fe712020-01-24 13:35:33 -060048}
Gunnar Mills584fe712020-01-24 13:35:33 -060049do_install () {
50 # create directory structure
51 install -d ${D}${datadir}/www
52 cp -r ${S}/dist/** ${D}${datadir}/www
53 find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' +
54 find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' +
55}
56
Ed Tanous9936f862022-09-19 09:13:20 -070057FILES:${PN} += "${datadir}/www/*"