hello: make sure libiconv is linked

Because the Darwin SDK automatically propagates libiconv, it is no
longer linked automatically (because that would link libiconv to
everything whether it wanted it or not).

hello is failing to link not because it assumes libiconv comes with
libc but because of a bug in its build system. The `configure` script
detects how to link libiconv, but `Makefile.am` does not make use of
that to link libiconv when it is needed.

Unfortunately, patching `Makefile.am` can’t be done because using
`autoreconfHook` will update some gettext stuff with an incompatible
version, causing an error when building.
This commit is contained in:
Randy Eckenrode
2024-09-21 08:34:44 -04:00
parent e694240f77
commit 42a6b873a6

View File

@@ -17,6 +17,13 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-jZkUKv2SV28wsM18tCqNxoCZmLxdYH2Idh9RLibH2yA=";
};
# The GNU Hello `configure` script detects how to link libiconv but fails to actually make use of that.
# Unfortunately, this cannot be a patch to `Makefile.am` because `autoreconfHook` causes a gettext
# infrastructure mismatch error when trying to build `hello`.
env = lib.optionalAttrs stdenv.hostPlatform.isDarwin {
NIX_LDFLAGS = "-liconv";
};
doCheck = true;
doInstallCheck = true;