From 946c1b26fa76503110c866f5469ec71b19a509bb Mon Sep 17 00:00:00 2001
From: Ben Gamari <ben@smart-cactus.org>
Date: Sat, 9 Dec 2017 14:48:13 -0500
Subject: [PATCH] diffutils: Enable cross-compilation

---
 pkgs/tools/text/diffutils/default.nix | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pkgs/tools/text/diffutils/default.nix b/pkgs/tools/text/diffutils/default.nix
index cd64bd1566b5..60628e2139ce 100644
--- a/pkgs/tools/text/diffutils/default.nix
+++ b/pkgs/tools/text/diffutils/default.nix
@@ -17,7 +17,8 @@ stdenv.mkDerivation rec {
   configureFlags =
     # "pr" need not be on the PATH as a run-time dep, so we need to tell
     # configure where it is. Covers the cross and native case alike.
-    stdenv.lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr";
+    stdenv.lib.optional (coreutils != null) "PR_PROGRAM=${coreutils}/bin/pr"
+    ++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "gl_cv_func_getopt_gnu=yes";
 
   meta = {
     homepage = http://www.gnu.org/software/diffutils/diffutils.html;