pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/perl5 Add basic Module::Build support; set PERL5_...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/7af2912d5b77
branches:  trunk
changeset: 489427:7af2912d5b77
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Mon Feb 21 12:08:45 2005 +0000

description:
Add basic Module::Build support; set PERL5_USES_MODULE_BUILD
for packages that want it.

diffstat:

 lang/perl5/module.mk |  31 +++++++++++++++++++++++++++++--
 1 files changed, 29 insertions(+), 2 deletions(-)

diffs (77 lines):

diff -r 47a593170c02 -r 7af2912d5b77 lang/perl5/module.mk
--- a/lang/perl5/module.mk      Mon Feb 21 11:08:46 2005 +0000
+++ b/lang/perl5/module.mk      Mon Feb 21 12:08:45 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: module.mk,v 1.37 2004/07/06 22:52:33 wiz Exp $
+# $NetBSD: module.mk,v 1.38 2005/02/21 12:08:45 wiz Exp $
 #
 # This Makefile fragment is intended to be included by packages that build
 # and install perl5 modules.
@@ -25,6 +25,9 @@
 #
 # PERL5_LDFLAGS                extra linker flags to pass on to the build
 #                      process.
+#
+# PERL5_USES_MODULE_BUILD      the package uses Module::Build instead
+#                              of ExtUtils::MakeMaker
 
 .if !defined(_PERL5_MODULE_MK)
 _PERL5_MODULE_MK=      # defined
@@ -41,6 +44,10 @@
 .  endif
 .endif
 
+.if defined(PERL5_USES_MODULE_BUILD)
+BUILD_DEPENDS+=                p5-Module-Build-[0-9]*:../../devel/p5-Module-Build
+.endif
+
 PERL5_CONFIGURE?=      YES
 PERL5_CONFIGURE_DIRS?= ${CONFIGURE_DIRS}
 
@@ -58,13 +65,19 @@
 .endif
 
 MAKE_ENV+=     LC_ALL=C
+.if defined(PERL5_USES_MODULE_BUILD)
+_CONF_ARG=     Build.PL
+.else
+_CONF_ARG=     Makefile.PL ${MAKE_PARAMS:Q}
+.endif
+
 .PHONY: perl5-configure
 perl5-configure:
        ${_PKG_SILENT}${_PKG_DEBUG}                                     \
        for dir in ${PERL5_CONFIGURE_DIRS}; do                          \
                if [ -f $$dir/Makefile.PL ]; then                       \
                        ( cd $$dir && ${SETENV} ${MAKE_ENV}             \
-                         ${PERL5} Makefile.PL ${MAKE_PARAMS});         \
+                         ${PERL5} ${_CONF_ARG});               \
                fi;                                                     \
        done
 
@@ -84,11 +97,25 @@
 PERL5_${_var_}=                ${PREFIX}/${PERL5_SUB_${_var_}}
 PERL5_MAKE_FLAGS+=     ${_var_}="${PERL5_${_var_}}"
 .endfor
+
+.if !defined(PERL5_USES_MODULE_BUILD)
 #
 # The PREFIX in the generated Makefile will point to ${_PERL5_PREFIX},
 # so override its value to the module's ${PREFIX}.
 #
 PERL5_MAKE_FLAGS+=     PREFIX="${PREFIX}"
+.endif
+
+.if defined(PERL5_USES_MODULE_BUILD)
+do-build:
+       @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build
+
+do-test:
+       @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build test
+
+do-install:
+       @cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build install
+.endif
 
 .if defined(DEFAULT_VIEW.perl)
 DEFAULT_VIEW.${PKGBASE}=       ${DEFAULT_VIEW.perl}



Home | Main Index | Thread Index | Old Index