[oe] Question on writing perl lib .bb files

Frans Meulenbroeks fransmeulenbroeks at gmail.com
Sun Oct 10 11:39:14 UTC 2010


2010/10/10 J. L. <vwyodapink at gmail.com>:
> I am trying to add a few more perl libs into my build that dont exist
> and I have seen some that have dependences and others that dont. So I
> wrote one for Net::Whois::ARIN and tried without what CPAN says is the
> dependencies and it built correctly with no errors I installed the
> .ipk and went to try the build of a program I wanted to try on my
> overo and it no longer complains about it missing that. But why do
> some perl lib .bb use depends and not even all the depends that cpan
> lists and some list none even though according to CPAN they need them?

The recipes that do not have all the first level CPAN dependencies are
wrong and should be fixed.
If you see such a recipe please submit a patch.
There seem to be a few causes for this to happen:
- when creating the recipe the CPAN dependencies were not checked, but
only those that were needed were added.
- a recipe was moved to a newer version and dependencies change, but
where never added

The reasong things work for you is because either:
you already had the recipes that you needed on your system.
or the listed cpan dependencies were wrong (I'm fairly sure they cover
all what is needed, but I am less sure that they never mention things
that are not needed).

> I will post the .bb I wrote as well, thanks for any info on the
> correct way to do this as not sure if what I did is enough to properly
> get the lib for perl built
>
> DESCRIPTION = "Net::Whois::ARIN         whois arin "
> SECTION = "libs"
> LICENSE = "Perl"
That would be "Artistic|GPLv1"

> PR = "r1"

Start with r0
>
> DEPENDS += "libtest-mockmodule-perl scalar-util-perl libtest-exception-perl \
>            test-harness-perl test-more-perl libsub-uplevel-perl \
>            libmodule-build-perl carp-perl universal-isa-perl \
>            universal-can-perl io-socket-inet-perl "

Hm, I found that perl recipes need the native variant of the recipe to
be in staging. If you peek at other recipes you'll see they DEPENDS on
the -native variant and RDEPENDS on the non-native one.

Also you only need  libtest-mockmodule-perl-native in DEPENDS. This is
because e.g. the dependency on libtest-exception-perl is a dependency
of libtest-mockmodule-perl who will drag it in.
So you only need the direct dependencies, not the indirect ones.

And finally you do not need the core modules like  io-socket-inet-perl
in DEPENDS
There is a dependency on perl and perl will make sure these modules are there.
Note though that  io-socket-inet-perl needs to be in RDEPENDS_${PN}

While doing this noticed one more thing. You are using the
dependencies as they arre given for perl 15.12.1 but we are at version
5.10.1 (and the dependencies for that one are somewhat different)

Frans

PS: and please commit locally and submit a patch (use git format-patch
and git send-email)

>
> SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TC/TCAINE/Net-Whois-ARIN-${PV}.tar.gz"
>
> S = "${WORKDIR}/Net-Whois-ARIN-${PV}"
>
> inherit cpan
>
> BBCLASSEXTEND="native"
>
> SRC_URI[md5sum] = "a5aee39187c6272acd2a77e30847fdef"
> SRC_URI[sha256sum] =
> "d47a6720ff265674cbd918d866c73221be9916d81e1c30ccdb0d49e6b45110e8"
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel at lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>




More information about the Openembedded-devel mailing list