Ed Tanous | f8ce124 | 2017-11-02 12:58:57 -0700 | [diff] [blame] | 1 | # This recipe requires online access to build, as it uses NPM for dependency |
| 2 | # management and resolution. |
Patrick Venture | fd8d54a | 2018-10-03 13:22:12 -0700 | [diff] [blame] | 3 | PR = "r1" |
| 4 | PV = "1.0+git${SRCPV}" |
Ed Tanous | f8ce124 | 2017-11-02 12:58:57 -0700 | [diff] [blame] | 5 | LICENSE = "Apache-2.0" |
Ed Tanous | f8ce124 | 2017-11-02 12:58:57 -0700 | [diff] [blame] | 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" |
Patrick Venture | fd8d54a | 2018-10-03 13:22:12 -0700 | [diff] [blame] | 7 | |
| 8 | SRC_URI = "git://github.com/openbmc/phosphor-webui.git" |
Andrew Geissler | 795209f | 2019-11-03 23:51:33 +0000 | [diff] [blame^] | 9 | SRCREV = "f6387628d22b525c20a16e4b928ceece0e03c92b" |
Ed Tanous | f8ce124 | 2017-11-02 12:58:57 -0700 | [diff] [blame] | 10 | S = "${WORKDIR}/git" |
| 11 | |
| 12 | DEPENDS_prepend = "nodejs-native " |
| 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 | |
| 31 | FILES_${PN} += "${datadir}/www/*" |
| 32 | |
| 33 | do_compile () { |
| 34 | cd ${S} |
| 35 | rm -rf node_modules |
Jeremy Kerr | 0a4689a | 2019-05-31 09:38:04 +0800 | [diff] [blame] | 36 | npm --loglevel info --proxy=${http_proxy} --https-proxy=${https_proxy} install |
Ed Tanous | f8ce124 | 2017-11-02 12:58:57 -0700 | [diff] [blame] | 37 | npm run-script build |
| 38 | } |
| 39 | |
| 40 | do_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 | |