PerlAlien / Alien-curl

Discover or download and install curl + libcurl
0 stars 2 forks source link

ffi phase: copy curl-config to dynamic folder #10

Closed shawnlaffan closed 2 years ago

shawnlaffan commented 4 years ago

Proj 7.0.0 has a new dependency on libcurl. Its configure script uses the curl-config utility to set the lib paths and cflags, and it seems not to be simple to override this.

The issue is that compilation of Alien::proj with Proj 7 fails because the curl-config utility in the bin dir refers to the static build, while proj requires a dynamic build.

Copying the curl-config utility from the ffi build dir into the dynamic dir under Alien::curl->dist_dir seems to fix the issue.

I'd submit a PR now, but in looking at the code for the ffi phase in the alienfile, I'm not actually sure which of the paths refers to the build directory. If you let me know what the best way to get the build dir then I can work up a PR if needed.

Thanks, Shawn.

plicease commented 4 years ago

Interesting, by default we drop everything that doesn't go into the dynamic directory for the ffi phase, as it usually isn't useful for FFI. Maybe we we can install the curl-config to install into the dynamic directory too? FFI::CheckLib should correctly ignore executables that go into the dynamic directory.

For now at least I want the curl-config in bin to be the static version.

Proj will have to be careful to link dynamic directories correctly, when the libraries aren't in the standard system library directories. The exact incantations aren't portable which is one of the reasons Alien-Build avoids doing it. Alien-Role-Dino supports this for some platforms (ARD is only useful Perl, but it is illustrative of some of the hoops that you have to jump through). I'm not familiar with Proj, so I don't know if portability is a concern, or if maybe you don't want to worry about that right now, but it is something to consider.

plicease commented 4 years ago

If we do install the curl-config into the dynamic directory, we can add an accessor maybe dynamic_bin_dir that returns the appropriate path.

shawnlaffan commented 4 years ago

I think the end result will be a curl-config in each of the bin and dynamic directories. The two have different values for several of the parameters.

System libs I'll have to deal with when I get to them. A curl-config probe in Alien::proj could indicate if the system curl is static, in which case Alien::proj might need to complain that a share build is needed to get the dynamic version. I'll look at Alien-Role-Dino as well.

A dynamic_bin_dir accessor would be handy.

plicease commented 4 years ago

I think the end result will be a curl-config in each of the bin and dynamic directories. The two have different values for several of the parameters.

connect, just to be clear this is what my suggestion was intending.

System libs I'll have to deal with when I get to them. A curl-config probe in Alien::proj could indicate if the system curl is static, in which case Alien::proj might need to complain that a share build is needed to get the dynamic version. I'll look at Alien-Role-Dino as well.

ARD is just for background. But worth reviewing it has some commentary about the challenges with share install dynamic libs.

A dynamic_bin_dir accessor would be handy.

👍

plicease commented 2 years ago

I think we are done here? or at least some work has been done here, so if more work needs doing lets open a new ticket for that.