Aegisub icon indicating copy to clipboard operation
Aegisub copied to clipboard

fix configure: dont find_library iconv on linux

Open milahu opened this issue 2 years ago • 6 comments

in configure phase, avoid the false negative

Library iconv found: NO

instead, on linux

Checking for function "iconv_open" : YES 

milahu avatar Jun 27 '22 17:06 milahu

There's a general solution to this problem (I know because I wrote it :smile:): https://mesonbuild.com/Dependencies.html#iconv

This does require bumping the minimum version of Meson. It also allows using proper subproject fallback instead of the current "check it as not-required, then manually subproject() if needed".

eli-schwartz avatar Jul 07 '22 03:07 eli-schwartz

Yeah, I'd love to use that but it seems quite harsh to mandate 0.63 (especially given it actually broke things with the subprojects). I guess I could change the logic based on the Meson version to use the preferred way when possible.

CoffeeFlux avatar Jul 07 '22 03:07 CoffeeFlux

But this only requires 0.60.0 though. :)

Bumping the requirements to something not available in e.g. the latest stable release of Debian, is a valid concern (users can pip install a newer meson, but the one installed by dpkg won't work for this).

Bumping the requirements to something that broke the cmake subproject use here, is not a concern because you don't have to.

eli-schwartz avatar Jul 07 '22 03:07 eli-schwartz

Oh it's in 0.60, gotcha. I guess it'll be another year before we get a new Debian stable? I'll have to think about whether I want to go past that in a version bump, but at the very least I think using the better logic when available is a clear win.

CoffeeFlux avatar Jul 07 '22 03:07 CoffeeFlux

I guess you could use if meson.version().version_compare('>=0.60.0') and use the new dependency logic, and on older versions fall back to the current code snippet, which is inefficient but works (it would be better if it compiled a test code snippet to see if it is builtin, and then tried again to compile it with a dependency on the iconv found library, but the reason I added this directly to meson 0.60.0 is so that users don't need to play these shenanigans...)

eli-schwartz avatar Jul 07 '22 03:07 eli-schwartz

Done in #163

eli-schwartz avatar Jul 07 '22 04:07 eli-schwartz