Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [pkg-perl infra V7 2/6] scancpan: a new script
Date: Tue, 11 Feb 2014 18:49:00 +0100	[thread overview]
Message-ID: <52FA628C.8030307@mind.be> (raw)
In-Reply-To: <1392116205-12810-3-git-send-email-francois.perrad@gadz.org>

On 11/02/14 11:56, Francois Perrad wrote:
> which creates Perl/CPAN package files
> 
> The 2 dependencies will be installed by the Perl infrastructure.
> 
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
>  .../perl-metacpan-api-tiny.mk                      |   12 +
>  .../perl-module-corelist/perl-module-corelist.mk   |   13 ++
>  support/scripts/scancpan                           |  229 ++++++++++++++++++++
>  3 files changed, 254 insertions(+)
>  create mode 100644 package/perl-metacpan-api-tiny/perl-metacpan-api-tiny.mk
>  create mode 100644 package/perl-module-corelist/perl-module-corelist.mk
>  create mode 100755 support/scripts/scancpan
> 
> diff --git a/package/perl-metacpan-api-tiny/perl-metacpan-api-tiny.mk b/package/perl-metacpan-api-tiny/perl-metacpan-api-tiny.mk
> new file mode 100644
> index 0000000..c94835e
> --- /dev/null
> +++ b/package/perl-metacpan-api-tiny/perl-metacpan-api-tiny.mk
> @@ -0,0 +1,12 @@
> +################################################################################
> +#
> +# perl-metacpan-api-tiny
> +#
> +################################################################################
> +
> +PERL_METACPAN_API_TINY_VERSION = 1.131730
> +PERL_METACPAN_API_TINY_SOURCE = MetaCPAN-API-Tiny-$(PERL_METACPAN_API_TINY_VERSION).tar.gz
> +PERL_METACPAN_API_TINY_SITE = $(BR2_CPAN_MIRROR)/authors/id/N/NP/NPEREZ/
> +PERL_METACPAN_API_TINY_LICENSE = Artistic or GPLv1+
> +
> +$(eval $(host-perl-package))

 Wow, that's not what I meant when I said it was a pity that the metacpan
source was in the same file... This way, it is very difficult to run the
scancpan script because you first have to explicitly build this
host-package, and then you have to run scancpan with the PERL5LIB
pointing to the host dir.

 So please revert to the fatpacked version.


[snip]
> +sub fetch {
> +    my $name = shift;
> +    unless ($dist{$name}) {
> +        say qq{fetch ${name}} unless $quiet;
> +        my $result = $mcpan->release( distribution => $name );
> +        $dist{$name} = $result;
> +        my @deps_build = ();
> +        my @deps_runtime = ();
> +        my $mb;
> +        foreach my $dep (@{$result->{dependency}}) {
> +            my $modname = ${$dep}{module};
> +            $mb = 1 if $modname eq q{Module::Build};
> +            next if $modname eq q{perl};
> +            next if $modname =~ m|^Alien|;
> +            next if $modname =~ m|^Win32|;
> +            next if Module::CoreList::is_core( $modname, undef, q{5.018002} );

 This is good for the target packages, but for host packages the problem
still remains: if the host perl is older than this, some of the modules
we depend on may not exist on the host.

 That's why I propose to:

- add a check for a minimum perl version in dependencies.sh;

- in scancpan, make a distinction between host and target packages to be
generated, and generate the host packages if it is not core in the older
perl version.

 However, scancpan is already useful as it is, so I think it can be
committed as is (with the fatpacking and Thomas's typo corrections) and
this host support can be added later.

> +            next if ${$dep}{phase} eq q{develop};
> +            next if ${$dep}{phase} eq q{test};
> +            next if !$recommend && ${$dep}{relationship} ne q{requires};
> +            my $distname = $mcpan->module( $modname )->{distribution};
> +            if (${$dep}{phase} eq q{runtime}) {
> +                push @deps_runtime, $distname;
> +            }
> +            else { # configure, build
> +                push @deps_build, $distname;
> +            }
> +            fetch( $distname );
> +        }
> +        unshift @deps_build, q{Module-Build} if $mb;
> +        $deps_build{$name} = \@deps_build;
> +        $deps_runtime{$name} = \@deps_runtime;
> +    }
> +    return;
> +}
[snip]
> +=head1 LICENSE
> +
> +Copyright (C) 2013-2014 by Francois Perrad <francois.perrad@gadz.org>
> +
> +This program is free software; you can redistribute it and/or modify
> +it under the terms of the GNU General Public License as published by
> +the Free Software Foundation; either version 2 of the License, or
> +(at your option) any later version.
> +
> +This program is distributed in the hope that it will be useful,
> +but WITHOUT ANY WARRANTY; without even the implied warranty of
> +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +General Public License for more details.
> +
> +You should have received a copy of the GNU General Public License
> +along with this program; if not, write to the Free Software
> +Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

 When fatpacking, the fatpacked licenses should be mentioned again of course.

 Regards,
 Arnout

> +
> +=cut
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

  parent reply	other threads:[~2014-02-11 17:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11 10:56 [Buildroot] [pkg-perl infra V7 0/6] a package infrastructure for Perl/CPAN modules Francois Perrad
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 1/6] pkg-perl: new infrastructure Francois Perrad
2014-02-11 11:40   ` Thomas De Schampheleire
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 2/6] scancpan: a new script Francois Perrad
2014-02-11 11:56   ` Thomas De Schampheleire
2014-02-11 17:49   ` Arnout Vandecappelle [this message]
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 3/6] host-perl-xml-parser: rename and refactor with perl infrastructure Francois Perrad
2014-02-11 12:00   ` Thomas De Schampheleire
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 4/6] host-perl-module-build: new package Francois Perrad
2014-02-11 12:04   ` Thomas De Schampheleire
2014-02-11 17:02     ` François Perrad
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 5/6] manual: adding packages perl Francois Perrad
2014-02-11 12:08   ` Thomas De Schampheleire
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 6/6] perl: remove PERL_INSTALL_TARGET_GOALS Francois Perrad
2014-02-11 12:09   ` Thomas De Schampheleire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52FA628C.8030307@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox