Perl5-Alien / Alien-Base

Base classes for Alien:: modules (deprecated, see Alien-Build)
Other
35 stars 19 forks source link

Aliens with tree like dependency #95

Closed zmughal closed 7 years ago

zmughal commented 9 years ago

On such package that was pointed out to me here is Alien::SDL2. It has to work with multiple libraries to build.

plicease commented 9 years ago

First way is to decompose Alien::Foo into Alien::Foo depends on Alien::Bar. This has an advantage if Alien::Bar is likely to be used by other modules. It has complexities though, if Alien::Bar is upgraded in an incompatible manner.

Another approach is to make alien_repository or something like it a list of packages that needs to be downloaded and installed. Each would have its own alien_build_commands and alien_install_commands.

jberger commented 9 years ago

I would vote on decomposing it into multiple modules personally. That model is consistent and broad-reaching. Trying to make allowances for multiple build phases in a single pass would only lead to more complexity in AB. I'm not saying I would veto, but I would want to see a well thought out proposal for the latter.

On Tue, Dec 16, 2014 at 4:23 PM, Graham Ollis notifications@github.com wrote:

First way is to decompose Alien::Foo into Alien::Foo depends on Alien::Bar. This has an advantage if Alien::Bar is likely to be used by other modules. It has complexities though, if Alien::Bar is upgraded in an incompatible manner.

Another approach is to make alien_repository or something like it a list of packages that needs to be downloaded and installed. Each would have its own alien_build_commands and alien_install_commands.

— Reply to this email directly or view it on GitHub https://github.com/Perl5-Alien/Alien-Base/issues/95#issuecomment-67243920 .

mohawk2 commented 9 years ago

I would like to see effectively a "build_requires" capability that if not satisfied, could still be installed into blib. @plicease, what do you think?

If we decide this is the way forward, we need something like a spec, with docs, and a test (including the relevant Acme modules incorporating this).

plicease commented 9 years ago

@jberger i tend to agree, especially where packages are reusable but it is not always the best solution. giving the Alien::Foo author the option of what @mohawk2 may just be more practical in some situations. examples: where specific versions are required or where dependencies are typically only used by the one alien module.

Composition isn't something that really works at the moment with AB I would like to see some progress on that as well.

plicease commented 7 years ago

I have a working example prototype for how you can do dependency with alienfile:

https://github.com/plicease/Alien-Libarchive2/blob/6a15940f2081408dd62ed0421b560aa5c578625f/alienfile

Alien::Build already handles this if the dependent project provides a .pc file, and the project that you are alienizing uses the .pc file. Unfortunately many projects have broken .pc files, and so many other projects just look for things in the default locations instead. The above example works around this, which demonstrates the workability, but what is interesting here is that the example should be pretty easy to generalize as a plugin. Good thing, since it is a little unwieldy. Once such a plugin is available, I think we can close this issue!

plicease commented 7 years ago

I believe this addresses the problem for autoconf:

https://metacpan.org/pod/Alien::Build::Plugin::Build::SearchDep

example is here:

https://metacpan.org/source/PLICEASE/Alien-Libarchive3-0.28_02/alienfile