Gunnar Mills | 584fe71 | 2020-01-24 13:35:33 -0600 | [diff] [blame] | 1 | # This recipe requires online access to build, as it uses NPM for dependency |
| 2 | # management and resolution. |
| 3 | PR = "r1" |
| 4 | PV = "1.0+git${SRCPV}" |
| 5 | LICENSE = "Apache-2.0" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" |
| 7 | |
| 8 | SRC_URI = "git://github.com/openbmc/webui-vue.git" |
Andrew Geissler | b47a431 | 2022-01-18 19:10:13 +0000 | [diff] [blame] | 9 | SRCREV = "99706ff21354cfe4550b91f8b5951d36d6a31ccb" |
Gunnar Mills | 584fe71 | 2020-01-24 13:35:33 -0600 | [diff] [blame] | 10 | S = "${WORKDIR}/git" |
| 11 | |
Andrew Geissler | c91a61d | 2022-01-04 22:45:33 +0000 | [diff] [blame^] | 12 | DEPENDS:prepend = "nodejs-native " |
Gunnar Mills | 584fe71 | 2020-01-24 13:35:33 -0600 | [diff] [blame] | 13 | |
| 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 | |
| 23 | inherit allarch |
| 24 | |
| 25 | export CXX = "${BUILD_CXX}" |
| 26 | export CC = "${BUILD_CC}" |
| 27 | export CFLAGS = "${BUILD_CFLAGS}" |
| 28 | export CPPFLAGS = "${BUILD_CPPFLAGS}" |
| 29 | export CXXFLAGS = "${BUILD_CXXFLAGS}" |
| 30 | |
Patrick Williams | 12fc939 | 2021-08-06 09:16:53 -0500 | [diff] [blame] | 31 | FILES:${PN} += "${datadir}/www/*" |
Gunnar Mills | 584fe71 | 2020-01-24 13:35:33 -0600 | [diff] [blame] | 32 | |
Abhishek Patel | 0b4f549 | 2021-07-19 08:24:26 -0500 | [diff] [blame] | 33 | EXTRA_OENPM ?= "" |
| 34 | |
Gunnar Mills | 584fe71 | 2020-01-24 13:35:33 -0600 | [diff] [blame] | 35 | do_compile () { |
| 36 | cd ${S} |
| 37 | rm -rf node_modules |
| 38 | npm --loglevel info --proxy=${http_proxy} --https-proxy=${https_proxy} install |
Abhishek Patel | 0b4f549 | 2021-07-19 08:24:26 -0500 | [diff] [blame] | 39 | npm run build ${EXTRA_OENPM} |
Gunnar Mills | 584fe71 | 2020-01-24 13:35:33 -0600 | [diff] [blame] | 40 | } |
| 41 | |
| 42 | do_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 | |