unzip: Fix for cross

This commit is contained in:
John Ericson 2017-06-04 17:50:36 -04:00 committed by John Ericson
parent d710c2d943
commit bef622a4e8
2 changed files with 20 additions and 4 deletions

View File

@ -0,0 +1,12 @@
--- a/unix/Makefile
+++ b/unix/Makefile
@@ -42,9 +42,7 @@
# such as -DDOSWILD).
# UnZip flags
-CC = cc# try using "gcc" target rather than changing this (CC and LD
LD = $(CC)# must match, else "unresolved symbol: ___main" is possible)
-AS = as
LOC = $(D_USE_BZ2) $(LOCAL_UNZIP)
AF = $(LOC)
CFLAGS = -O

View File

@ -1,5 +1,8 @@
{ stdenv, fetchurl, bzip2
, enableNLS ? false, libnatspec }:
{ stdenv, fetchurl
, bzip2
, enableNLS ? false, libnatspec
, buildPlatform, hostPlatform
}:
stdenv.mkDerivation {
name = "unzip-6.0";
@ -25,14 +28,15 @@ stdenv.mkDerivation {
url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/app-arch/unzip/files/unzip-6.0-natspec.patch?revision=1.1";
name = "unzip-6.0-natspec.patch";
sha256 = "67ab260ae6adf8e7c5eda2d1d7846929b43562943ec4aff629bd7018954058b1";
});
})
++ stdenv.lib.optional (hostPlatform != buildPlatform) ./cross-cc.patch;
nativeBuildInputs = [ bzip2 ];
buildInputs = [ bzip2 ] ++ stdenv.lib.optional enableNLS libnatspec;
makefile = "unix/Makefile";
NIX_LDFLAGS = [ "-lbz2" ] ++ stdenv.lib.optional enableNLS "-lnatspec";
${"NIX_${stdenv.cc.infixSalt_}LDFLAGS"} = [ "-lbz2" ] ++ stdenv.lib.optional enableNLS "-lnatspec";
buildFlags = "generic D_USE_BZ2=-DUSE_BZIP2 L_BZ2=-lbz2";