Skip to content

Commit

Permalink
hello: make sure libiconv is linked
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
reckenrode committed Oct 10, 2024
1 parent e694240 commit 42a6b87
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions pkgs/by-name/he/hello/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 42a6b87

Please sign in to comment.