Aegisub
Aegisub copied to clipboard
fix configure: dont find_library iconv on linux
in configure phase, avoid the false negative
Library iconv found: NO
instead, on linux
Checking for function "iconv_open" : YES
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".
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.
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.
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.
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...)
Done in #163