Discussion:
[yocto] Help with Nano Recipe
nick
2018-10-30 16:38:21 UTC
Permalink
Greetings All,
I am trying to get the below recipe to build:
SUMMARY = "Recipe to build the 'nano' editor"

PN = "nano"
PV = "2.2.6"
LICENSE="GPLv3"

SITE = "http://www.nano-editor.org/dist"
PV_MAJOR = "${@d.getVar('PV',d,1).split('.')[0]}"
PV_MINOR = "${@d.getVar('PV',d,1).split('.')[1]}"
LIC_FILES_CHKSUM = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"

SRC_URI = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/${PN}-${PV}.tar.gz"
SRC_URI[md5sum] = "03233ae480689a008eb98feb1b599807"
SRC_URI[sha256sum] = \
"be68e133b5e81df41873d32c517b3e5950770c00fc5f4dd23810cd635abce67a"
LIC_FILES_CHKSUM = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949


python do_fetch() {
bb.plain("Downloading source tarball from ${SRC_URI} ...")
src_uri = (d.getVar('SRC_URI', True) or "").split()
if len(src_uri) == 0:
bb.fatal("Empty URI")
try:
fetcher = bb.fetch2.Fetch(src_uri, d)
fetcher.download()
except bb.fetch2.BBFetchException:
bb.fatal("Could not fetch source tarball.")
bb.plain("Download successful.")
}

addtask fetch before do_build

python do_unpack() {
bb.plain("Unpacking source tarball ...")
os.system("tar x -C ${WORKDIR} -f ${DL_DIR}/${P}.tar.gz")
bb.plain("Unpacked source tarball.")
}

addtask unpack before do_build after do_fetch

python do_configure() {
bb.plain("Configuring source package ...")
os.system("cd ${WORKDIR}/${P} && ./configure")
bb.plain("Configured source package.")
}

addtask configure before do_build after do_unpack

python do_compile() {
bb.plain("Compiling package...")
os.system("cd ${WORKDIR}/${P} && make")
bb.plain("Compiled package.")
}

addtask compile before do_build after do_configure

do_clean[nostamp] = "1"
do_clean() {
rm -rf ${WORKDIR}/${P}
rm -f ${TMPDIR}/stamps/*
}

addtask clean

And am working why this error is occuring:
ERROR: ParseError at /tmp/bbhello/meta-hello/recipes-editor/nano/nano.bb:15: unparsed line: 'LIC_FILES_CHKSUM = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949'

I looked through the logs already and it was reported but only changed the file number seemed to change it. I am wondering if there is a better
solution or why that's a bad CHSUM variable according to bitbake.

Thanks,
Nick
--
Nicolas Dechesne
2018-10-30 17:59:42 UTC
Permalink
On Tue, Oct 30, 2018 at 5:38 PM nick <***@gmail.com> wrote:
>
> Greetings All,
> I am trying to get the below recipe to build:
> SUMMARY = "Recipe to build the 'nano' editor"
>
> PN = "nano"
> PV = "2.2.6"
> LICENSE="GPLv3"
>
> SITE = "http://www.nano-editor.org/dist"
> PV_MAJOR = "${@d.getVar('PV',d,1).split('.')[0]}"
> PV_MINOR = "${@d.getVar('PV',d,1).split('.')[1]}"
> LIC_FILES_CHKSUM = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949"
>
> SRC_URI = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/${PN}-${PV}.tar.gz"
> SRC_URI[md5sum] = "03233ae480689a008eb98feb1b599807"
> SRC_URI[sha256sum] = \
> "be68e133b5e81df41873d32c517b3e5950770c00fc5f4dd23810cd635abce67a"
> LIC_FILES_CHKSUM = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949

You are missing a quote at the end.

>
>
> python do_fetch() {
> bb.plain("Downloading source tarball from ${SRC_URI} ...")
> src_uri = (d.getVar('SRC_URI', True) or "").split()
> if len(src_uri) == 0:
> bb.fatal("Empty URI")
> try:
> fetcher = bb.fetch2.Fetch(src_uri, d)
> fetcher.download()
> except bb.fetch2.BBFetchException:
> bb.fatal("Could not fetch source tarball.")
> bb.plain("Download successful.")
> }

It is very unusual to implement a recipe this way , and you should
rely on base classes to do that for you. For reference there is a
recipe for 'nano' in meta-oe already.

http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/nano/nano_3.0.bb?h=master

>
> addtask fetch before do_build
>
> python do_unpack() {
> bb.plain("Unpacking source tarball ...")
> os.system("tar x -C ${WORKDIR} -f ${DL_DIR}/${P}.tar.gz")
> bb.plain("Unpacked source tarball.")
> }
>
> addtask unpack before do_build after do_fetch
>
> python do_configure() {
> bb.plain("Configuring source package ...")
> os.system("cd ${WORKDIR}/${P} && ./configure")
> bb.plain("Configured source package.")
> }
>
> addtask configure before do_build after do_unpack
>
> python do_compile() {
> bb.plain("Compiling package...")
> os.system("cd ${WORKDIR}/${P} && make")
> bb.plain("Compiled package.")
> }
>
> addtask compile before do_build after do_configure
>
> do_clean[nostamp] = "1"
> do_clean() {
> rm -rf ${WORKDIR}/${P}
> rm -f ${TMPDIR}/stamps/*
> }
>
> addtask clean
>
> And am working why this error is occuring:
> ERROR: ParseError at /tmp/bbhello/meta-hello/recipes-editor/nano/nano.bb:15: unparsed line: 'LIC_FILES_CHKSUM = "${SITE}/v${PV_MAJOR}.${PV_MINOR}/COPYING;md5=f27defe1e96c2e1ecd4e0c9be8967949'
>
> I looked through the logs already and it was reported but only changed the file number seemed to change it. I am wondering if there is a better
> solution or why that's a bad CHSUM variable according to bitbake.
>
> Thanks,
> Nick
> --
> _______________________________________________
> yocto mailing list
> ***@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
--
Kosta Zertsekel
2018-10-30 19:40:06 UTC
Permalink
> It is very unusual to implement a recipe this way , and you should
> rely on base classes to do that for you. For reference there is a
> recipe for 'nano' in meta-oe already.
> http://cgit.openembedded.org/meta-openembedded/tree/meta-oe/recipes-support/nano/nano_3.0.bb?h=master

And if you find anything amiss in this ``nano_3.0.bb`` recipe, you should have definitely begun with ``devtool``.
For example:
https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#using-devtool-in-your-sdk-workflow

--- Kosta Z.
--
Loading...