[oe] [meta-oe][PATCH] smem: matplotlib is an optional depencency

nick83ola nick83ola at gmail.com
Wed Mar 11 11:48:27 UTC 2020


Hi Andre,
the problem is that if you put the package in RRECOMMENDS, yocto will
still build
python3-numpy and python3-matplotlib even if you add it to BAD_RECOMMENDATIONS

from https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#var-RRECOMMENDS
  The package manager will automatically install the RRECOMMENDS list
of packages when installing the built package.
  However, you can prevent listed packages from being installed by using the
  BAD_RECOMMENDATIONS, NO_RECOMMENDATIONS, and PACKAGE_EXCLUDE variables.

Note the "from being installed"

And on my particular machine (armv5) with musl the numpy build is broken
(no fpu, not supported for now, working on a fix for that but it
require more time)

Also I don't think is a good idea to build python-numpy (that is huge)
if the user is not using it...
on the smem web page it clearly states (https://www.selenic.com/smem)

 ->  the matplotlib library for chart generation (optional, auto-detected)

and in the code is doing exactly that

  def showbar(l, columns, sort):
      try:
          import pylab, numpy
      except ImportError:
          sys.stderr.write("bar chart requires matplotlib\n")
          sys.exit(-1)

so numpy and matplotlib are needed only if you want to use the

parser.add_option("", "--pie", type='str', help="show pie graph")
parser.add_option("", "--bar", type='str', help="show bar graph")

function

Another thing: there's a way to declare that a recipe needs a floating
point unit?

Cheers
Nick


On Wed, 11 Mar 2020 at 10:06, André Draszik <git at andred.net> wrote:
>
> On Wed, 2020-03-11 at 09:43 +0000, André Draszik wrote:
> > On Wed, 2020-03-11 at 07:55 +0000, Nicola Lunghi wrote:
> > > smem doesn't need matplotlib and numpy to run, is an optional dependency only
> > > needed to produce graphs.
> >
> > Right, that's why it's an RRECOMMENDS. If you don't want it in the image, just do
> > BAD_RECOMMENDATIONS as per usual practice :-)
>
> Also, smem really wants those to produce graphs. If you want something simple on
> the target to just capture the data, there is smemcap as a separate utility
> (and package).
>
> A.
>
> >
> > Cheers,
> > Andre'
> >
> > > This is needed to avoid to include and build matplotlib and numpy by default
> > >
> > > Signed-off-by: Nicola Lunghi <nick83ola at gmail.com>
> > > ---
> > >  meta-oe/recipes-support/smem/smem_1.5.bb | 4 +++-
> > >  1 file changed, 3 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/meta-oe/recipes-support/smem/smem_1.5.bb b/meta-oe/recipes-support/smem/smem_1.5.bb
> > > index 90db9c3f3..446325e93 100644
> > > --- a/meta-oe/recipes-support/smem/smem_1.5.bb
> > > +++ b/meta-oe/recipes-support/smem/smem_1.5.bb
> > > @@ -20,6 +20,9 @@ UPSTREAM_CHECK_REGEX = "(?P<pver>\d+(\.\d+)+)"
> > >
> > >  S = "${WORKDIR}/${BPN}-${HG_CHANGESET}"
> > >
> > > +#PACKAGECONFIG ?= "graph"
> > > +PACKAGECONFIG[graph] = ",,,python3-matplotlib python3-numpy"
> > > +
> > >  do_compile() {
> > >          ${CC} ${CFLAGS} ${LDFLAGS} smemcap.c -o smemcap
> > >  }
> > > @@ -34,7 +37,6 @@ do_install() {
> > >  }
> > >
> > >  RDEPENDS_${PN} = "python3-core python3-compression"
> > > -RRECOMMENDS_${PN} = "python3-matplotlib python3-numpy"
> > >
> > >  PACKAGE_BEFORE_PN = "smemcap"
> > >
> > > --
> > > 2.20.1
> > >
>
> --
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-devel


More information about the Openembedded-devel mailing list