@@ -1,4 +1,9 @@
1−{ stdenv, fetchurl, lzip }:
1+{ stdenv
2+, fetchurl, lzip
3+, hostPlatform, buildPlatform
4+}:
5+
6+let inherit (stdenv.lib) optionals; in
27
38stdenv.mkDerivation rec {
49 name = "ddrescue-1.22";
@@ -10,7 +15,12 @@ stdenv.mkDerivation rec {
1015
1116 nativeBuildInputs = [ lzip ];
1217
13− doCheck = true;
18+ doCheck = hostPlatform == buildPlatform;
19+
20+ ${if hostPlatform != buildPlatform then "crossPlatforms" else null} = [ ];
21+ ${if hostPlatform != buildPlatform then "configureFlags" else null} = [
22+ "CXX=${stdenv.cc.prefix}c++"
23+ ];
1424
1525 meta = with stdenv.lib; {
1626 description = "GNU ddrescue, a data recovery tool";