-
Notifications
You must be signed in to change notification settings - Fork 48
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
How to build a perl module that is built using configure script on Linux? #138
Comments
One approach is to use the same environment we use when building all the external libraries. Docker config: https://github.com/StrawberryPerl/spbuild/tree/gcc13 The build process takes a long time but it is possible to download and re-use the existing build artefacts. https://github.com/StrawberryPerl/build-extlibs/releases/tag/dev_gcc13.1_20230606 (the one to use should be the extlibs_gcc_r5.tar file). Extract to the It should also be possible to use an msys2 shell and set the PATH, PKG_CONFIG_PATH etc variables to point to the strawberry perl tree so it uses the compiler and other libs that come with strawberry perl. This is essentially the approach used by Alien::Build. Alien::ImageMagick seems not to use it, though, which might explain its test failures (I have not looked closely). Alternately Alien::ImageMagick could be updated to use Alien::Build, or an A::B variant could be developed. |
Although both the MSYS2 and Alien::Build approaches will need to account for the additional dependencies. The MSYS2 build system lists cairo as a build time dependencies and glib2 as a runtime. Things might get complex quickly. Another approach is to adapt the one described by @sisyphus in https://www.perlmonks.org/?node_id=11153998 |
IIUC, it should be pretty much the same with Strawberry Perl, but you'll be running the commands in the MSYS2 shell.
I take it that the You would want to ensure that, in the MSYS2 shell, And I would think that the Then just follow the the instructions for building Perl-Magick against that library, using Strawberry Perl. If you can tell me how I can obtain the exact same ImageMagick source as you're using, I'll give it a go. If you're unfamiliar with the MSYS2 shell, note that it sometimes doesn't understand Windows paths like (eg) Cheers, |
Thanks @sisyphus Some good points there. If the WRT paths, MSYS2 can understand windows paths but they need to be quoted, e.g. |
Heh - I always thought the rule would be pretty simple, but I never got around to working out exactly what it was. For
Oops - updated to also demonstrate use of single quotes on the command line. Cheers, |
They probably get eaten as they pass through multiple levels of shell or shell commands, not unlike when calling |
@sisyphus I am using the github main branch: https://github.com/ImageMagick/ImageMagick |
@shawnlaffan I believe the perl version is required at runtime also. On linux, when you build XS modules the .so file contains handshake keys that make it impossible to load the module with a different perl version. |
Doesn't build straight out of the box for me.
Eventually it terminates with:
Digging back into my past, I can see that I had not built the ImageMagick library. Cheers, |
Refer to https://stackoverflow.com/q/77226662/2173773. On Linux I can build Image::Magic using the following commands:
What should I do to build this module with Strawberry Perl?
The text was updated successfully, but these errors were encountered: