summary refs log tree commit diff
path: root/pkgs/tools/system/ddrescue/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/tools/system/ddrescue/default.nix')
-rw-r--r--pkgs/tools/system/ddrescue/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/tools/system/ddrescue/default.nix b/pkgs/tools/system/ddrescue/default.nix
index 3dcbf59d4d7d..0b94f328b84a 100644
--- a/pkgs/tools/system/ddrescue/default.nix
+++ b/pkgs/tools/system/ddrescue/default.nix
@@ -1,4 +1,9 @@
-{ stdenv, fetchurl, lzip }:
+{ stdenv
+, fetchurl, lzip
+, hostPlatform, buildPlatform
+}:
+
+let inherit (stdenv.lib) optionals; in
 
 stdenv.mkDerivation rec {
   name = "ddrescue-1.22";
@@ -10,7 +15,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ lzip ];
 
-  doCheck = true;
+  doCheck = hostPlatform == buildPlatform;
+
+  ${if hostPlatform != buildPlatform then "crossPlatforms" else null} = [ ];
+  ${if hostPlatform != buildPlatform then "configureFlags" else null} = [
+    "CXX=${stdenv.cc.prefix}c++"
+  ];
 
   meta = with stdenv.lib; {
     description = "GNU ddrescue, a data recovery tool";