From 85a18cf3fec8da4d1411c4d70bc45ed70d99b667 Mon Sep 17 00:00:00 2001 From: Julien Moutinho Date: Tue, 19 Oct 2021 21:11:38 +0200 Subject: [PATCH] nmon: fix cross-compiling --- pkgs/os-specific/linux/nmon/default.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/nmon/default.nix b/pkgs/os-specific/linux/nmon/default.nix index 7ec84443cfe8..18adf9c69057 100644 --- a/pkgs/os-specific/linux/nmon/default.nix +++ b/pkgs/os-specific/linux/nmon/default.nix @@ -11,7 +11,13 @@ stdenv.mkDerivation rec { buildInputs = [ ncurses ]; dontUnpack = true; - buildPhase = "cc -o nmon ${src} -g -O2 -D JFS -D GETUSER -Wall -D LARGEMEM -lncurses -lm -g -D X86"; + buildPhase = "${stdenv.cc.targetPrefix}cc -o nmon ${src} -g -O2 -D JFS -D GETUSER -Wall -D LARGEMEM -lncurses -lm -g -D ${ + with stdenv.targetPlatform; + if isx86_32 || isx86_64 then "X86" + else if isAarch32 || isAarch64 then "ARM" + else if isPower then "POWER" + else "UNKNOWN" + }"; installPhase = '' mkdir -p $out/bin cp nmon $out/bin