Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [V2 1/3] pkg-perl: add PREFER_INSTALLER variable
@ 2017-01-24  8:25 Francois Perrad
  2017-01-24  8:25 ` [Buildroot] [V2 2/3] perl-gd: bump to version 2.56 Francois Perrad
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Francois Perrad @ 2017-01-24  8:25 UTC (permalink / raw)
  To: buildroot

Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
 docs/manual/adding-packages-perl.txt |  8 ++++++--
 package/pkg-perl.mk                  | 20 ++++++++++++++------
 2 files changed, 20 insertions(+), 8 deletions(-)

diff --git a/docs/manual/adding-packages-perl.txt b/docs/manual/adding-packages-perl.txt
index 4f5a6a4..a6e6682 100644
--- a/docs/manual/adding-packages-perl.txt
+++ b/docs/manual/adding-packages-perl.txt
@@ -68,8 +68,8 @@ 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 preferred when a package provides a +Makefile.PL+
++ExtUtils-MakeMaker+ (EUMM), +Module-Build+ (MB) and +Module-Build-Tiny+.
++Build.PL+ is preferred by default when a package provides a +Makefile.PL+
 and a +Build.PL+.
 
 The main macro of the Perl/CPAN package infrastructure is
@@ -97,6 +97,10 @@ 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_PREFER_INSTALLER+/+HOST_PERL_FOO_PREFER_INSTALLER+, with the
+  value 'EUMM', the use of +Makefile.PL+ is prefered at +Build.PL+.
+  By default, 'MB'.
+
 * +PERL_FOO_CONF_ENV+/+HOST_PERL_FOO_CONF_ENV+, to specify additional
   environment variables to pass to the +perl Makefile.PL+ or +perl Build.PL+.
   By default, empty.
diff --git a/package/pkg-perl.mk b/package/pkg-perl.mk
index 4b20598..cc94cd9 100644
--- a/package/pkg-perl.mk
+++ b/package/pkg-perl.mk
@@ -49,6 +49,14 @@ else
 $(2)_DEPENDENCIES += host-perl
 endif
 
+# From http://perldoc.perl.org/CPAN.html#Config-Variables - prefer_installer
+#       legal values are MB and EUMM: if a module comes
+#       with both a Makefile.PL and a Build.PL, use the
+#       former (EUMM) or the latter (MB); if the module
+#       comes with only one of the two, that one will be
+#       used no matter the setting
+$(2)_PREFER_INSTALLER ?= MB
+
 #
 # Configure step. Only define it if not already defined by the package
 # .mk file. And take care of the differences between host and target
@@ -59,7 +67,7 @@ ifeq ($(4),target)
 
 # Configure package for target
 define $(2)_CONFIGURE_CMDS
-	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
 		$$($(2)_CONF_ENV) \
 		PERL_MM_USE_DEFAULT=1 \
 		$$(PERL_RUN) Build.PL \
@@ -109,7 +117,7 @@ else
 
 # Configure package for host
 define $(2)_CONFIGURE_CMDS
-	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
 		$$($(2)_CONF_ENV) \
 		PERL_MM_USE_DEFAULT=1 \
 		$$(PERL_RUN) Build.PL \
@@ -135,7 +143,7 @@ ifeq ($(4),target)
 
 # Build package for target
 define $(2)_BUILD_CMDS
-	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
 		$$(PERL_RUN) Build $$($(2)_BUILD_OPTS) build; \
 	else \
 		$$(MAKE1) \
@@ -148,7 +156,7 @@ else
 
 # Build package for host
 define $(2)_BUILD_CMDS
-	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
 		$$(PERL_RUN) Build $$($(2)_BUILD_OPTS) build; \
 	else \
 		$$(MAKE1) $$($(2)_BUILD_OPTS) pure_all; \
@@ -163,7 +171,7 @@ endif
 #
 ifndef $(2)_INSTALL_CMDS
 define $(2)_INSTALL_CMDS
-	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
 		$$(PERL_RUN) Build $$($(2)_INSTALL_TARGET_OPTS) install; \
 	else \
 		$$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \
@@ -177,7 +185,7 @@ endif
 #
 ifndef $(2)_INSTALL_TARGET_CMDS
 define $(2)_INSTALL_TARGET_CMDS
-	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] ; then \
+	cd $$($$(PKG)_SRCDIR) && if [ -f Build.PL ] && [ $$($(2)_PREFER_INSTALLER) != "EUMM" ] ; then \
 		$$(PERL_RUN) Build $$($(2)_INSTALL_TARGET_OPTS) install; \
 	else \
 		$$(MAKE1) $$($(2)_INSTALL_TARGET_OPTS) pure_install; \
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-01-29 13:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-24  8:25 [Buildroot] [V2 1/3] pkg-perl: add PREFER_INSTALLER variable Francois Perrad
2017-01-24  8:25 ` [Buildroot] [V2 2/3] perl-gd: bump to version 2.56 Francois Perrad
2017-01-24  8:25 ` [Buildroot] [V2 3/3] perl-gdgraph: bump to version 1.54 Francois Perrad
2017-01-24  9:20 ` [Buildroot] [V2 1/3] pkg-perl: add PREFER_INSTALLER variable Thomas Petazzoni
2017-01-29 13:59 ` Thomas Petazzoni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox