On 03/08/16 10:18, Nigel Taylor wrote:
> On 03/08/16 04:52, Abel Abraham Camarillo Ojeda wrote:
>> Module::Build::Tiny according to its docs:
>>
>> Incompatibilities
>> • Argument parsing
>>
>> Module::Build has an extremely permissive way of argument
>> handling,
>> Module::Build::Tiny only supports a (sane) subset of that. In
>> particular, "./Build destdir=/foo" does not work, you will need to
>> pass it as "./Build --destdir=/foo".
>>
>> also, after a discussion on #toolchain on irc.perl.org it seems that
>> Module::Build::Tiny requires options to be after actions.
>>
>> this patch enables instalation of packages that use Module::Build::Tiny
>> and don't have Module::Build compatibility - like my following port
>> of Mojo::JSON::MaybeXS.
>>
>> patch attached - gmail.
>>
>> comments, ideas?
>>
>> thanks.
>>
> Changes to perl.port.mk requires testing of a large number of perl ports.
>
> There are at least two perl ports that build using Module::Build::Tiny,
> without any such modifications. The reason is modbuild is for ports
> using Module::Build, not ports using Module::Build::Tiny. That is two
> ports that doesn't use do-install to supply the Module::Build::Tiny CLI
> parameters.
>
> So it's true using something meant specifically for Module::Build may
> not work for Module::Build::Tiny.
>
> I need to look, at all ports using Module::Build::Tiny, but maybe the
> wrong build method is being used in the first place. Those that work and
> don't require changes do not use modbuild, so never use the modbuild
> supplied CLI parameters and require no change to perl.port.mk.
>
> Module::Build is removed from core perl after version 5.21, and this
> requires changes to the same section in perl.port.mk, while tests might
> work now, changes might hamper moving to perl 5.22, and need to be
> tested against a p5-Module-Build 0.42.08 not just the the core 0.42.05
> version.
>
> $ grep Module-Build-Tiny INDEX | cut -d\| -f2 | sed -e 's%$%/Makefile%'
> | xargs grep do-install
> devel/p5-Module-Build-Tiny/Makefile:do-install:
> geo/p5-Geo-UK-Postcode-Regex/Makefile:do-install:
> www/p5-CGI-Compile/Makefile:do-install:
> www/p5-Starman/Makefile:do-install:
>
> (ignore devel/p5-Module-Build-Tiny itself as likely to be a special case).
>
> The majority ports don't use do-install or modbuild
>
> $ grep Module-Build-Tiny INDEX | cut -d\| -f2 | sed -e 's%$%/Makefile%'
> | xargs egrep -L "do-install|modbuild"
> devel/p5-Class-C3-Adopt-NEXT/Makefile
> devel/p5-Hook-LexWrap/Makefile
> devel/p5-MooseX-AttributeHelpers/Makefile
> devel/p5-MooseX-LazyRequire/Makefile
> devel/p5-MooseX-Types/Makefile
> devel/p5-MooseX-Types-LoadableClass/Makefile
> devel/p5-Test-DistManifest/Makefile
>
>
> Does anything say modbuild can be used for Module::Build::Tiny ports?
>
>
>
Had a better look, depending on how the distribution is generated a
Makefile.PL may or may not exist. If Makefile.PL doesn't exist Build.PL
has to be used. These generate a Makefile.
Dist::Zilla::Plugin::MakeMaker::Awesome is used to generate the
Makefile.PL using the dist.ini
Dist::Zilla::Plugin::ModuleBuildTiny is used to generate the Build.PL
from dist.ini for Module::Build::Tiny.
Dist::Zilla::Plugin::ModuleBuild is used to generate the Build.PL for
Module::Build from dist.ini
There are no Dist::Zilla..... / Dist::Milla.... in ports currently to
try, used to send distribution to CPAN.
modbuild shouldn't be used but maybe a modtiny style adding an extra
style doesn't impact existing modbuild ports.
modbuild will add the p5-Module-Build port to BUILD_DEPENDS for perl
5.22 (or you can edit every modbuild port for perl 5.22).
modtiny should add p5-Module-Build-Tiny to BUILD_DEPENDS, as with
modinst adding p5-Module-Install, then Module::Install depends on
Module::Build, is a run depends for perl 5.22
Attached, diff revised p5-Starman port. My perl.port.mk include some
extras as building other ports at this time, can't remove mid dpb build.
modinst - removes all bundled perl, needs some additional ports /
dependency changes to build.
modbuild - adds p5-Module-Build to BDEP.
revised p5-Geo-UK-Postcode-Regex below, and also p5-CGI-Compile
$ cat Makefile
# $OpenBSD: Makefile,v 1.2 2016/01/11 10:34:21 sthen Exp $
COMMENT= regular expressions for handling British postcodes
MODULES= cpan
DISTNAME= Geo-UK-Postcode-Regex-0.015
CATEGORIES= geo
# Perl
PERMIT_PACKAGE_CDROM= Yes
MAINTAINER= Stuart Henderson <[email protected]>
BUILD_DEPENDS= devel/p5-File-ShareDir-Install
TEST_DEPENDS= devel/p5-Test-Exception \
devel/p5-Clone
CONFIGURE_STYLE= modtiny
.include <bsd.port.mk>
$ make show=BUILD_DEPENDS
devel/p5-File-ShareDir-Install devel/p5-Module-Build-Tiny devel/ccache
If modbuild had been used would of had p5-Module-Build included in BDEP,
when only p5-Module-Build-Tiny is required.
Also works switching from Makefile.PL to Build.PL - only tried the one
(should have removed \ ok for checking the change over).
$ cvs -R -q diff -uNp
Index: Makefile
===================================================================
RCS file: /home/cvs/ports/devel/p5-MooseX-Types/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- Makefile 12 Jun 2015 13:46:08 -0000 1.12
+++ Makefile 8 Mar 2016 15:12:07 -0000
@@ -17,9 +17,10 @@ RUN_DEPENDS = devel/p5-Carp-Clan \
devel/p5-Sub-Name \
devel/p5-namespace-autoclean
BUILD_DEPENDS = ${RUN_DEPENDS} \
- devel/p5-Module-Build-Tiny
TEST_DEPENDS = devel/p5-Test-Fatal \
devel/p5-Test-Requires
+
+CONFIGURE_STYLE = modtiny
.include <bsd.port.mk>
Index: Makefile
===================================================================
RCS file: /home/cvs/ports/www/p5-Starman/Makefile,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile
--- Makefile 10 Jan 2016 22:49:37 -0000 1.5
+++ Makefile 8 Mar 2016 14:20:11 -0000
@@ -13,7 +13,6 @@ PERMIT_PACKAGE_CDROM = Yes
CPAN_AUTHOR = MIYAGAWA
BUILD_DEPENDS = www/p5-libwww \
- devel/p5-Module-Build-Tiny>=0.039 \
devel/p5-Test-Requires
RUN_DEPENDS = devel/p5-Data-Dump \
@@ -32,16 +31,6 @@ TEST_DEPENDS = www/p5-HTTP-Message \
net/p5-Test-TCP \
www/p5-libwww
-CONFIGURE_STYLE = modbuild
-
-# Module::Build::Tiny like "--" prefix for CLI options
-do-install:
- @cd ${WRKSRC} && perl \
- ${MODPERL_BUILD} ${FAKE_TARGET} \
- --destdir "${PREFIX}" \
- --install_path lib="libdata/perl5/site_perl" \
- --install_path=libdoc="man/man3p" \
- --install_path=bindoc="man/man1" \
- --install_path script="bin"
+CONFIGURE_STYLE = modtiny
.include <bsd.port.mk>
Index: perl.port.mk
===================================================================
RCS file: /home/cvs/ports/infrastructure/mk/perl.port.mk,v
retrieving revision 1.24
diff -u -p -r1.24 perl.port.mk
--- perl.port.mk 10 Aug 2014 08:59:48 -0000 1.24
+++ perl.port.mk 8 Mar 2016 14:13:39 -0000
@@ -31,6 +31,17 @@ MODPERL_configure = \
install_path=bindoc="${PREFIX}/man/man1" \
install_path=bin="${PREFIX}/bin" \
install_path=script="${PREFIX}/bin" ${CONFIGURE_ARGS}
+.elif ${CONFIGURE_STYLE:L:Mmodtiny}
+MODPERL_configure = \
+ arch=`perl -e 'use Config; print $$Config{archname}, "\n";'`; \
+ cd ${WRKSRC}; ${_SYSTRACE_CMD} ${SETENV} ${CONFIGURE_ENV} \
+ perl Build.PL \
+ --install_path=lib="${PREFIX}/libdata/perl5/site_perl" \
+ --install_path=arch="${PREFIX}/libdata/perl5/site_perl/$$arch" \
+ --install_path=libdoc="${PREFIX}/man/man3p" \
+ --install_path=bindoc="${PREFIX}/man/man1" \
+ --install_path=bin="${PREFIX}/bin" \
+ --install_path=script="${PREFIX}/bin" ${CONFIGURE_ARGS}
.else
MODPERL_configure = ${_MODPERL_preconfig}; \
arch=`perl -e 'use Config; print $$Config{archname}, "\n";'`; \
@@ -54,7 +65,7 @@ MODPERL_configure = ${_MODPERL_preconfig
. if ${CONFIGURE_STYLE:L:Mmodinst}
BUILD_DEPENDS += devel/p5-Module-Install
CONFIGURE_ARGS += --skipdeps
-_MODPERL_preconfig = rm -rf ${WRKSRC}/inc/Module/*Install*
+_MODPERL_preconfig = rm -rf ${WRKSRC}/inc/*
. else
_MODPERL_preconfig = :
. endif
@@ -64,6 +75,7 @@ MODPERL_pre-fake = \
${_FAKESUDO} mkdir -p ${WRKINST}`perl -e 'use Config; print
$$Config{installarchlib}, "\n";'`
.if ${CONFIGURE_STYLE:L:Mmodbuild}
+BUILD_DEPENDS += devel/p5-Module-Build
MODPERL_BUILD_TARGET = \
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
${MODPERL_BUILD} build
@@ -74,6 +86,33 @@ MODPERL_TEST_TARGET = \
MODPERL_INSTALL_TARGET = \
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
${MODPERL_BUILD} destdir=${WRKINST} ${FAKE_TARGET}
+
+. if !target(do-build)
+do-build:
+ @${MODPERL_BUILD_TARGET}
+. endif
+. if !target(do-test)
+do-test:
+ @${MODPERL_TEST_TARGET}
+. endif
+. if !target(do-install)
+do-install:
+ @${MODPERL_INSTALL_TARGET}
+. endif
+.endif
+
+.if ${CONFIGURE_STYLE:L:Mmodtiny}
+BUILD_DEPENDS += devel/p5-Module-Build-Tiny
+MODPERL_BUILD_TARGET = \
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
+ ${MODPERL_BUILD} build
+
+MODPERL_TEST_TARGET = \
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
+ ${MODPERL_BUILD} ${TEST_TARGET}
+MODPERL_INSTALL_TARGET = \
+ cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} perl \
+ ${MODPERL_BUILD} ${FAKE_TARGET} --destdir=${WRKINST}
. if !target(do-build)
do-build: