summaryrefslogtreecommitdiff
path: root/lang/perl5/module.mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2005-02-24 22:38:41 +0000
committerjlam <jlam@pkgsrc.org>2005-02-24 22:38:41 +0000
commitcc44d0be98aabb64601c3d29f432f4c367d294a2 (patch)
treec96cdee8b1fc0edeb3e3d598eb735386e2aeae9c /lang/perl5/module.mk
parent2fc640fd96763871e652242bb17a5d29baa4672a (diff)
downloadpkgsrc-cc44d0be98aabb64601c3d29f432f4c367d294a2.tar.gz
* Teach devel/p5-Module-Build to write .packlists just like MakeMaker.pm
does. This allows us to use dynamic PLISTs for Perl modules that are built using Module::Build. Bump the PKGREVISION of p5-Module-Build to 1. * Drop the use of PERL5_USES_MODULE_BUILD and introduce a new variable PERL5_MODULE_TYPE that is either "MakeMaker" or "Module::Build" that names the framework used to build/install the module. * Split out the variables set in perl5/buildlink3.mk that are also used by perl5/module.mk into a new file perl5/vars.mk. Move some PERL5_* variable definitions from pkgsrc/mk/bsd.pkg.use.mk into perl5/vars.mk. This just centralizes the common PERL5_* definitions into a single file location. * Convert the known packages that use Module::Build to set PERL5_MODULE_TYPE and PERL5_PACKLIST: devel/p5-Class-Container devel/p5-Exception-Class devel/p5-Log-Dispatch devel/p5-Array-Compare textproc/p5-Pod-Coverage www/p5-Apache-Session-Wrapper www/p5-MasonX-Request-WithApacheSession
Diffstat (limited to 'lang/perl5/module.mk')
-rw-r--r--lang/perl5/module.mk25
1 files changed, 16 insertions, 9 deletions
diff --git a/lang/perl5/module.mk b/lang/perl5/module.mk
index 997b3b1c015..1becc241bf8 100644
--- a/lang/perl5/module.mk
+++ b/lang/perl5/module.mk
@@ -1,4 +1,4 @@
-# $NetBSD: module.mk,v 1.39 2005/02/23 10:42:07 wiz Exp $
+# $NetBSD: module.mk,v 1.40 2005/02/24 22:38:42 jlam Exp $
#
# This Makefile fragment is intended to be included by packages that build
# and install perl5 modules.
@@ -26,8 +26,8 @@
# 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
+# PERL5_MODULE_TYPE "MakeMaker" or "Module::Build" depending on which
+# framework is used to build/install the module.
.if !defined(_PERL5_MODULE_MK)
_PERL5_MODULE_MK= # defined
@@ -36,7 +36,11 @@ _PERL5_MODULE_MK= # defined
BUILDLINK_DEPMETHOD.perl+= full
-.if !defined(BUILDING_PERL5)
+BUILDING_PERL5?= no
+BUILDING_MODULE_BUILD?= no
+PERL5_MODULE_TYPE?= MakeMaker
+
+.if empty(BUILDING_PERL5:M[yY][eE][sS])
. if !defined(NO_BUILDLINK)
. if empty(USE_BUILDLINK3:M[nN][oO])
. include "../../lang/perl5/buildlink3.mk"
@@ -44,10 +48,13 @@ BUILDLINK_DEPMETHOD.perl+= full
. endif
.endif
-.if defined(PERL5_USES_MODULE_BUILD)
+.if empty(BUILDING_MODULE_BUILD:M[yY][eE][sS]) && \
+ (${PERL5_MODULE_TYPE} == "Module::Build")
BUILD_DEPENDS+= p5-Module-Build-[0-9]*:../../devel/p5-Module-Build
.endif
+.include "../../lang/perl5/vars.mk"
+
PERL5_CONFIGURE?= YES
PERL5_CONFIGURE_DIRS?= ${CONFIGURE_DIRS}
@@ -65,9 +72,9 @@ BROKEN= Perl does not like building with gcc on AIX, please use a different com
.endif
MAKE_ENV+= LC_ALL=C
-.if defined(PERL5_USES_MODULE_BUILD)
+.if ${PERL5_MODULE_TYPE} == "Module::Build"
_CONF_ARG= Build.PL
-.else
+.elif ${PERL5_MODULE_TYPE} == "MakeMaker"
_CONF_ARG= Makefile.PL ${MAKE_PARAMS}
.endif
@@ -98,7 +105,7 @@ PERL5_${_var_}= ${PREFIX}/${PERL5_SUB_${_var_}}
PERL5_MAKE_FLAGS+= ${_var_}="${PERL5_${_var_}}"
.endfor
-.if !defined(PERL5_USES_MODULE_BUILD)
+.if ${PERL5_MODULE_TYPE} == "MakeMaker"
#
# The PREFIX in the generated Makefile will point to ${_PERL5_PREFIX},
# so override its value to the module's ${PREFIX}.
@@ -106,7 +113,7 @@ PERL5_MAKE_FLAGS+= ${_var_}="${PERL5_${_var_}}"
PERL5_MAKE_FLAGS+= PREFIX="${PREFIX}"
.endif
-.if defined(PERL5_USES_MODULE_BUILD)
+.if ${PERL5_MODULE_TYPE} == "Module::Build"
do-build:
@cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ./Build