@@ -1,5 +1,8 @@
1−{ stdenv, fetchurl, bzip2
2−, enableNLS ? false, libnatspec }:
1+{ stdenv, fetchurl
2+, bzip2
3+, enableNLS ? false, libnatspec
4+, buildPlatform, hostPlatform
5+}:
36
47stdenv.mkDerivation {
58 name = "unzip-6.0";
@@ -25,14 +28,15 @@ stdenv.mkDerivation {
2528 url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-arch/unzip/files/unzip-6.0-natspec.patch?revision=1.1";
2629 name = "unzip-6.0-natspec.patch";
2730 sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1";
28− });
31+ })
32+ ++ stdenv.lib.optional (hostPlatform != buildPlatform) ./cross-cc.patch;
2933
3034 nativeBuildInputs = [ bzip2 ];
3135 buildInputs = [ bzip2 ] ++ stdenv.lib.optional enableNLS libnatspec;
3236
3337 makefile = "unix/Makefile";
3438
35− NIX_LDFLAGS = [ "-lbz2" ] ++ stdenv.lib.optional enableNLS "-lnatspec";
39+ ${"NIX_${stdenv.cc.infixSalt_}LDFLAGS"} = [ "-lbz2" ] ++ stdenv.lib.optional enableNLS "-lnatspec";
3640
3741 buildFlags = "generic D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2";
3842