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. |
| 3 | |
| 4 | LICENSE = "Apache-2.0" |
| 5 | SRC_URI = "git://github.com/openbmc/phosphor-webui.git" |
| 6 | LIC_FILES_CHKSUM = "file://LICENSE;md5=e3fc50a88d0a364313df4b21ef20c29e" |
Andrew Geissler | 4bcd3ff | 2018-04-02 16:00:30 +0000 | [diff] [blame] | 7 | SRCREV = "7c3e8c1d0c24f499c7140b8df6ed8114597514c1" |
Ed Tanous | f8ce124 | 2017-11-02 12:58:57 -0700 | [diff] [blame] | 8 | S = "${WORKDIR}/git" |
| 9 | |
| 10 | DEPENDS_prepend = "nodejs-native " |
| 11 | |
| 12 | # allarch is required because the files this recipe produces (html and |
| 13 | # javascript) are valid for any target, regardless of architecture. The allarch |
| 14 | # class removes your compiler definitions, as it assumes that anything that |
| 15 | # requires a compiler is platform specific. Unfortunately, one of the build |
| 16 | # tools uses libsass for compiling the css templates, and it needs a compiler to |
| 17 | # build the library that it then uses to compress the scss into normal css. |
| 18 | # Enabling allarch, then re-adding the compiler flags was the best of the bad |
| 19 | # options |
| 20 | |
| 21 | inherit allarch |
| 22 | |
| 23 | export CXX = "${BUILD_CXX}" |
| 24 | export CC = "${BUILD_CC}" |
| 25 | export CFLAGS = "${BUILD_CFLAGS}" |
| 26 | export CPPFLAGS = "${BUILD_CPPFLAGS}" |
| 27 | export CXXFLAGS = "${BUILD_CXXFLAGS}" |
| 28 | |
| 29 | FILES_${PN} += "${datadir}/www/*" |
| 30 | |
| 31 | do_compile () { |
| 32 | cd ${S} |
| 33 | rm -rf node_modules |
| 34 | npm --loglevel info --proxy=${HTTP_PROXY} --https-proxy=${HTTPS_PROXY} install |
| 35 | npm run-script build |
| 36 | } |
| 37 | |
| 38 | do_install () { |
| 39 | # create directory structure |
| 40 | install -d ${D}${datadir}/www |
| 41 | cp -r ${S}/dist/** ${D}${datadir}/www |
| 42 | find ${D}${datadir}/www -type f -exec chmod a=r,u+w '{}' + |
| 43 | find ${D}${datadir}/www -type d -exec chmod a=rx,u+w '{}' + |
| 44 | } |
| 45 | |