Upgrade you Makefile.PL with eumm-upgrade

chorny on 2009-12-17T23:30:45

I decided to celebrate Perl birthday with several new tools. First one is 'eumm-upgrade'.

It can be used to allow using new features of ExtUtils::MakeMaker without losing compatibility with older versions. BUILD_REQUIRES is the main new feature (I wrote it). It is important for ActivePerl ppm files, for META.yml and for OS packages.

eumm-upgrade adds compatibility code to Makefile.PL and tries to automatically detect some properties like license, minimum Perl version required and repository used.

You can install App::EUMM::Upgrade from CPAN. Or just download version 0.21 from Github directly and install from CPAN these modules: File::Slurp Text::FindIndent Github::Fork::Parent ExtUtils::MakeMaker.

To use, run eumm-upgrade.pl in directory with Makefile.PL. Old file will be copied to Makefile.PL.bak. If you use Github repository, Internet connection is required.

You need to check resulting Makefile.PL manually as transformation is done with regular expressions.


Can it do this?

bart on 2009-12-18T10:52:31

One major problem we have had in the past is with Scalar::Util, which has 2 modes: XS mode, and PP mode. The latter did not include the functionality to create weak references, and it was the version that PPM installed. Often, that was precisely the functionality we needed the module for... Yet, the version number of Scalar::Util was the same for both... Just requiring a high enough version number for the module did not do any good.

Can your extension detect that? "We need Scalar::Util so and so and it has to include weaken"?

Re:Can it do this?

chorny on 2009-12-18T15:12:19

You have two solutions for this:
1. (best) Add Task::Weaken to BUILD_REQUIRES (or to PREREQ_PM if you don't use eumm-upgrade)
2. (new solution, may be better with ppm4) Depend on List::Util::XS