Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Can ExtUtils::MakeMaker recommend to install optional modules?

by Dallaylaen (Hermit)
on Nov 30, 2017 at 23:57 UTC ( #1204638=note: print w/replies, xml ) Need Help??


in reply to Can ExtUtils::MakeMaker recommend to install optional modules?

This article sums up dependencies pretty well.

Here's how you specify recommended/suggested dependencies:

use ExtUtils::MakeMaker 6.64; WriteMakefile( # other stuff META_MERGE => { "meta-spec" => { version => 2 }, prereqs => { test => { recommends => { 'CPAN::Meta' => '2.120900', }, }, runtime => { recommends => { 'Text::CSV_XS' => 0, }, }, }, }, );
  • Comment on Re: Can ExtUtils::MakeMaker recommend to install optional modules?
  • Download Code

Replies are listed 'Best First'.
Re^2: Can ExtUtils::MakeMaker recommend to install optional modules?
by 1nickt (Monsignor) on Dec 01, 2017 at 12:44 UTC

    Here's how you specify recommended/suggested dependencies:

    For the record: there is a difference between recommends and suggests.

    The two (and requires and conflicts) exist so the module author has more control over, well, recommendations and suggestions. Not all versions of all clients support the newest spec, but recent ones do.

    Hope this helps!


    The way forward always starts with a minimal test.
Re^2: Can ExtUtils::MakeMaker recommend to install optional modules?
by Anonymous Monk on Jan 13, 2018 at 13:27 UTC
    What if I don't want the recommended additional packages? How can I force the build to ignore the recommends? In my case a command line tool recommends, through a chain of dependencies, that I install the X server. I really don't want to do that.

      Default cpan client has recommends_policy and suggests_policy options under o conf just for that. Couldn't find anything in cpanm, but maybe it can, too. No idea about cpanplus.

      Btw installing raw CPAN on perlbrew was nontrivial, though not complicated after all. Maybe brew should bundle a script for that...

        --with-recommends, --with-suggests EXPERIMENTAL: Installs dependencies declared as recommends and suggest +s respectively, per META spec. When these dependencies fail to instal +l, cpanm continues the installation, since they're just recommendatio +n/suggestion. Enabling this could potentially make a circular dependency for a few m +odules on CPAN, when recommends adds a module that recommends back th +e module in return. There's also --without-recommend and --without-suggests to override th +e default decision made earlier in PERL_CPANM_OPT. Defaults to false for both.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1204638]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2018-07-18 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (397 votes). Check out past polls.

    Notices?