This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id:
23281
Status:
resolved
Priority:
Low/Low
Queue:

People
Owner:
Nobody in particular
Requestors:
ambs [...] cpan.org
Cc:
AdminCc:

BugTracker
Severity:
Wishlist
Broken in:
(no value)
Fixed in:
(no value)



Subject: Passing parameters to Makefile.PL
Hi I think this doesn't exist at the moment on CPAN::Shell. Suppose I want to install DBD::SQLite and I have sqlite installed in a strange directory. The way to install it is perl Makefile.PL WITH_SQLITE=/path/to/sqlite (ok, the parameter name is not WITH_SQLITE but I do not remember it right now). It would be great if I could use install('DBD::SQLite', "WITH_SQLITE=/path/to/sqlite"); At the moment what I do is to change at run-time the configuration hash changing the variable where 'PREFIX' is normally defined. Also, I am not sure the syntax I used could be done. I think install receives a list of modules to install, right? Cheers ambs
Subject: Re: [rt.cpan.org #23281] Passing parameters to Makefile.PL
Date: Tue, 14 Nov 2006 23:07:32 +0100
To: bug-CPAN@rt.cpan.org
From: andreas.koenig.gmwojprw@franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Tue, 14 Nov 2006 14:46:13 -0500, "Alberto Simões via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> Hi
Show quoted text
> I think this doesn't exist at the moment on CPAN::Shell. Suppose I want > to install DBD::SQLite and I have sqlite installed in a strange > directory. The way to install it is
Show quoted text
> perl Makefile.PL WITH_SQLITE=/path/to/sqlite
Yes! With version 1.89 you will be able to do this. With 1.88_xx you can also but I may still change the mechanism a little if necessary. Get 1.88_62 and read the distroprefs/00.README file. You would write a YAML file something like this (untested, off the top of my head): --- match: distribution: "^MSERGEANT/DBD-SQLite-1" pl: args: - WITH_SQLITE=/path/to/sqlite You would store that in your prefs_dir folder (try 'o conf init /prefs/') and from then on you're settled on the installation of DBD::SQLite. Until Matt comes with 2.00 or a new syntax. Is that what you want to suggest? I'm very enthusiastic about this innovation but I fear it will still take a few weeks to get it out of alpha stage. See the 60 or so other YAML files in distroprefs that specify specific needs of specific distributions or modules. -- andreas
I didn't test yet that CPAN version. I think that your solution can solve my problem, but I give you more details here, so you can see if there is any easier solution. I am using a cluster and they do not install the Perl module I want worldwide. Thus, I have an installation script (installs some C libraries and a lot of Perl modules). Thus, if someone else wants to try my software I just give them my script and it will install everything. Thus, I have a lot of lines like these: install "XML::LibXML"; install "XML::DT"; install "XML::TMX"; install "File::Spec"; install "DBI"; $CPAN::Config->{'makepl_arg'} = q[PREFIX=~/usr SQLITE_LOCATION="$HOME/usr"]; install "DBD::SQLite"; Of course I can add a yaml file with the details in the tarball, but if I had some: install "DBD::SQLite", q[SQLITE_LOCATION="$HOME/url"] would be more readable. Another option would be to add a different function name. Cheers
Subject: Re: [rt.cpan.org #23281] Passing parameters to Makefile.PL
Date: Wed, 15 Nov 2006 22:50:22 +0100
To: bug-CPAN@rt.cpan.org
From: andreas.koenig.gmwojprw@franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Wed, 15 Nov 2006 14:36:11 -0500, "Alberto Simões via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
> Queue: CPAN > Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=23281 >
Show quoted text
> I didn't test yet that CPAN version. I think that your solution can > solve my problem, but I give you more details here, so you can see if > there is any easier solution.
Show quoted text
> I am using a cluster and they do not install the Perl module I want > worldwide. Thus, I have an installation script (installs some C > libraries and a lot of Perl modules). Thus, if someone else wants to try > my software I just give them my script and it will install everything.
Show quoted text
> Thus, I have a lot of lines like these:
Show quoted text
> install "XML::LibXML"; > install "XML::DT"; > install "XML::TMX"; > install "File::Spec"; > install "DBI";
Show quoted text
> $CPAN::Config->{'makepl_arg'} = q[PREFIX=/usr SQLITE_LOCATION="$HOME/usr"];
What? This does of course not work, you probably meant cpan[4]> ! $CPAN::Config->{'makepl_arg'} = qq[PREFIX=$ENV{HOME}/usr SQLITE_LOCATION="$ENV{HOME}/usr"] cpan[4]> o conf makepl_arg makepl_arg [PREFIX=/home/k/usr SQLITE_LOCATION="/home/k/usr"]
Show quoted text
> install "DBD::SQLite";
Yes, this seems like a cute alternative. I never used it myself because I'm unhappy when I have to reset the makepl_arg after the command with a new value.
Show quoted text
> Of course I can add a yaml file with the details in the tarball, but if > I had some:
Show quoted text
> install "DBD::SQLite", q[SQLITE_LOCATION="$HOME/url"]
Show quoted text
> would be more readable. > Another option would be to add a different function name.
I see what you mean, but if the above works for you, you're probably satisfied? -- andreas
Subject: Re: [rt.cpan.org #23281] Passing parameters to Makefile.PL
Date: Thu, 16 Nov 2006 09:07:44 +0100
To: bug-CPAN@rt.cpan.org
From: andreas.koenig.gmwojprw@franz.ak.mind.de (Andreas J. Koenig)
Show quoted text
>>>>> On Wed, 15 Nov 2006 16:50:50 -0500, "andreas.koenig.gmwojprw@franz.ak.mind.de via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
>> $CPAN::Config->{'makepl_arg'} = q[PREFIX=/usr SQLITE_LOCATION="$HOME/usr"];
Show quoted text
> What? This does of course not work, you probably meant
Sorry, I was too tired yesterday evening:-(
Show quoted text
>> Of course I can add a yaml file with the details in the tarball, but if >> I had some:
Show quoted text
>> install "DBD::SQLite", q[SQLITE_LOCATION="$HOME/url"]
Show quoted text
>> would be more readable. >> Another option would be to add a different function name.
It's probably doable already by writing rather long lines like get DBD::SQLite ! CPAN::Shell->expandany("DBD::SQLite")->distribution->{prefs}{pl}{args}[0] = "SQLITE_LOCATION=/tmp/bar") install DBD::SQLite This is again less readable but should work at the moment. Maybe I would even officially support it, I'm not yet sure. But isn't it ugly and unmaintainable to bet on one single line? Your alternative syntax will also demand very long lines if you try to support arguments to all four incantations of the CPAN mantra, environment variables and answers to dialogs and timeouts and cpan config variables that need to be changed temporarily, like $CPAN::Config->{make} and differing behaviour depending on the perl version that you're running under, etc. -- andreas
1.89 coming closer, time to close bugs


This service runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.