diff options
author | jlam <jlam@pkgsrc.org> | 2005-02-24 22:38:41 +0000 |
---|---|---|
committer | jlam <jlam@pkgsrc.org> | 2005-02-24 22:38:41 +0000 |
commit | cc44d0be98aabb64601c3d29f432f4c367d294a2 (patch) | |
tree | c96cdee8b1fc0edeb3e3d598eb735386e2aeae9c /lang | |
parent | 2fc640fd96763871e652242bb17a5d29baa4672a (diff) | |
download | pkgsrc-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')
-rw-r--r-- | lang/perl5/buildlink3.mk | 45 | ||||
-rw-r--r-- | lang/perl5/module.mk | 25 | ||||
-rw-r--r-- | lang/perl5/vars.mk | 69 |
3 files changed, 89 insertions, 50 deletions
diff --git a/lang/perl5/buildlink3.mk b/lang/perl5/buildlink3.mk index 663edf800e2..389a590f9d8 100644 --- a/lang/perl5/buildlink3.mk +++ b/lang/perl5/buildlink3.mk @@ -1,4 +1,4 @@ -# $NetBSD: buildlink3.mk,v 1.17 2004/12/20 13:25:09 grant Exp $ +# $NetBSD: buildlink3.mk,v 1.18 2005/02/24 22:38:42 jlam Exp $ BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+ PERL5_BUILDLINK3_MK:= ${PERL5_BUILDLINK3_MK}+ @@ -24,53 +24,16 @@ BUILDLINK_PKGSRCDIR.perl?= ${PERL5_PKGSRCDIR} BUILDLINK_DEPMETHOD.perl?= build .endif -_PERL5_SITEVARS= \ - INSTALLSITEBIN INSTALLSITELIB INSTALLSITEARCH \ - INSTALLSITEMAN1DIR INSTALLSITEMAN3DIR \ - SITELIBEXP SITEARCHEXP - -_PERL5_SITEVAR.INSTALLSITEBIN= installsitebin -_PERL5_SITEVAR.INSTALLSITELIB= installsitelib -_PERL5_SITEVAR.INSTALLSITEARCH= installsitearch -_PERL5_SITEVAR.INSTALLSITEMAN1DIR= installsiteman1dir -_PERL5_SITEVAR.INSTALLSITEMAN3DIR= installsiteman3dir -_PERL5_SITEVAR.SITELIBEXP= sitelibexp -_PERL5_SITEVAR.SITEARCHEXP= sitearchexp - PERL5_OPTIONS?= # empty .if !empty(PERL5_OPTIONS:Mthreads) USE_PKGINSTALL= yes INSTALL_EXTRA_TMPL+= ${.CURDIR}/../../lang/perl5/files/install.tmpl .endif -.if exists(${PERL5}) -. if !defined(_PERL5_SITEPREFIX) -_PERL5_PREFIX!= \ - eval `${PERL5} -V:prefix 2>/dev/null`; ${ECHO} $$prefix -_PERL5_SITEPREFIX!= \ - eval `${PERL5} -V:siteprefix 2>/dev/null`; ${ECHO} $$siteprefix -MAKEFLAGS+= _PERL5_PREFIX=${_PERL5_PREFIX:Q} -MAKEFLAGS+= _PERL5_SITEPREFIX=${_PERL5_SITEPREFIX:Q} +.include "../../lang/perl5/vars.mk" -. for _var_ in ${_PERL5_SITEVARS} -PERL5_SUB_${_var_}!= \ - eval `${PERL5} -V:${_PERL5_SITEVAR.${_var_}} 2>/dev/null`; \ - ${ECHO} $${${_PERL5_SITEVAR.${_var_}}} | \ - ${SED} -e "s,^${_PERL5_SITEPREFIX}/,," -MAKEFLAGS+= PERL5_SUB_${_var_}=${PERL5_SUB_${_var_}:Q} -. endfor -PERL5_SUB_INSTALLARCHLIB!= \ - eval `${PERL5} -V:installarchlib 2>/dev/null`; \ - ${ECHO} $$installarchlib | \ - ${SED} -e "s,^${_PERL5_PREFIX}/,," -MAKEFLAGS+= PERL5_SUB_INSTALLARCHLIB=${PERL5_SUB_INSTALLARCHLIB:Q} -PERL5_SUB_INSTALLSCRIPT!= \ - eval `${PERL5} -V:installscript 2>/dev/null`; \ - ${ECHO} $$installscript | \ - ${SED} -e "s,^${_PERL5_PREFIX}/,," -MAKEFLAGS+= PERL5_SUB_INSTALLSCRIPT=${PERL5_SUB_INSTALLSCRIPT:Q} -. endif -. if ${PKG_INSTALLATION_TYPE} == "overwrite" +.if ${PKG_INSTALLATION_TYPE} == "overwrite" +. if defined(PERL5_SUB_INSTALLARCHLIB) # # Perl keeps headers and odd libraries in an odd path not caught by the # default BUILDLINK_FILES_CMD, so name them to be symlinked into 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 diff --git a/lang/perl5/vars.mk b/lang/perl5/vars.mk new file mode 100644 index 00000000000..35cf9d50353 --- /dev/null +++ b/lang/perl5/vars.mk @@ -0,0 +1,69 @@ +# $NetBSD: vars.mk,v 1.1 2005/02/24 22:38:42 jlam Exp $ +# +# This Makefile fragment exposes several Perl configuration variables +# to the package Makefiles. The variables are only defined if the +# ${PERL5} executable exists. + +.if !defined(_PERL5_VARS_MK) +_PERL5_VARS_MK= yes + +.include "../../mk/bsd.prefs.mk" + +_PERL5_SITEVARS= \ + INSTALLSITEBIN INSTALLSITELIB INSTALLSITEARCH \ + INSTALLSITEMAN1DIR INSTALLSITEMAN3DIR \ + SITELIBEXP SITEARCHEXP + +_PERL5_SITEVAR.INSTALLSITEBIN= installsitebin +_PERL5_SITEVAR.INSTALLSITELIB= installsitelib +_PERL5_SITEVAR.INSTALLSITEARCH= installsitearch +_PERL5_SITEVAR.INSTALLSITEMAN1DIR= installsiteman1dir +_PERL5_SITEVAR.INSTALLSITEMAN3DIR= installsiteman3dir +_PERL5_SITEVAR.SITELIBEXP= sitelibexp +_PERL5_SITEVAR.SITEARCHEXP= sitearchexp + +.if exists(${PERL5}) +. if !defined(_PERL5_SITEPREFIX) +_PERL5_PREFIX!= \ + eval `${PERL5} -V:prefix 2>/dev/null`; ${ECHO} $$prefix +_PERL5_SITEPREFIX!= \ + eval `${PERL5} -V:siteprefix 2>/dev/null`; ${ECHO} $$siteprefix +MAKEFLAGS+= _PERL5_PREFIX=${_PERL5_PREFIX:Q} +MAKEFLAGS+= _PERL5_SITEPREFIX=${_PERL5_SITEPREFIX:Q} + +. for _var_ in ${_PERL5_SITEVARS} +. if !defined(PERL5_SUB_${_var_}) +PERL5_SUB_${_var_}!= \ + eval `${PERL5} -V:${_PERL5_SITEVAR.${_var_}} 2>/dev/null`; \ + ${ECHO} $${${_PERL5_SITEVAR.${_var_}}} | \ + ${SED} -e "s,^${_PERL5_SITEPREFIX}/,," +MAKEFLAGS+= PERL5_SUB_${_var_}=${PERL5_SUB_${_var_}:Q} +. endif +. endfor +. if !defined(PERL5_SUB_INSTALLARCHLIB) +PERL5_SUB_INSTALLARCHLIB!= \ + eval `${PERL5} -V:installarchlib 2>/dev/null`; \ + ${ECHO} $$installarchlib | \ + ${SED} -e "s,^${_PERL5_PREFIX}/,," +MAKEFLAGS+= PERL5_SUB_INSTALLARCHLIB=${PERL5_SUB_INSTALLARCHLIB:Q} +. endif +. if !defined(PERL5_SUB_INSTALLSCRIPT) +PERL5_SUB_INSTALLSCRIPT!= \ + eval `${PERL5} -V:installscript 2>/dev/null`; \ + ${ECHO} $$installscript | \ + ${SED} -e "s,^${_PERL5_PREFIX}/,," +MAKEFLAGS+= PERL5_SUB_INSTALLSCRIPT=${PERL5_SUB_INSTALLSCRIPT:Q} +. endif +. endif +.endif + +.if ${PKG_INSTALLATION_TYPE} == "overwrite" +. for _var_ in SITELIB SITEARCH ARCHLIB +. if defined(PERL5_SUB_INSTALL${_var_}) +PERL5_${_var_}?= ${LOCALBASE}/${PERL5_SUB_INSTALL${_var_}} +MAKEFLAGS+= PERL5_${_var_}=${PERL5_${_var_}:Q} +. endif +. endfor +.endif + +.endif # _PERL5_VARS_MK |