Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Messed '%s' value #12

Closed
ambs opened this issue Nov 22, 2019 · 5 comments
Closed

Messed '%s' value #12

ambs opened this issue Nov 22, 2019 · 5 comments

Comments

@ambs
Copy link
Contributor

ambs commented Nov 22, 2019

Hi

Accordingly with the docs, %s is "The full path to the final installed location of the share directory (builder method alien_library_destination). This is where the library should install itself; for autoconf style installs this will look like".

Nevertheless, I am getting:
./configure --prefix=/root/.cpanm/work/1574460480.32178/Alien-ImageMagick-0.07/blib/lib/auto/share/dist/Alien-ImageMagick ...

And of course that doesn't make sense.

Although the resulting files get installed in the proper place (as blib is copied) the C code from the library is configured with this specific path hardcoded, and when running, it will search for that path to get its dependencies.

Is there something I might be missing? Or is it a bug and can be fixed?
Thanks

@plicease
Copy link
Member

Indeed %s used to default to the final install location, but that could be overridden in 0.16 with the alien_stage_install option, and then in 0.17 alien_stage_install became the default. I've got a PR that updated the documentation.

To get the original behavior you can set alien_stage_install to 0. However, be aware that relies on so called blib detection; a method of determining if the Alien is being installed using a long list of blib paths in PERL5LIB, which is common in cpantesters. This detection is unfortunately inherently unreliable, and apparently buggy because I also fixed a bug in it when I was looking into this issue.

The recommend route if you need to run ./configure with the final install path is to use Alien::Build which has a more reliable system by which it stages files for install. Alien::Build also has other advantages and fewer prereqs so it isn't a bad upgrade to make anyway. Both ABMB and Alien::Build use the same runtime (Alien::Base) so the interface once the alien is installed wouldn't change.

@plicease
Copy link
Member

1.07 has both the documentation and the bug fix.

@plicease
Copy link
Member

plicease commented Nov 22, 2019

This alienfile does at least some of what the Build.PL for Alien::ImageMagick is doing. I'm not sure that it should be setting --exec-prefix so I took that out. It's not patching anything, but it might be a start.

use alienfile;
use Config;

plugin 'PkgConfig' => (
  pkg_name => 'MagickWand',
);

share {

  start_url 'http://www.imagemagick.org/download/ImageMagick.tar.gz';
  plugin 'Download';
  plugin 'Extract' => format => 'tar.gz';

  my $use_threads = $Config{usethreads} ? '' : '--without-threads';
  my $enable_shared = ( ( $Config{useshrplib} || '' ) eq 'false' ) ? '' : '--enable-shared';

  meta->prop->{env_interpolate} = 1;
  meta->prop->{env}->{LDFLAGS} = "-L%{perl.config.archlib}/CORE";

  plugin 'Build::Autoconf';

  build [
    "%{configure} --with-perl=%{perl} $enable_shared $use_threads",
    '%{make}',
    '%{make} install',
  ];

};

@ambs
Copy link
Contributor Author

ambs commented Nov 23, 2019

Hi.
I understand the reason of using %s as blib, but in fact that was not clear. To have two different variables might be useful? Well, its an idea.
ImageMagick has a flag to configure the datadir, and for the bug I was trying to solve, it did the trick.
Thank you for your time and help.
Best,
Alberto

@plicease
Copy link
Member

I understand the reason of using %s as blib, but in fact that was not clear. To have two different variables might be useful? Well, its an idea.

I suppose different variable name would have been possible, and might have been a little more clear. It's really change in behavior though, and the old behavior was problematic. The fact that that part of the documentation didn't get updated was an oversight.

ImageMagick has a flag to configure the datadir, and for the bug I was trying to solve, it did the trick.

👍 great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants