tokuhirom / plenv

Perl binary manager
Other
516 stars 71 forks source link

Feature Request: Default Configuration #150

Closed theory closed 6 years ago

theory commented 6 years ago

I'd love to be able to edit a file to set Configure options that would be passed by default unless overridden on the command line. Something like:

-Duseshrplib
-Dusemultiplicity

These would then be passed unless the corresponding -D was passed to install.

Grinnz commented 6 years ago

I would suggest to implement this by adding an environment variable to be recognized by Perl::Build like PERL_PERLBUILD_OPT, which could then be set in whatever way is convenient for you.

theory commented 6 years ago

Well I only needed from and building a new version of Perl. I wouldn’t want it set in my shell all the time. Seems silly.

Grinnz commented 6 years ago

There's not much functional difference between adding these options to an arbitrary file and adding them to your .bashrc, but the latter gives more flexibility in how they can be used and is easier to implement.

miyagawa commented 6 years ago

plenv allows you to put arbitrary commands in ~/.plenv/libexec where you can just place a script (bash or perl or whatever) to invoke plenv-install with the arguments you like.

theory commented 6 years ago

Is there an example of that, @miyagawa? Is it just this?

#!env bash
set -e
plenv-install -Duseshrplib -Dusemultiplicity
miyagawa commented 6 years ago

I'd do exec plenv-install ... $@ but yeah, i just tried it and it worked as i would expect :)

theory commented 6 years ago
#!/usr/bin/env bash
#
# Summary: Build a Perl version with customized Configure options.
#
# Usage: plenv build [-v|--verbose] <version>
#

set -e
[ -n "$PLENV_DEBUG" ] && set -x

exec plenv install  -Duseshrplib -Dusemultiplicity $@

Cool, thanks!