From 09e702a5058d50a582443276fd4efcd84ca1a19e Mon Sep 17 00:00:00 2001 From: Alyssa Ross Date: Fri, 20 Jan 2023 21:13:57 +0000 Subject: [PATCH] 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. --- pkgs/tools/filesystems/fatsort/default.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/filesystems/fatsort/default.nix b/pkgs/tools/filesystems/fatsort/default.nix index d4ef4c744da4..2ca135704e0c 100644 --- a/pkgs/tools/filesystems/fatsort/default.nix +++ b/pkgs/tools/filesystems/fatsort/default.nix @@ -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)