* [Buildroot] [pkg-perl infra V7 0/6] a package infrastructure for Perl/CPAN modules
@ 2014-02-11 10:56 Francois Perrad
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 1/6] pkg-perl: new infrastructure Francois Perrad
` (5 more replies)
0 siblings, 6 replies; 15+ messages in thread
From: Francois Perrad @ 2014-02-11 10:56 UTC (permalink / raw)
To: buildroot
delta V6 vs V7 :
- global
+ substitute 'perl_5' by 'Artistic or GPLv1+'
- scancpan
+ remove 'NO ABSTRACT'
+ check Module::CoreList::is_core with the target Perl version
+ add packages Module-CoreList and MetaCPAN-API-Tiny instead of use Fatpack
+ add GPL
delta V5 vs V6 :
- export PERL5LIB
- rename PKG_PERL_ARCHNAME to PERL_ARCHNAME
- remove $(2)_*_OPT (with empty default value)
- remove PERL_INSTALL_TARGET_GOALS
Francois Perrad (6):
pkg-perl: new infrastructure
scancpan: a new script
host-perl-xml-parser: rename and refactor with perl infrastructure
host-perl-module-build: new package
manual: adding packages perl
perl: remove PERL_INSTALL_TARGET_GOALS
Config.in | 10 +
docs/manual/adding-packages-perl.txt | 110 ++++++++++
docs/manual/adding-packages.txt | 2 +
package/Config.in | 1 -
package/Makefile.in | 4 +-
package/intltool/intltool.mk | 2 +-
package/libxml-parser-perl/Config.in | 10 -
package/libxml-parser-perl/libxml-parser-perl.mk | 35 ---
package/metacity/metacity.mk | 2 +-
.../perl-metacpan-api-tiny.mk | 12 +
package/perl-module-build/perl-module-build.mk | 12 +
.../perl-module-corelist/perl-module-corelist.mk | 13 ++
package/perl-xml-parser/perl-xml-parser.mk | 17 ++
package/perl/perl.mk | 4 +-
package/pkg-perl.mk | 181 ++++++++++++++++
support/scripts/scancpan | 229 ++++++++++++++++++++
16 files changed, 592 insertions(+), 52 deletions(-)
create mode 100644 docs/manual/adding-packages-perl.txt
delete mode 100644 package/libxml-parser-perl/Config.in
delete mode 100644 package/libxml-parser-perl/libxml-parser-perl.mk
create mode 100644 package/perl-metacpan-api-tiny/perl-metacpan-api-tiny.mk
create mode 100644 package/perl-module-build/perl-module-build.mk
create mode 100644 package/perl-module-corelist/perl-module-corelist.mk
create mode 100644 package/perl-xml-parser/perl-xml-parser.mk
create mode 100644 package/pkg-perl.mk
create mode 100755 support/scripts/scancpan
--
1.7.9.5
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 1/6] pkg-perl: new infrastructure
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 ` 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
` (4 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Francois Perrad @ 2014-02-11 10:56 UTC (permalink / raw)
To: buildroot
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
Config.in | 10 +++
package/Makefile.in | 4 +-
package/pkg-perl.mk | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 194 insertions(+), 1 deletion(-)
create mode 100644 package/pkg-perl.mk
diff --git a/Config.in b/Config.in
index bcfefc7..be3e202 100644
--- a/Config.in
+++ b/Config.in
@@ -225,6 +225,16 @@ config BR2_LUAROCKS_MIRROR
See http://luarocks.org
+config BR2_CPAN_MIRROR
+ string "CPAN mirror"
+ default "http://search.cpan.org/CPAN"
+ help
+ CPAN has multiple software mirrors scattered around the world.
+ This option allows you to select a mirror.
+
+ The list of mirrors is available at:
+ http://search.cpan.org/mirror
+
endmenu
config BR2_JLEVEL
diff --git a/package/Makefile.in b/package/Makefile.in
index eea7043..454f614 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -206,7 +206,8 @@ HOST_PATH=$(HOST_DIR)/bin:$(HOST_DIR)/usr/bin:$(PATH)
HOSTCC_VERSION:=$(shell $(HOSTCC_NOCCACHE) --version | \
sed -n 's/^.* \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)[ ]*.*$$/\1\2\3/p')
-export PERL5LIB := $(HOST_DIR)/usr/lib/perl
+HOST_PERL_ARCHNAME := $(shell perl -MConfig -e "print Config->{archname}")
+export PERL5LIB := $(HOST_DIR)/usr/lib/perl5/$(HOST_PERL_ARCHNAME):$(HOST_DIR)/usr/lib/perl5
TARGET_CONFIGURE_OPTS=PATH=$(TARGET_PATH) \
AR="$(TARGET_AR)" \
@@ -359,5 +360,6 @@ include package/pkg-download.mk
include package/pkg-autotools.mk
include package/pkg-cmake.mk
include package/pkg-luarocks.mk
+include package/pkg-perl.mk
include package/pkg-python.mk
include package/pkg-generic.mk
diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
new file mode 100644
index 0000000..fdf1580
--- /dev/null
+++ b/package/pkg-perl.mk
@@ -0,0 +1,181 @@
+################################################################################
+# Perl package infrastructure
+#
+# This file implements an infrastructure that eases development of
+# package .mk files for Perl packages.
+#
+# See the Buildroot documentation for details on the usage of this
+# infrastructure
+#
+# In terms of implementation, this perl infrastructure requires
+# the .mk file to only specify metadata information about the
+# package: name, version, download URL, etc.
+#
+# We still allow the package .mk file to override what the different
+# steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is
+# already defined, it is used as the list of commands to perform to
+# build the package, instead of the default perl behaviour. The
+# package can also define some post operation hooks.
+#
+################################################################################
+
+PERL_ARCHNAME = $(ARCH)-linux
+
+################################################################################
+# inner-perl-package -- defines how the configuration, compilation and
+# installation of a perl package should be done, implements a
+# few hooks to tune the build process for perl specifities and
+# calls the generic package infrastructure to generate the necessary
+# make targets
+#
+# argument 1 is the lowercase package name
+# argument 2 is the uppercase package name, including an HOST_ prefix
+# for host packages
+# argument 3 is the uppercase package name, without the HOST_ prefix
+# for host packages
+# argument 4 is the type (target or host)
+################################################################################
+
+define inner-perl-package
+
+#
+# Configure step. Only define it if not already defined by the package
+# .mk file. And take care of the differences between host and target
+# packages.
+#
+ifndef $(2)_CONFIGURE_CMDS
+ifeq ($(4),target)
+
+# Configure package for target
+define $(2)_CONFIGURE_CMDS
+ cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+ perl Build.PL \
+ --config ar="$(TARGET_AR)" \
+ --config full_ar="$(TARGET_AR)" \
+ --config cc="$(TARGET_CC)" \
+ --config ccflags="$(TARGET_CFLAGS)" \
+ --config ld="$(TARGET_CC)" \
+ --config lddlflags="-shared $(TARGET_LDFLAGS)" \
+ --config ldflags="$(TARGET_LDFLAGS)" \
+ --include_dirs $$(STAGING_DIR)/usr/lib/perl5/$$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE \
+ --destdir $$(TARGET_DIR) \
+ --installdirs vendor \
+ --install_path lib=/usr/lib/perl5/site_perl/$$(PERL_VERSION) \
+ --install_path arch=/usr/lib/perl5/site_perl/$$(PERL_VERSION)/$(PERL_ARCHNAME) \
+ --install_path bin=/usr/bin \
+ --install_path script=/usr/bin \
+ --install_path bindoc=/usr/share/man/man1 \
+ --install_path libdoc=/usr/share/man/man3 \
+ $$($(2)_CONF_OPT); \
+ else \
+ PERL_AUTOINSTALL=--skipdeps \
+ perl Makefile.PL \
+ AR="$(TARGET_AR)" \
+ FULL_AR="$(TARGET_AR)" \
+ CC="$(TARGET_CC)" \
+ CCFLAGS="$(TARGET_CFLAGS)" \
+ LD="$(TARGET_CC)" \
+ LDDLFLAGS="-shared $(TARGET_LDFLAGS)" \
+ LDFLAGS="$(TARGET_LDFLAGS)" \
+ DESTDIR=$$(TARGET_DIR) \
+ INSTALLDIRS=vendor \
+ INSTALLVENDORLIB=/usr/lib/perl5/site_perl/$$(PERL_VERSION) \
+ INSTALLVENDORARCH=/usr/lib/perl5/site_perl/$$(PERL_VERSION)/$(PERL_ARCHNAME) \
+ INSTALLVENDORBIN=/usr/bin \
+ INSTALLVENDORSCRIPT=/usr/bin \
+ INSTALLVENDORMAN1DIR=/usr/share/man/man1 \
+ INSTALLVENDORMAN3DIR=/usr/share/man/man3 \
+ $$($(2)_CONF_OPT); \
+ fi
+endef
+else
+
+# Configure package for host
+define $(2)_CONFIGURE_CMDS
+ cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+ perl Build.PL \
+ --install_base $$(HOST_DIR)/usr \
+ --installdirs vendor \
+ $$($(2)_CONF_OPT); \
+ else \
+ PERL_AUTOINSTALL=--skipdeps \
+ perl Makefile.PL \
+ INSTALL_BASE=$$(HOST_DIR)/usr \
+ INSTALLDIRS=vendor \
+ $$($(2)_CONF_OPT); \
+ fi
+endef
+endif
+endif
+
+#
+# Build step. Only define it if not already defined by the package .mk
+# file. And take care of the differences between host and target
+# packages.
+#
+ifndef $(2)_BUILD_CMDS
+ifeq ($(4),target)
+
+# Build package for target
+define $(2)_BUILD_CMDS
+ cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+ perl Build $$($(2)_BUILD_OPT) build; \
+ else \
+ $(MAKE1) \
+ PERL_INC=$$(STAGING_DIR)/usr/lib/perl5/$$(PERL_VERSION)/$(PERL_ARCHNAME)/CORE \
+ $$($(2)_BUILD_OPT) pure_all; \
+ fi
+endef
+else
+
+# Build package for host
+define $(2)_BUILD_CMDS
+ cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+ perl Build $$($(2)_BUILD_OPT) build; \
+ else \
+ $(MAKE1) $$($(2)_BUILD_OPT) pure_all; \
+ fi
+endef
+endif
+endif
+
+#
+# Host installation step. Only define it if not already defined by the
+# package .mk file.
+#
+ifndef $(2)_INSTALL_CMDS
+define $(2)_INSTALL_CMDS
+ cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+ perl Build $$($(2)_INSTALL_TARGET_OPT) install; \
+ else \
+ $(MAKE1) $$($(2)_INSTALL_TARGET_OPT) pure_install; \
+ fi
+endef
+endif
+
+#
+# Target installation step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_INSTALL_TARGET_CMDS
+define $(2)_INSTALL_TARGET_CMDS
+ cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+ perl Build $$($(2)_INSTALL_TARGET_OPT) install; \
+ else \
+ $(MAKE1) $$($(2)_INSTALL_TARGET_OPT) pure_install; \
+ fi
+endef
+endif
+
+# Call the generic package infrastructure to generate the necessary
+# make targets
+$(call inner-generic-package,$(1),$(2),$(3),$(4))
+
+endef
+
+################################################################################
+# perl-package -- the target generator macro for Perl packages
+################################################################################
+
+perl-package = $(call inner-perl-package,$(pkgname),$(call UPPERCASE,$(pkgname)),$(call UPPERCASE,$(pkgname)),target)
+host-perl-package = $(call inner-perl-package,host-$(pkgname),$(call UPPERCASE,host-$(pkgname)),$(call UPPERCASE,$(pkgname)),host)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 2/6] scancpan: a new script
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 10:56 ` Francois Perrad
2014-02-11 11:56 ` Thomas De Schampheleire
2014-02-11 17:49 ` Arnout Vandecappelle
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 3/6] host-perl-xml-parser: rename and refactor with perl infrastructure Francois Perrad
` (3 subsequent siblings)
5 siblings, 2 replies; 15+ messages in thread
From: Francois Perrad @ 2014-02-11 10:56 UTC (permalink / raw)
To: buildroot
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))
diff --git a/package/perl-module-corelist/perl-module-corelist.mk b/package/perl-module-corelist/perl-module-corelist.mk
new file mode 100644
index 0000000..c0f773b
--- /dev/null
+++ b/package/perl-module-corelist/perl-module-corelist.mk
@@ -0,0 +1,13 @@
+################################################################################
+#
+# perl-module-corelist
+#
+################################################################################
+
+# aligned with Perl 5.18.2
+PERL_MODULE_CORELIST_VERSION = 3.03
+PERL_MODULE_CORELIST_SOURCE = Module-CoreList-$(PERL_MODULE_CORELIST_VERSION).tar.gz
+PERL_MODULE_CORELIST_SITE = $(BR2_CPAN_MIRROR)/authors/id/B/BI/BINGOS/
+PERL_MODULE_CORELIST_LICENSE = Artistic or GPLv1+
+
+$(eval $(host-perl-package))
diff --git a/support/scripts/scancpan b/support/scripts/scancpan
new file mode 100755
index 0000000..63a8885
--- /dev/null
+++ b/support/scripts/scancpan
@@ -0,0 +1,229 @@
+#!/usr/bin/env perl
+
+use 5.010;
+use strict;
+use warnings;
+use Fatal qw(open close);
+
+use Getopt::Long;
+use Pod::Usage;
+use File::Basename;
+use Module::CoreList;
+use MetaCPAN::API::Tiny;
+
+my ($help, $man, $quiet, $force, $recommend);
+GetOptions( 'help|?' => \$help,
+ 'man' => \$man,
+ 'quiet|q' => \$quiet,
+ 'force|f' => \$force,
+ 'recommend' => \$recommend
+) or pod2usage(-exitval => 1);
+pod2usage(-exitval => 0) if $help;
+pod2usage(-exitval => 0, -verbose => 2) if $man;
+pod2usage(-exitval => 1) if scalar @ARGV == 0;
+
+my %dist;
+my %deps_build;
+my %deps_runtime;
+my $mcpan = MetaCPAN::API::Tiny->new();
+
+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} );
+ 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;
+}
+
+foreach my $distname (@ARGV) {
+ fetch( $distname );
+}
+say scalar keys %dist, q{ packages fetched.} unless $quiet;
+
+sub fsname {
+ my $name = shift;
+ return q{perl-} . lc $name;
+}
+
+sub brname {
+ my $name = shift;
+ $name =~ s|-|_|g;
+ return uc $name;
+}
+
+while (my ($distname, $dist) = each %dist) {
+ my $fsname = fsname( $distname );
+ my $dirname = q{package/} . $fsname;
+ my $cfgname = $dirname . q{/Config.in};
+ my $mkname = $dirname . q{/} . $fsname . q{.mk};
+ my $brname = brname( $fsname );
+ mkdir $dirname unless -d $dirname;
+ if ($force || !-f $cfgname) {
+ my $abstract = $dist->{abstract};
+ say qq{write ${cfgname}} unless $quiet;
+ open my $fh, q{>}, $cfgname;
+ say {$fh} qq{config BR2_PACKAGE_${brname}};
+ say {$fh} qq{\tbool "${fsname}"};
+ foreach my $dep (@{$deps_runtime{$distname}}) {
+ my $brdep = brname( fsname( $dep ) );
+ say {$fh} qq{\tselect BR2_PACKAGE_${brdep}};
+ }
+ say {$fh} qq{\thelp} if $abstract;
+ say {$fh} qq{\t ${abstract}} if $abstract;
+ say {$fh} qq{};
+ close $fh;
+ }
+ if ($force || !-f $mkname) {
+ my $version = $dist->{version};
+ my $site = dirname( $dist->{download_url} );
+ my($scheme, $auth, $path) = $dist->{download_url} =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)|;
+ my($filename, $directories, $suffix) = fileparse( $path, q{tar.gz}, q{tgz} );
+ my $dependencies = join q{ }, map( { q{host-} . fsname( $_ ); } @{$deps_build{$distname}} ),
+ map( { fsname( $_ ); } @{$deps_runtime{$distname}} );
+ my $host_dependencies = join q{ }, map { q{host-} . fsname( $_ ); } @{$deps_build{$distname}},
+ @{$deps_runtime{$distname}};
+ my $license = ref $dist->{license} eq 'ARRAY'
+ ? join q{ or }, @{$dist->{license}}
+ : $dist->{license};
+ $license = q{Artistic or GPLv1+} if $license eq q{perl_5};
+ say qq{write ${mkname}} unless $quiet;
+ open my $fh, q{>}, $mkname;
+ say {$fh} qq{################################################################################};
+ say {$fh} qq{#};
+ say {$fh} qq{# ${fsname}};
+ say {$fh} qq{#};
+ say {$fh} qq{################################################################################};
+ say {$fh} qq{};
+ say {$fh} qq{${brname}_VERSION = ${version}};
+ say {$fh} qq{${brname}_SOURCE = ${distname}-\$(${brname}_VERSION).${suffix}};
+ say {$fh} qq{${brname}_SITE = \$(BR2_CPAN_MIRROR)${directories}};
+ say {$fh} qq{${brname}_DEPENDENCIES = perl ${dependencies}};
+ say {$fh} qq{#HOST_${brname}_DEPENDENCIES = ${host_dependencies}};
+ say {$fh} qq{${brname}_LICENSE = ${license}} if $license && $license ne q{unknown};
+ say {$fh} qq{};
+ say {$fh} qq{\$(eval \$(perl-package))};
+ say {$fh} qq{#\$(eval \$(host-perl-package))};
+ close $fh;
+ }
+}
+
+my %pkg;
+my $cfgname = q{package/Config.in};
+if (-f $cfgname) {
+ open my $fh, q{<}, $cfgname;
+ while (<$fh>) {
+ chomp;
+ $pkg{$_} = 1 if m|package/perl-|;
+ }
+ close $fh;
+}
+
+foreach my $distname (sort keys %dist) {
+ my $fsname = fsname( $distname );
+ $pkg{qq{source "package/${fsname}/Config.in"}} = 1;
+}
+
+say qq{${cfgname} must contains the following lines:};
+say join qq{\n}, sort keys %pkg;
+
+__END__
+
+=head1 NAME
+
+support/scripts/scancpan Try-Tiny Moo
+
+=head1 SYNOPSIS
+
+make host-perl-metacpan-api-tiny host-perl-module-corelist # install dependencies
+
+export PERL5LIB=$(HOST_DIR)/usr/lib/perl5 # allows to find dependencies
+supports/scripts/scancpan [options] [distname ...]
+
+ Options:
+ -help
+ -man
+ -quiet
+ -force
+ -recommend
+
+=head1 OPTIONS
+
+=over 8
+
+=item B<-help>
+
+Print a brief help message and exits.
+
+=item B<-man>
+
+Prints the manual page and exits.
+
+=item B<-quiet>
+
+Executes without output
+
+=item B<-force>
+
+Forces the overwritting of existing files.
+
+=item B<-recommend>
+
+Adds I<recommended> dependencies.
+
+=back
+
+=head1 DESCRIPTION
+
+This script creates the BR package files for all Perl/CPAN
+distributions required by all distname. These data are fetched from
+https://metacpan.org/.
+
+See the Buildroot documentation for details on the usage of the Perl
+infrastructure.
+
+=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
+
+=cut
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 3/6] host-perl-xml-parser: rename and refactor with perl infrastructure
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 10:56 ` [Buildroot] [pkg-perl infra V7 2/6] scancpan: a new script Francois Perrad
@ 2014-02-11 10:56 ` 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
` (2 subsequent siblings)
5 siblings, 1 reply; 15+ messages in thread
From: Francois Perrad @ 2014-02-11 10:56 UTC (permalink / raw)
To: buildroot
Even though libxml-parser-perl had a Config.in file with an option to
enable it on the target, this option was hidden by a dependency on
BR2_HOST_ONLY. So in practice, it was not possible to enable
libxml-parser-perl on the target. This allows us to rename
libxml-parser-perl to perl-xml-parser to follow the new naming
convention of Perl packages, without having to introduce
Config.in.legacy material.
In addition to this rename, the package is converted to use the newly
introduced Perl package infrastructure.
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
package/Config.in | 1 -
package/intltool/intltool.mk | 2 +-
package/libxml-parser-perl/Config.in | 10 -------
package/libxml-parser-perl/libxml-parser-perl.mk | 35 ----------------------
package/metacity/metacity.mk | 2 +-
package/perl-xml-parser/perl-xml-parser.mk | 17 +++++++++++
6 files changed, 19 insertions(+), 48 deletions(-)
delete mode 100644 package/libxml-parser-perl/Config.in
delete mode 100644 package/libxml-parser-perl/libxml-parser-perl.mk
create mode 100644 package/perl-xml-parser/perl-xml-parser.mk
diff --git a/package/Config.in b/package/Config.in
index fca61d6..68b4870 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -616,7 +616,6 @@ source "package/json-c/Config.in"
source "package/json-glib/Config.in"
source "package/libjson/Config.in"
source "package/libroxml/Config.in"
-source "package/libxml-parser-perl/Config.in"
source "package/libxml2/Config.in"
source "package/libxmlpp/Config.in"
source "package/libxslt/Config.in"
diff --git a/package/intltool/intltool.mk b/package/intltool/intltool.mk
index 58b46e6..6b2a704 100644
--- a/package/intltool/intltool.mk
+++ b/package/intltool/intltool.mk
@@ -9,7 +9,7 @@ INTLTOOL_SITE = https://launchpad.net/intltool/trunk/$(INTLTOOL_VERSION)/+downlo
INTLTOOL_LICENSE = GPLv2+
INTLTOOL_LICENSE_FILES = COPYING
-HOST_INTLTOOL_DEPENDENCIES = host-gettext host-libxml-parser-perl
+HOST_INTLTOOL_DEPENDENCIES = host-gettext host-perl-xml-parser
$(eval $(autotools-package))
$(eval $(host-autotools-package))
diff --git a/package/libxml-parser-perl/Config.in b/package/libxml-parser-perl/Config.in
deleted file mode 100644
index bdda236..0000000
--- a/package/libxml-parser-perl/Config.in
+++ /dev/null
@@ -1,10 +0,0 @@
-config BR2_PACKAGE_LIBXML_PARSER_PERL
- bool "libxml-parser-perl"
- select BR2_PACKAGE_EXPAT
- # Hide from configuration as we only support the host package
- # for the moment
- depends on BR2_HOST_ONLY
- help
- The Perl XML::Parser module.
-
- http://www.cpan.org/modules/by-module/XML/
diff --git a/package/libxml-parser-perl/libxml-parser-perl.mk b/package/libxml-parser-perl/libxml-parser-perl.mk
deleted file mode 100644
index 53f3bcf..0000000
--- a/package/libxml-parser-perl/libxml-parser-perl.mk
+++ /dev/null
@@ -1,35 +0,0 @@
-################################################################################
-#
-# libxml-parser-perl
-#
-################################################################################
-
-LIBXML_PARSER_PERL_VERSION = 2.36
-LIBXML_PARSER_PERL_SOURCE = XML-Parser-$(LIBXML_PARSER_PERL_VERSION).tar.gz
-LIBXML_PARSER_PERL_SITE = http://www.cpan.org/modules/by-module/XML/
-
-LIBXML_PARSER_PERL_DEPENDENCIES = expat
-
-define HOST_LIBXML_PARSER_PERL_CONFIGURE_CMDS
- (cd $(@D) ; \
- $(HOST_CONFIGURE_OPTS) perl Makefile.PL \
- PREFIX=$(HOST_DIR)/usr \
- EXPATLIBPATH=$(HOST_DIR)/usr/lib \
- EXPATINCPATH=$(HOST_DIR)/usr/include \
- INSTALLDIRS=site \
- INSTALLSITELIB=$(HOST_DIR)/usr/lib/perl \
- INSTALLSITEARCH=$(HOST_DIR)/usr/lib/perl \
- USE_MM_LD_RUN_PATH=1 \
- )
-endef
-
-define HOST_LIBXML_PARSER_PERL_BUILD_CMDS
- $(HOST_MAKE_ENV) $(MAKE) -C $(@D)
-endef
-
-define HOST_LIBXML_PARSER_PERL_INSTALL_CMDS
- $(HOST_MAKE_ENV) $(MAKE) -C $(@D) install
-endef
-
-$(eval $(generic-package))
-$(eval $(host-generic-package))
diff --git a/package/metacity/metacity.mk b/package/metacity/metacity.mk
index 9306b00..18f5c76 100644
--- a/package/metacity/metacity.mk
+++ b/package/metacity/metacity.mk
@@ -19,7 +19,7 @@ METACITY_CONF_OPT = --x-includes=$(STAGING_DIR)/usr/include/X11 \
METACITY_DEPENDENCIES = libgtk2 \
xlib_libX11 \
- host-libxml-parser-perl \
+ host-perl-xml-parser \
xlib_libXcomposite \
xlib_libXfixes \
xlib_libXrender \
diff --git a/package/perl-xml-parser/perl-xml-parser.mk b/package/perl-xml-parser/perl-xml-parser.mk
new file mode 100644
index 0000000..fb9bf0f
--- /dev/null
+++ b/package/perl-xml-parser/perl-xml-parser.mk
@@ -0,0 +1,17 @@
+################################################################################
+#
+# perl-xml-parser
+#
+################################################################################
+
+PERL_XML_PARSER_VERSION = 2.41
+PERL_XML_PARSER_SOURCE = XML-Parser-$(PERL_XML_PARSER_VERSION).tar.gz
+PERL_XML_PARSER_SITE = $(BR2_CPAN_MIRROR)/authors/id/T/TO/TODDR/
+PERL_XML_PARSER_DEPENDENCIES = expat
+PERL_XML_PARSER_LICENSE = Artistic or GPLv1+
+
+HOST_LIBXML_PARSER_PERL_CONF_OPT = \
+ EXPATLIBPATH=$(HOST_DIR)/usr/lib \
+ EXPATINCPATH=$(HOST_DIR)/usr/include
+
+$(eval $(host-perl-package))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 4/6] host-perl-module-build: new package
2014-02-11 10:56 [Buildroot] [pkg-perl infra V7 0/6] a package infrastructure for Perl/CPAN modules Francois Perrad
` (2 preceding siblings ...)
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 10:56 ` Francois Perrad
2014-02-11 12:04 ` Thomas De Schampheleire
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 5/6] manual: adding packages perl Francois Perrad
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 6/6] perl: remove PERL_INSTALL_TARGET_GOALS Francois Perrad
5 siblings, 1 reply; 15+ messages in thread
From: Francois Perrad @ 2014-02-11 10:56 UTC (permalink / raw)
To: buildroot
the version coming with host-perl is too old
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
package/perl-module-build/perl-module-build.mk | 12 ++++++++++++
1 file changed, 12 insertions(+)
create mode 100644 package/perl-module-build/perl-module-build.mk
diff --git a/package/perl-module-build/perl-module-build.mk b/package/perl-module-build/perl-module-build.mk
new file mode 100644
index 0000000..a95278d
--- /dev/null
+++ b/package/perl-module-build/perl-module-build.mk
@@ -0,0 +1,12 @@
+################################################################################
+#
+# perl-module-build
+#
+################################################################################
+
+PERL_MODULE_BUILD_VERSION = 0.4204
+PERL_MODULE_BUILD_SOURCE = Module-Build-$(PERL_MODULE_BUILD_VERSION).tar.gz
+PERL_MODULE_BUILD_SITE = $(BR2_CPAN_MIRROR)/authors/id/L/LE/LEONT/
+PERL_MODULE_BUILD_LICENSE = Artistic or GPLv1+
+
+$(eval $(host-perl-package))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 5/6] manual: adding packages perl
2014-02-11 10:56 [Buildroot] [pkg-perl infra V7 0/6] a package infrastructure for Perl/CPAN modules Francois Perrad
` (3 preceding siblings ...)
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 4/6] host-perl-module-build: new package Francois Perrad
@ 2014-02-11 10:56 ` 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
5 siblings, 1 reply; 15+ messages in thread
From: Francois Perrad @ 2014-02-11 10:56 UTC (permalink / raw)
To: buildroot
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
docs/manual/adding-packages-perl.txt | 110 ++++++++++++++++++++++++++++++++++
docs/manual/adding-packages.txt | 2 +
2 files changed, 112 insertions(+)
create mode 100644 docs/manual/adding-packages-perl.txt
diff --git a/docs/manual/adding-packages-perl.txt b/docs/manual/adding-packages-perl.txt
new file mode 100644
index 0000000..b272232
--- /dev/null
+++ b/docs/manual/adding-packages-perl.txt
@@ -0,0 +1,110 @@
+// -*- mode:doc; -*-
+// vim: set syntax=asciidoc:
+
+Infrastructure for Perl/CPAN packages
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+[[perl-package-tutorial]]
+
++perl-package+ tutorial
+^^^^^^^^^^^^^^^^^^^^^^^
+
+First, let's see how to write a +.mk+ file for a Perl/CPAN package,
+with an example :
+
+------------------------
+01: ################################################################################
+02: #
+03: # perl-foo-bar
+04: #
+05: ################################################################################
+06:
+07: PERL_FOO_BAR_VERSION = 0.02
+08: PERL_FOO_BAR_SOURCE = Foo-Bar-$(PERL_FOO_BAR_VERSION).tar.gz
+09: PERL_FOO_BAR_SITE = $(BR2_CPAN_MIRROR)/authors/id/M/MO/MONGER/
+10: PERL_FOO_BAR_DEPENDENCIES = perl-strictures
+11: PERL_FOO_BAR_LICENSE = Artistic or GPLv1+
+12: PERL_FOO_BAR_LICENSE_FILES = LICENSE
+13:
+14: $(eval $(perl-package))
+------------------------
+
+On line 7, we declare the version of the package.
+
+On line 8 and 9, we declare the name of the tarball and the location
+of the tarball on a CPAN server. Buildroot will automatically download
+the tarball from this location.
+
+On line 10, we declare our dependencies, so that they are built
+before the build process of our package starts.
+
+On line 11 and 12, we give licensing details about the package (its
+license on line 11, and the file containing the license text on line
+12).
+
+Finally, on line 14, we invoke the +perl-package+ macro that
+generates all the Makefile rules that actually allow the package to be
+built.
+
+Most of these data could be retrieved from https://metacpan.org/.
+So, this file and the Config.in could be generated by running
+the script +supports/scripts/scancpan Foo-Bar+ in the +TOPDIR+ directory
+(or in the +BR2_EXTERNAL+ directory).
+This script recursively creates packages for all required Perl/CPAN
+dependencies.
+
+[[perl-package-reference]]
+
++perl-package+ reference
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+As a policy, packages that provide Perl/CPAN modules should all be
+named +perl-<something>+ in Buildroot.
+
+This infrastructure handles various Perl build systems :
++ExtUtils-MakeMaker+, +Module-Build+ and +Module-Build-Tiny+.
++Build.PL+ is always prefered when a package provides a +Makefile.PL+
+and a +Build.PL+.
+
+The main macro of the Perl/CPAN package infrastructure is
++perl-package+. It is similar to the +generic-package+ macro. The ability to
+have target and host packages is also available, with the
++host-perl-package+ macro.
+
+Just like the generic infrastructure, the Perl/CPAN infrastructure
+works by defining a number of variables before calling the
++perl-package+ macro.
+
+First, all the package metadata information variables that exist in the
+generic infrastructure also exist in the Perl/CPAN infrastructure:
++PERL_FOO_VERSION+, +PERL_FOO_SOURCE+,
++PERL_FOO_PATCH+, +PERL_FOO_SITE+,
++PERL_FOO_SUBDIR+, +PERL_FOO_DEPENDENCIES+,
++PERL_FOO_INSTALL_TARGET+.
+
+Note that:
+
+ * Setting +PERL_FOO_INSTALL_STAGING+ to +YES+ has no effect (unless
+ a +PERL_FOO_INSTALL_STAGING_CMDS+ variable is defined), since
+ Perl modules generally don't need to be installed to the
+ +staging+ directory.
+
+A few additional variables, specific to the Perl/CPAN infrastructure,
+can also be defined. Many of them are only useful in very specific
+cases, typical packages will therefore only use a few of them.
+
+* +PERL_FOO_CONF_OPT+, to specify additional configure
+ options to pass to the +perl Makefile.PL+ or +perl Build.PL+.
+ By default, empty.
+
+* +PERL_FOO_BUILD_OPT+, to specify additional options to
+ pass to +make pure_all+ or +perl Build build+ in the build step.
+ By default, empty.
+
+* +PERL_FOO_INSTALL_TARGET_OPT+, to specify additional options to
+ pass to +make pure_install+ or +perl Build install+ in the install step.
+ By default, empty.
+
+* +HOST_PERL_FOO_INSTALL_OPT+, to specify additional options to
+ pass to +make pure_install+ or +perl Build install+ in the install step.
+ By default, empty.
diff --git a/docs/manual/adding-packages.txt b/docs/manual/adding-packages.txt
index cc86529..745e33a 100644
--- a/docs/manual/adding-packages.txt
+++ b/docs/manual/adding-packages.txt
@@ -22,6 +22,8 @@ include::adding-packages-python.txt[]
include::adding-packages-luarocks.txt[]
+include::adding-packages-perl.txt[]
+
include::adding-packages-hooks.txt[]
include::adding-packages-gettext.txt[]
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 6/6] perl: remove PERL_INSTALL_TARGET_GOALS
2014-02-11 10:56 [Buildroot] [pkg-perl infra V7 0/6] a package infrastructure for Perl/CPAN modules Francois Perrad
` (4 preceding siblings ...)
2014-02-11 10:56 ` [Buildroot] [pkg-perl infra V7 5/6] manual: adding packages perl Francois Perrad
@ 2014-02-11 10:56 ` Francois Perrad
2014-02-11 12:09 ` Thomas De Schampheleire
5 siblings, 1 reply; 15+ messages in thread
From: Francois Perrad @ 2014-02-11 10:56 UTC (permalink / raw)
To: buildroot
useless since previous commit (removal of BR2_HAVE_DOCUMENTATION)
see http://git.buildroot.net/buildroot/diff/package/perl/perl.mk?id=7164a32632d14cb83698ddec45e84ad2f3252e9e
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
package/perl/perl.mk | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/package/perl/perl.mk b/package/perl/perl.mk
index 5ede81b..51aeb14 100644
--- a/package/perl/perl.mk
+++ b/package/perl/perl.mk
@@ -90,10 +90,8 @@ define PERL_INSTALL_STAGING_CMDS
$(MAKE1) -C $(@D) DESTDIR="$(STAGING_DIR)" install.perl
endef
-PERL_INSTALL_TARGET_GOALS = install.perl
-
define PERL_INSTALL_TARGET_CMDS
- $(MAKE1) -C $(@D) DESTDIR="$(TARGET_DIR)" $(PERL_INSTALL_TARGET_GOALS)
+ $(MAKE1) -C $(@D) DESTDIR="$(TARGET_DIR)" install.perl
endef
$(eval $(generic-package))
--
1.7.9.5
^ permalink raw reply related [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 1/6] pkg-perl: new infrastructure
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
0 siblings, 0 replies; 15+ messages in thread
From: Thomas De Schampheleire @ 2014-02-11 11:40 UTC (permalink / raw)
To: buildroot
Hi Francois,
On Tue, Feb 11, 2014 at 11:56 AM, Francois Perrad <fperrad@gmail.com> wrote:
>
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
> Config.in | 10 +++
> package/Makefile.in | 4 +-
> package/pkg-perl.mk | 181 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 194 insertions(+), 1 deletion(-)
> create mode 100644 package/pkg-perl.mk
>
> diff --git a/Config.in b/Config.in
> index bcfefc7..be3e202 100644
> --- a/Config.in
> +++ b/Config.in
> @@ -225,6 +225,16 @@ config BR2_LUAROCKS_MIRROR
>
> See http://luarocks.org
>
> +config BR2_CPAN_MIRROR
> + string "CPAN mirror"
> + default "http://search.cpan.org/CPAN"
> + help
> + CPAN has multiple software mirrors scattered around the world.
> + This option allows you to select a mirror.
> +
> + The list of mirrors is available at:
> + http://search.cpan.org/mirror
> +
> endmenu
>
Did you see my comment about this config option, in V5 of your series?
For reference, here is what I said:
----------
For users not familiar with Perl, this option in a general buildroot
menu is confusing: "What the heck is CPAN?".
I would suggest to add a reference to Perl here, for example in the
title: "CPAN mirror (perl packages)"
and in the help text: "CPAN (Comprehensive Perl Archive Network) is a
repository of perl packages. It has multiple ... "
-----------
Best regards,
Thomas
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 2/6] scancpan: a new script
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
1 sibling, 0 replies; 15+ messages in thread
From: Thomas De Schampheleire @ 2014-02-11 11:56 UTC (permalink / raw)
To: buildroot
Hi Francois,
On Tue, Feb 11, 2014 at 11:56 AM, Francois Perrad <fperrad@gmail.com> 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>
> ---
[..]
> diff --git a/support/scripts/scancpan b/support/scripts/scancpan
> new file mode 100755
> index 0000000..63a8885
> --- /dev/null
> +++ b/support/scripts/scancpan
[..]
> +
> +my %pkg;
> +my $cfgname = q{package/Config.in};
> +if (-f $cfgname) {
> + open my $fh, q{<}, $cfgname;
> + while (<$fh>) {
> + chomp;
> + $pkg{$_} = 1 if m|package/perl-|;
> + }
> + close $fh;
> +}
> +
> +foreach my $distname (sort keys %dist) {
> + my $fsname = fsname( $distname );
> + $pkg{qq{source "package/${fsname}/Config.in"}} = 1;
> +}
> +
> +say qq{${cfgname} must contains the following lines:};
must contain
> +say join qq{\n}, sort keys %pkg;
> +
> +__END__
> +
> +=head1 NAME
> +
> +support/scripts/scancpan Try-Tiny Moo
> +
> +=head1 SYNOPSIS
> +
> +make host-perl-metacpan-api-tiny host-perl-module-corelist # install dependencies
> +
> +export PERL5LIB=$(HOST_DIR)/usr/lib/perl5 # allows to find dependencies
> +supports/scripts/scancpan [options] [distname ...]
> +
> + Options:
> + -help
> + -man
> + -quiet
> + -force
> + -recommend
> +
> +=head1 OPTIONS
> +
> +=over 8
> +
> +=item B<-help>
> +
> +Print a brief help message and exits.
Prints
> +
> +=item B<-man>
> +
> +Prints the manual page and exits.
> +
> +=item B<-quiet>
> +
> +Executes without output
> +
> +=item B<-force>
> +
> +Forces the overwritting of existing files.
overwriting
> +
> +=item B<-recommend>
> +
> +Adds I<recommended> dependencies.
> +
> +=back
> +
> +=head1 DESCRIPTION
> +
> +This script creates the BR package files for all Perl/CPAN
I would write 'buildroot' instead of BR
> +distributions required by all distname. These data are fetched from
To me this sentence sounds odd: "This script creates the buildroot
package files for all Perl/CPAN distributions required by all
distname." The 'distname' is the package(s) that the user supplies as
argument to the script. But what are these 'distributions' you
mention?
Also, 'by all distname' should either be 'by all distnames' but maybe
better: 'by all specified packages'.
Best regards,
Thomas
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 3/6] host-perl-xml-parser: rename and refactor with perl infrastructure
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
0 siblings, 0 replies; 15+ messages in thread
From: Thomas De Schampheleire @ 2014-02-11 12:00 UTC (permalink / raw)
To: buildroot
On Tue, Feb 11, 2014 at 11:56 AM, Francois Perrad <fperrad@gmail.com> wrote:
> Even though libxml-parser-perl had a Config.in file with an option to
> enable it on the target, this option was hidden by a dependency on
> BR2_HOST_ONLY. So in practice, it was not possible to enable
> libxml-parser-perl on the target. This allows us to rename
> libxml-parser-perl to perl-xml-parser to follow the new naming
> convention of Perl packages, without having to introduce
> Config.in.legacy material.
>
> In addition to this rename, the package is converted to use the newly
> introduced Perl package infrastructure.
>
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
Reviewed-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 4/6] host-perl-module-build: new package
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
0 siblings, 1 reply; 15+ messages in thread
From: Thomas De Schampheleire @ 2014-02-11 12:04 UTC (permalink / raw)
To: buildroot
Hi Francois,
On Tue, Feb 11, 2014 at 11:56 AM, Francois Perrad <fperrad@gmail.com> wrote:
> the version coming with host-perl is too old
>
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
> package/perl-module-build/perl-module-build.mk | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
> create mode 100644 package/perl-module-build/perl-module-build.mk
>
Did this patch change compared to v5?
I already provided a Reviewed-by tag on v5 of this patch.
When sending new iterations of patches, please copy along the tags
(Reviewed-by/Acked-by/Tested-by) you received on previous iterations
if the patch did not change. This avoids duplicate efforts, and helps
the maintainer in assessing how much review this patch already had.
Thanks,
Thomas
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 5/6] manual: adding packages perl
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
0 siblings, 0 replies; 15+ messages in thread
From: Thomas De Schampheleire @ 2014-02-11 12:08 UTC (permalink / raw)
To: buildroot
Hi Francois,
On Tue, Feb 11, 2014 at 11:56 AM, Francois Perrad <fperrad@gmail.com> wrote:
>
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
> docs/manual/adding-packages-perl.txt | 110 ++++++++++++++++++++++++++++++++++
> docs/manual/adding-packages.txt | 2 +
> 2 files changed, 112 insertions(+)
> create mode 100644 docs/manual/adding-packages-perl.txt
>
> diff --git a/docs/manual/adding-packages-perl.txt b/docs/manual/adding-packages-perl.txt
> new file mode 100644
> index 0000000..b272232
> --- /dev/null
> +++ b/docs/manual/adding-packages-perl.txt
[..]
> +
> +Most of these data could be retrieved from https://metacpan.org/.
> +So, this file and the Config.in could be generated by running
> +the script +supports/scripts/scancpan Foo-Bar+ in the +TOPDIR+ directory
> +(or in the +BR2_EXTERNAL+ directory).
I would replace 'could' by 'can' in the above two sentences.
> +This script recursively creates packages for all required Perl/CPAN
> +dependencies.
> +
> +[[perl-package-reference]]
> +
> ++perl-package+ reference
> +^^^^^^^^^^^^^^^^^^^^^^^^
> +
> +As a policy, packages that provide Perl/CPAN modules should all be
> +named +perl-<something>+ in Buildroot.
> +
> +This infrastructure handles various Perl build systems :
> ++ExtUtils-MakeMaker+, +Module-Build+ and +Module-Build-Tiny+.
> ++Build.PL+ is always prefered when a package provides a +Makefile.PL+
preferred
Best regards,
Thomas
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 6/6] perl: remove PERL_INSTALL_TARGET_GOALS
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
0 siblings, 0 replies; 15+ messages in thread
From: Thomas De Schampheleire @ 2014-02-11 12:09 UTC (permalink / raw)
To: buildroot
On Tue, Feb 11, 2014 at 11:56 AM, Francois Perrad <fperrad@gmail.com> wrote:
> useless since previous commit (removal of BR2_HAVE_DOCUMENTATION)
> see http://git.buildroot.net/buildroot/diff/package/perl/perl.mk?id=7164a32632d14cb83698ddec45e84ad2f3252e9e
>
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
> package/perl/perl.mk | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/package/perl/perl.mk b/package/perl/perl.mk
> index 5ede81b..51aeb14 100644
> --- a/package/perl/perl.mk
> +++ b/package/perl/perl.mk
> @@ -90,10 +90,8 @@ define PERL_INSTALL_STAGING_CMDS
> $(MAKE1) -C $(@D) DESTDIR="$(STAGING_DIR)" install.perl
> endef
>
> -PERL_INSTALL_TARGET_GOALS = install.perl
> -
> define PERL_INSTALL_TARGET_CMDS
> - $(MAKE1) -C $(@D) DESTDIR="$(TARGET_DIR)" $(PERL_INSTALL_TARGET_GOALS)
> + $(MAKE1) -C $(@D) DESTDIR="$(TARGET_DIR)" install.perl
> endef
>
> $(eval $(generic-package))
Acked-by: Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 4/6] host-perl-module-build: new package
2014-02-11 12:04 ` Thomas De Schampheleire
@ 2014-02-11 17:02 ` François Perrad
0 siblings, 0 replies; 15+ messages in thread
From: François Perrad @ 2014-02-11 17:02 UTC (permalink / raw)
To: buildroot
2014-02-11 13:04 GMT+01:00 Thomas De Schampheleire <patrickdepinguin@gmail.com>:
> Hi Francois,
>
> On Tue, Feb 11, 2014 at 11:56 AM, Francois Perrad <fperrad@gmail.com> wrote:
>> the version coming with host-perl is too old
>>
>> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>> ---
>> package/perl-module-build/perl-module-build.mk | 12 ++++++++++++
>> 1 file changed, 12 insertions(+)
>> create mode 100644 package/perl-module-build/perl-module-build.mk
>>
>
> Did this patch change compared to v5?
Yes, license updated.
Fran?ois
> I already provided a Reviewed-by tag on v5 of this patch.
> When sending new iterations of patches, please copy along the tags
> (Reviewed-by/Acked-by/Tested-by) you received on previous iterations
> if the patch did not change. This avoids duplicate efforts, and helps
> the maintainer in assessing how much review this patch already had.
>
> Thanks,
> Thomas
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 15+ messages in thread
* [Buildroot] [pkg-perl infra V7 2/6] scancpan: a new script
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
1 sibling, 0 replies; 15+ messages in thread
From: Arnout Vandecappelle @ 2014-02-11 17:49 UTC (permalink / raw)
To: buildroot
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
^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2014-02-11 17:49 UTC | newest]
Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox