2012-02-09 14:09:08 +00:00
|
|
|
{ stdenv, fetchurl, zlib }:
|
2007-11-11 16:19:00 +00:00
|
|
|
|
2012-02-09 14:09:08 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2014-02-24 20:31:42 +00:00
|
|
|
name = "libzip-0.11.2";
|
2015-04-06 11:11:51 +01:00
|
|
|
|
2009-04-22 00:18:09 +01:00
|
|
|
src = fetchurl {
|
2012-02-09 14:09:08 +00:00
|
|
|
url = "http://www.nih.at/libzip/${name}.tar.gz";
|
2014-02-24 20:31:42 +00:00
|
|
|
sha256 = "1mcqrz37vjrfr4gnss37z1m7xih9x9miq3mms78zf7wn7as1znw3";
|
2009-04-22 00:18:09 +01:00
|
|
|
};
|
2015-04-06 11:11:51 +01:00
|
|
|
|
2016-04-25 12:51:29 +01:00
|
|
|
outputs = [ "dev" "out" ];
|
|
|
|
|
2015-04-06 11:11:51 +01:00
|
|
|
# fix CVE-2015-2331 taken from Debian patch:
|
|
|
|
# https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=12;filename=libzip-0.11.2-1.2-nmu.diff;att=1;bug=780756
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace lib/zip_dirent.c --replace \
|
|
|
|
'else if ((cd->entry=(struct zip_entry *)' \
|
|
|
|
'else if (nentry > ((size_t)-1)/sizeof(*(cd->entry)) || (cd->entry=(struct zip_entry *)'
|
|
|
|
cat lib/zip_dirent.c
|
|
|
|
'';
|
|
|
|
|
2012-02-09 14:22:13 +00:00
|
|
|
propagatedBuildInputs = [ zlib ];
|
2007-11-11 16:19:00 +00:00
|
|
|
|
2012-02-28 16:26:55 +00:00
|
|
|
# At least mysqlWorkbench cannot find zipconf.h; I think also openoffice
|
|
|
|
# had this same problem. This links it somewhere that mysqlworkbench looks.
|
|
|
|
postInstall = ''
|
2016-04-25 12:51:29 +01:00
|
|
|
( cd $dev/include ; ln -s ../lib/libzip/include/zipconf.h zipconf.h )
|
2012-02-28 16:26:55 +00:00
|
|
|
'';
|
|
|
|
|
2009-04-22 00:18:09 +01:00
|
|
|
meta = {
|
|
|
|
homepage = http://www.nih.at/libzip;
|
|
|
|
description = "A C library for reading, creating and modifying zip archives";
|
|
|
|
};
|
2007-11-11 16:19:00 +00:00
|
|
|
}
|