[yocto] node-serialport recipe help

Khem Raj raj.khem at gmail.com
Sun Mar 15 01:57:02 PDT 2015


On Sat, Mar 14, 2015 at 11:35 AM, Caio <caiortp at gmail.com> wrote:
> Hi folks!
>
> I'm writing a recipe to build the nodejs with node-serialport, but i'm
> having problem in the QA and in the do_package.
>
> This problem occurs when I try to copy all the npm packets to target path
> using the command "cp -r".
>
>      cp -r  ${S}/build/* ${D}${libdir}/node_modules/serialport/build/
>      cp -r  ${S}/node_modules/*  ${D}${libdir}/node_modules
>
> When I use the cp , the bitbake display the following message:
>
> WARNING: QA Issue: node-serialport requires /bin/bash, /bin/zsh, but no
> providers in its RDEPENDS [file-rdeps]
>
> I try to add RDEPENDS += "bash" but this is not enough, and the bitbake ask
> for the /bin/zsh and the zsh is blacklisted.
>
> *I'm not a "Yocto expert" so I need improve my recipes (there's some
> workarounds in my recipes)

These errors can be easily avoided by making more granular packaging.
Identify the scripts in the install tree which require bash and zsh
for interpreter, then add PACKAGES += "${PN}-bash ${PN}-zsh" which
defines two extra output packages. then add FILES_${PN}-zsh =
"/path/to/the/zsh/scripts/" and same for for another package. Then add
RDEPENDS_${PN}-zsh = "zsh" RDEPENDS_${PN}-bash = "bash"


>
> I'm using as model the Recipes from webOS :
> https://github.com/openwebos/meta-webos/tree/master/recipes-upstreamable/node-gyp
>
>
> node-serialport_git.bb
>
> SUMMARY = "node-serial is a Serial Port binding for Node.js"
> SECTION = "nodejs/module"
> LICENSE = "MIT"
> LIC_FILES_CHKSUM = "file://README.md;md5=b9a59a0fefe195d10be82cf7f0a99788"
>
> DEPENDS = "node-pre-gyp-native"
>
> PV = "1.6.1+gitr${SRCPV}"
>
> RDEPENDS = "bash"
>
> SRC_URI =
> "git://github.com/voodootikigod/node-serialport.git;branch=master;protocol=git"
> SRCREV = "94b7bdcc087b820e10913c483bab3e2c54d103f2"
> S = "${WORKDIR}/git"
>
>
> do_configure() {
>     export LD="${CXX}"
>     export GYP_DEFINES="sysroot=${STAGING_DIR_HOST}"
>     node-pre-gyp --target_arch=${TARGET_ARCH} --target_platform=linux
> configure
> }
>
> do_compile() {
>     export LD="${CXX}"
>     export GYP_DEFINES="sysroot=${STAGING_DIR_HOST}"
>     node-pre-gyp --target_arch=${TARGET_ARCH} --target_platform=linux  build
> }
>
> do_install() {
>
>     npm install --no-cache
>     install -d ${D}${libdir}/node_modules
>     install -d ${D}${libdir}/node_modules/serialport/
>     install -d ${D}${libdir}/node_modules/serialport/build
>     install -d ${D}${libdir}/node_modules/serialport/bin
>     install -d ${S}/build/Release/
> ${D}${libdir}/node_modules/serialport/build/
>     install -m 0664 ${S}/bin/serialportList.js
> ${D}${libdir}/node_modules/serialport/bin/
>     install -m 0664 ${S}/bin/serialportTerminal.js
> ${D}${libdir}/node_modules/serialport/bin/
>     install -m 0664 ${S}/package.json ${D}${libdir}/node_modules/serialport/
>     install -m 0664 ${S}/parsers.js   ${D}${libdir}/node_modules/serialport/
>     install -m 0664 ${S}/serialport.js
> ${D}${libdir}/node_modules/serialport/
> #problematic line if the cp lines are uncommented the bitbake displayed to
> add RDEPEND /bin/bash and /bin/zsh
>     cp -r  ${S}/build/* ${D}${libdir}/node_modules/serialport/build/
>     cp -r  ${S}/node_modules/*  ${D}${libdir}/node_modules
> }
>
>
> FILES_${PN} += "${libdir}/node_modules \
>         ${libdir}/node_modules/serialport \
>         ${libdir}/node_modules/serialport/build \
> "
>
> FILES_${PN}-dbg += "${libdir}/node_modules/.debug \
>         ${libdir}/node_modules/serialport/.debug \
>         ${libdir}/node_modules/serialport/build/.debug \
>         ${libdir/node_modules/serialport/build/Release/.debug \
> "
> #workaround to avoid QA's problems, must be fixed in the second round
> INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
> INHIBIT_PACKAGE_STRIP = "1"
>
>
> }
>
>
>
> node_pre-gyp-native.bb
>
> DESCRIPTION = "Node.js tool for easy binary deployment of C++ addons"
> HOMEPAGE = "https://github.com/mapbox/node-pre-gyp.git"
> LICENSE = "BSD"
> SECTION = "nodejs/module"
>
> LIC_FILES_CHKSUM = "file://LICENSE;md5=7e13c3cf883a44ebcc74a8f568c0f6fb"
>
> SRC_URI =
> "git://github.com/mapbox/node-pre-gyp.git;branch=master;protocol=git"
> SRCREV = "332b8b123e3aa91718fad763cf1fc11c4cfb49b7"
> DEPENDS = "nodejs-native node-gyp-native"
>
> S = "${WORKDIR}/git"
>
> inherit native
>
> do_install () {
>   #woraround to install the node-pre-gyp
>   npm install -g --force
> }
>
> If someone could help me I will be grateful.
> Thanks !
>
> Regards,
>
> --
> ----------------------------------------------
> Caio Pereira
>
> --
> _______________________________________________
> yocto mailing list
> yocto at yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>



More information about the yocto mailing list