From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [V10 5/6] manual: adding packages perl
Date: Thu, 20 Feb 2014 08:11:16 +0100 [thread overview]
Message-ID: <5305AA94.6090404@mind.be> (raw)
In-Reply-To: <1392310269-21027-6-git-send-email-francois.perrad@gadz.org>
Ah, documentation, always a big attractor of small corrections...
On 13/02/14 17:51, Francois Perrad wrote:
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
> docs/manual/adding-packages-perl.txt | 108 ++++++++++++++++++++++++++++++++++
> docs/manual/adding-packages.txt | 2 +
> 2 files changed, 110 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..4e127dd
> --- /dev/null
> +++ b/docs/manual/adding-packages-perl.txt
> @@ -0,0 +1,108 @@
> +// -*- 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 can be retrieved from https://metacpan.org/.
> +So, this file and the Config.in can be generated by running
> +the script +supports/scripts/scancpan Foo-Bar+ in the +TOPDIR+ directory
TOPDIR -> buildroot
(I have a feeling that the TOPDIR was actually inserted because of an
earlier review comment, so maybe my feedback is not correct).
> +(or in the +BR2_EXTERNAL+ directory).
> +This script recursively creates packages for all required Perl/CPAN
> +dependencies.
How about:
This script creates a Config.in file and foo-bar.mk file for the
requested package, and also recursively for all dependencies specified by
CPAN. You should still manually edit the result. In particular, the
following things should be checked.
* The +PERL_FOO_BAR_LICENSE_FILES+ variable is not set, because metacpan
doesn't have this information. Also, the name of the license file(s)
varies between packages, and some don't even have a license file.
* If the perl module links with a shared library that is provided by
another (non-perl) package, this dependency is not added automatically.
It has to be added manually to +PERL_FOO_BAR_DEPENDENCIES+.
* The +package/Config.in+ file has to be updated manually to include the
generated Config.in files. As a hint, the +scancpan+ script prints out
the required +source "..."+ statements, sorted alphabetically.
> +
> +[[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+.
Shouldn't that be ExtUtils::MakeMaker etc?
> ++Build.PL+ is always preferred 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. The perl
> +infrastructure doesn't define these commands 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
I think +HOST_PERL_FOO_CONF_OPT+ should be mentioned explicitly here as
well, so it is clear that this is not "inherited" from PERL_FOO_CONF_OPT.
Regards,
Arnout
> + 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[]
>
--
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
next prev parent reply other threads:[~2014-02-20 7:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-13 16:51 [Buildroot] [V10 0/6] a package infrastructure for Perl/CPAN modules Francois Perrad
2014-02-13 16:51 ` [Buildroot] [V10 1/6] perl: remove PERL_INSTALL_TARGET_GOALS Francois Perrad
2014-02-13 16:51 ` [Buildroot] [V10 2/6] pkg-perl: new infrastructure Francois Perrad
2014-02-13 16:51 ` [Buildroot] [V10 3/6] host-perl-xml-parser: rename and refactor with perl infrastructure Francois Perrad
2014-02-13 16:51 ` [Buildroot] [V10 4/6] host-perl-module-build: new package Francois Perrad
2014-02-13 16:51 ` [Buildroot] [V10 5/6] manual: adding packages perl Francois Perrad
2014-02-20 7:11 ` Arnout Vandecappelle [this message]
2014-02-20 13:57 ` [Buildroot] [UNSURE]Re: " François Perrad
2014-02-13 16:51 ` [Buildroot] [V10 6/6] scancpan: a new script Francois Perrad
2014-02-20 21:30 ` Arnout Vandecappelle
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=5305AA94.6090404@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.