Hi Karen,

On Thu, Mar 21, 2019 at 1:42 AM Karen Etheridge <p...@froods.org> wrote:

> - yes, things used by Makefile.PL itself go into CONFIGURE_REQUIRES,
> but everyone has Module::Metadata, as it is in core (it was split off
> from Module::Build a long time ago, and has remained in core even
> after MB left).

Well, as far as I can see it was added to core in 5.14, so "everyone
has it" is only true depending on your definition of "everyone" I
guess.

On the other hand Module::Metadata is a simple enough module that it
would not be problematic to add this to the dependency list of the
module, which would mean that people stuck on OLD versions of Perl
need to install this one additional pure perl module, and for the
'regular' users on reasonably modern perls, everything is automatic.
So basically, thinking about changing this in my Makefile.PL to get
the desired 'provides' in META.yml:

diff --git a/Makefile.PL b/Makefile.PL
index 6ac80e9..c80d605 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -4,6 +4,7 @@ use warnings;
 use 5.006001;

 use ExtUtils::MakeMaker;
+use Module::Metadata;

 WriteMakefile (
   'NAME'             => 'File::MimeInfo',
@@ -37,6 +38,7 @@ WriteMakefile (
     'TESTS' => "t/*.t"
   },
   META_MERGE => {
+    provides => Module::Metadata->provides(dir => 'lib', version => 2),
     resources => {
       repository => 'https://github.com/mbeijen/File-MimeInfo',
       bugtracker => 'https://github.com/mbeijen/File-MimeInfo/issues',

Does this seem sane?
I guess the other thing is that we could make this solution more
'discoverable' by adding it for instance to CPANTS recommendations,
there is currently no solution provided for EUMM-based modules:

"Add all modules contained in this distribution to the META.yml field
'provides'. Module::Build or Dist::Zilla::Plugin::MetaProvides do this
automatically for you."
(ref: https://cpants.cpanauthors.org/kwalitee/meta_yml_has_provides)

--
Michiel

Reply via email to