summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-01-20 21:13:57 +0000
committerAlyssa Ross <hi@alyssa.is>2023-01-25 19:31:46 +0000
commit09e702a5058d50a582443276fd4efcd84ca1a19e (patch)
tree4153df833115901f1a378dca1c4c7de98626c0ff
parent3151d1affcddc2b0d1a8edbbe3d9a21b43eb0a6b (diff)
downloadnixpkgs-09e702a5058d50a582443276fd4efcd84ca1a19e.tar
nixpkgs-09e702a5058d50a582443276fd4efcd84ca1a19e.tar.gz
nixpkgs-09e702a5058d50a582443276fd4efcd84ca1a19e.tar.bz2
nixpkgs-09e702a5058d50a582443276fd4efcd84ca1a19e.tar.lz
nixpkgs-09e702a5058d50a582443276fd4efcd84ca1a19e.tar.xz
nixpkgs-09e702a5058d50a582443276fd4efcd84ca1a19e.tar.zst
nixpkgs-09e702a5058d50a582443276fd4efcd84ca1a19e.zip
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.
-rw-r--r--pkgs/tools/filesystems/fatsort/default.nix6
1 files changed, 4 insertions, 2 deletions
diff --git a/pkgs/tools/filesystems/fatsort/default.nix b/pkgs/tools/filesystems/fatsort/default.nix
index d4ef4c744da..2ca135704e0 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)