blob: ee0a386a30c1ce29c119ba1c48341c38340169ef [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
Patrick Williamsbb99d222022-01-24 15:55:09 -06008SRC_URI = "git://github.com/openbmc/webui-vue.git;branch=master;protocol=https"
Andrew Geisslera1a73af2022-07-28 11:01:07 -05009SRCREV = "d9566225f1c25b1892c332e0f3a16c1b5e4ba714"
Gunnar Mills584fe712020-01-24 13:35:33 -060010S = "${WORKDIR}/git"
11
Andrew Geisslerc91a61d2022-01-04 22:45:33 +000012DEPENDS:prepend = "nodejs-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
Patrick Williams12fc9392021-08-06 09:16:53 -050031FILES:${PN} += "${datadir}/www/*"
Gunnar Mills584fe712020-01-24 13:35:33 -060032
Abhishek Patel0b4f5492021-07-19 08:24:26 -050033EXTRA_OENPM ?= ""
34
Jorge Cisneros14cef4e2022-02-15 21:01:20 +000035# Workaround
36# Network access from task are disabled by default on Yocto 3.5
37# https://git.yoctoproject.org/poky/tree/documentation/migration-guides/migration-3.5.rst#n25
38do_compile[network] = "1"
39
Gunnar Mills584fe712020-01-24 13:35:33 -060040do_compile () {
41 cd ${S}
42 rm -rf node_modules
43 npm --loglevel info --proxy=${http_proxy} --https-proxy=${https_proxy} install
Abhishek Patel0b4f5492021-07-19 08:24:26 -050044 npm run build ${EXTRA_OENPM}
Gunnar Mills584fe712020-01-24 13:35:33 -060045}
46
47do_install () {
48 # create directory structure
49 install -d ${D}${datadir}/www
50 cp -r ${S}/dist/** ${D}${datadir}/www
51 find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' +
52 find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' +
53}
54