http://qs321.pair.com?node_id=595168

skazat has asked for the wisdom of the Perl Monks concerning the following question:

I'm trying to build the pure perl version of version.pm in the cpan shell.

According to the README, it says you can do this by:

 
This release includes an optional pure Perl implementation (in case
you don't have a C-compiler or if some reason you want your code to be
much slower).  You can test it by calling the build script as

    $ perl Build.PL --perl_only

and it will install the Perl only version.

OR

To install with ExtUtils::MakeMaker:

   $ perl Makefile.PL
   $ make
   $ make test
   # make install

and correspondingly

   $ perl Makefile.PL --perl_only

will install the Perl only version.

Is there a way to send this paramater to whatever utility is used to build the module, while in the CPAN shell?

Something like:

cpan> install version --perl_only
(which, obviously, doesn't work) I'm guessing this may have to do with tweaking the conf makepl_arg stuff, which wouldn't be the worst thing to have to do.

Any clues?

 

-justin simoni
skazat me

Replies are listed 'Best First'.
Re: CPAN shell - passing params for module installation
by monarch (Priest) on Jan 18, 2007 at 08:32 UTC

    I do it this way after starting perl -mCPAN -e 'CPAN::shell':
    o conf makepl_arg arguments
    install package

    So in your case you might write a script to start Perl as above and then feed in:

    o conf makepl_arg --perl_only install version
    or similar.

    I've done this with an automated installer that uses the GD module (which requires -options JPEG,PNG,GIF fed to the makefile) and the libwww-perl module (which required -n to be fed to the makefile).

      o conf makepl_arg --perl_only

      If there are dependencies that CPAN has to build first, that will get passed to all of their Makefile.PL's, too.

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      o conf makepl_arg --perl_only

      Seems to do the job, I was trying something like:

      o conf makepl_arg PREFIX=--perl_only

      But that didn't work.

      Argh! The problem is, I'm already passing something like this to the CPAN shell:

      o conf makepl_arg LIB=/path/to/my/distros/perllib

      When you set the "--perl_only" paramater, it erases the "LIB=" paramater.

      I guess I have to figure out how to pass both configuration thingies.

       

      -justin simoni
      skazat me

        Shouldn't putting them all on one line work? Like
        o conf makepl_arg LIB=/path/to/my/distros/perllib PREFIX=--perl_only

        Update: Or edit ~/.cpan/CPAN/MyConfig.pm directly and set the things you need from there.

        -- Hofmator

        Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Re: CPAN shell - passing params for module installation
by randyk (Parson) on Jan 18, 2007 at 05:17 UTC
    If you anticipate having to do this more than once for a given package, it may be worth looking at DistroPrefs in the current development CPAN.pm version.

      DistroPrefs looks very cool for something I am attempting. Looks like time to get involved with the development of CPAN.pm, even if it's just to encourage this functionality to get into the stable release.

      --

      Oh Lord, won’t you burn me a Knoppix CD ?
      My friends all rate Windows, I must disagree.
      Your powers of persuasion will set them all free,
      So oh Lord, won’t you burn me a Knoppix CD ?
      (Missquoting Janis Joplin)

      Interesting, if complicated sounding. Looks like support is only in a dev release, but I'll make a mental not about it for the future;

       

      -justin simoni
      skazat me

Re: CPAN shell - passing params for module installation
by Anonymous Monk on Jan 18, 2007 at 04:14 UTC

      OK, so you do that command, to open up a shell, *within* the cpan shell, manually install it with the paramater --perl_only *and* any other parameters I set in the cpan shell -

      That's not obvious AT ALL, but I appreciate the pointers. Maybe next time, post, not anonymously and perhaps a bit more friendly? I'm a friendly guy, this is a friendly place.

       

      -justin simoni
      skazat me

        Maybe next time, post, not anonymously and perhaps a bit more friendly?
        like this perhaps?
        perl -le 'print map{pack c,($-++?1:13)+ord}split//,"ESEL\c_:,("'

        ;-)

        --shmem

        update: the Anonymous Monk wasn't me.

        _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                      /\_¯/(q    /
        ----------------------------  \__(m.====·.(_("always off the crowd"))."·
        ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

      This works as long as dependencies are all installed. Otherwise, you'll get missing dependency complaints and will have to go back to CPAN to install them. It's a mess.

      -xdg

      Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

        Otherwise, you'll get missing dependency complaints and will have to go back to CPAN to install them. It's a mess.
        Eh
        cpan> test version cpan> look version ...