summary refs log tree commit diff
path: root/pkgs/tools/text/gnupatch/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/text/gnupatch/default.nix')
-rw-r--r--pkgs/tools/text/gnupatch/default.nix13
1 files changed, 8 insertions, 5 deletions
diff --git a/pkgs/tools/text/gnupatch/default.nix b/pkgs/tools/text/gnupatch/default.nix
index adbd69154ecc..57543eb303b0 100644
--- a/pkgs/tools/text/gnupatch/default.nix
+++ b/pkgs/tools/text/gnupatch/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, ed }:
+{ stdenv, fetchurl
+, ed
+, buildPlatform, hostPlatform
+}:
 
 stdenv.mkDerivation rec {
   name = "patch-2.7.5";
@@ -10,11 +13,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = stdenv.lib.optional doCheck ed;
 
-  crossAttrs = {
-    configureFlags = [ "ac_cv_func_strnlen_working=yes" ];
-  };
+  configureFlags = if hostPlatform == buildPlatform then null else [
+    "ac_cv_func_strnlen_working=yes"
+  ];
 
-  doCheck = true;
+  doCheck = hostPlatform == buildPlatform;
 
   meta = {
     description = "GNU Patch, a program to apply differences to files";