fatsort: fix build for cross FreeBSD

libiconv is already defined per-platform.  The actual libiconv library
won't be built on platforms like Linux where it doesn't need to be, so
there's no need to maintain a separate platform list here.

We have to override the uname values, or they'll be detected for the
build platform, because the build system just runs uname(1).

Tested by cross compiling to x86_64-freebsd from x86_64-linux.
This commit is contained in:
Alyssa Ross 2023-01-20 21:13:57 +00:00
parent 3151d1affc
commit 09e702a505
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -14,12 +14,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-mm+JoGQLt4LYL/I6eAyfCuw9++RoLAqO2hV+CBBkLq0=";
};
buildInputs = [ help2man ]
++ lib.optionals stdenv.isDarwin [ libiconv ];
buildInputs = [ help2man libiconv ];
makeFlags = [
"CC=${stdenv.cc.targetPrefix}cc"
"LD=${stdenv.cc.targetPrefix}cc"
"UNAME_O=${stdenv.hostPlatform.uname.system}"
"UNAME_S=${stdenv.hostPlatform.uname.system}"
];
# make install target is broken (DESTDIR usage is insane)