Perl5-Alien/Alien-Base — pull request #88 by plicease (2014-09-25 19:42:59+00:00)
Title: Alien bin requires

#84 was an interesting but controversial discussion.

I feel that it is at least sometimes useful to have tools in addition to libraries available as Alien modules on CPAN. Perhaps a convention such as `Alien::App::ToolFoo` should be adopted. This PR does not address that directly, but I have no objection to such a convention.

I feel that it is at least sometimes important not to install tool binaries in the global bin directory, either directly or as wrappers. `Alien::MSYS` is probably the most important example. I personally would prefer that build dependencies NOT install themselves in my PATH. That is not to say that it isn't sometimes useful to provide `Alien::` modules with wrappers or that install binaries in the PATH.

In an attempt to alleviate @mohawk2's concern about modifying the PATH, I have changed my approach to ONLY setting the PATH when commands are run via `do_system`. Instead of `use Alien::nasm` at the top of your Build.PL you add `Alien::nasm` as an alien_bin_requires. This also will make it easier to use this feature with distributions that are built using `Dist::Zilla`.

The rationale for this proposal is quite practical. It will allow single command installs `cpanm Foo::XS` to succeed when the appropriate `Alien::Libfoo` -> `Alien::ToolFoo` chain is constructed, even when it is not practical to install ToolFoo into the PATH, and when ToolFoo isn't commonly provided by platforms.

This implementation also supports a few useful `Alien::` modules already on CPAN that employ this strategy, such as `Alien::CMake`, but do not follow the exact convention that I am proposing.

As I mentioned in #84 the exact interface is still up for discussion, but I would appreciate it if any alternate suggestions take into account packages like `MSYS` where it is not appropriate to install in the PATH.

(this PR includes #86)