2021-01-15 10:19:50 +01:00
|
|
|
{ lib, stdenv, fetchurl
|
2017-06-04 23:50:36 +02:00
|
|
|
, bzip2
|
|
|
|
, enableNLS ? false, libnatspec
|
|
|
|
}:
|
2009-10-07 13:18:54 +02:00
|
|
|
|
2014-06-30 13:57:20 +02:00
|
|
|
stdenv.mkDerivation {
|
2009-10-07 13:18:54 +02:00
|
|
|
name = "unzip-6.0";
|
2014-06-30 13:57:20 +02:00
|
|
|
|
2009-10-07 13:18:54 +02:00
|
|
|
src = fetchurl {
|
2020-04-01 03:11:51 +02:00
|
|
|
url = "mirror://sourceforge/infozip/unzip60.tar.gz";
|
2009-10-07 13:18:54 +02:00
|
|
|
sha256 = "0dxx11knh3nk95p2gg2ak777dd11pr7jx5das2g49l262scrcv83";
|
|
|
|
};
|
|
|
|
|
2016-02-26 18:38:15 +01:00
|
|
|
hardeningDisable = [ "format" ];
|
2015-12-23 02:59:47 +01:00
|
|
|
|
2019-10-26 17:39:27 +02:00
|
|
|
patchFlags = [ "-p1" "-F3" ];
|
2017-07-09 03:58:43 +02:00
|
|
|
|
2015-01-03 14:52:28 +01:00
|
|
|
patches = [
|
|
|
|
./CVE-2014-8139.diff
|
|
|
|
./CVE-2014-8140.diff
|
|
|
|
./CVE-2014-8141.diff
|
2015-02-04 11:17:09 +01:00
|
|
|
./CVE-2014-9636.diff
|
2015-11-01 09:39:10 +01:00
|
|
|
./CVE-2015-7696.diff
|
|
|
|
./CVE-2015-7697.diff
|
2016-12-14 23:52:09 +01:00
|
|
|
./CVE-2014-9913.patch
|
|
|
|
./CVE-2016-9844.patch
|
2019-02-17 05:33:44 +01:00
|
|
|
./CVE-2018-18384.patch
|
2017-06-23 23:45:27 +02:00
|
|
|
./dont-hardcode-cc.patch
|
2019-10-19 21:15:58 +02:00
|
|
|
(fetchurl {
|
|
|
|
url = "https://github.com/madler/unzip/commit/41beb477c5744bc396fa1162ee0c14218ec12213.patch";
|
|
|
|
name = "CVE-2019-13232-1.patch";
|
|
|
|
sha256 = "04jzd6chg9fw4l5zadkfsrfm5llrd7vhd1dgdjjd29nrvkrjyn14";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://github.com/madler/unzip/commit/47b3ceae397d21bf822bc2ac73052a4b1daf8e1c.patch";
|
|
|
|
name = "CVE-2019-13232-2.patch";
|
|
|
|
sha256 = "0iy2wcjyvzwrjk02iszwcpg85fkjxs1bvb9isvdiywszav4yjs32";
|
|
|
|
})
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://github.com/madler/unzip/commit/6d351831be705cc26d897db44f878a978f4138fc.patch";
|
|
|
|
name = "CVE-2019-13232-3.patch";
|
|
|
|
sha256 = "1jvs7dkdqs97qnsqc6hk088alhv8j4c638k65dbib9chh40jd7pf";
|
|
|
|
})
|
2021-01-15 10:19:50 +01:00
|
|
|
] ++ lib.optional enableNLS
|
2014-06-30 13:57:20 +02:00
|
|
|
(fetchurl {
|
|
|
|
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";
|
2017-06-23 23:45:27 +02:00
|
|
|
});
|
2014-06-30 13:57:20 +02:00
|
|
|
|
2013-05-26 13:22:55 +02:00
|
|
|
nativeBuildInputs = [ bzip2 ];
|
2021-01-15 10:19:50 +01:00
|
|
|
buildInputs = [ bzip2 ] ++ lib.optional enableNLS libnatspec;
|
2009-10-07 13:18:54 +02:00
|
|
|
|
|
|
|
makefile = "unix/Makefile";
|
|
|
|
|
2021-01-15 10:19:50 +01:00
|
|
|
NIX_LDFLAGS = "-lbz2" + lib.optionalString enableNLS " -lnatspec";
|
2009-10-07 13:18:54 +02:00
|
|
|
|
2019-10-26 17:39:27 +02:00
|
|
|
buildFlags = [
|
|
|
|
"generic"
|
|
|
|
"D_USE_BZ2=-DUSE_BZIP2"
|
|
|
|
"L_BZ2=-lbz2"
|
|
|
|
];
|
2009-10-07 13:18:54 +02:00
|
|
|
|
2011-08-16 20:21:05 +02:00
|
|
|
preConfigure = ''
|
|
|
|
sed -i -e 's@CF="-O3 -Wall -I. -DASM_CRC $(LOC)"@CF="-O3 -Wall -I. -DASM_CRC -DLARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(LOC)"@' unix/Makefile
|
|
|
|
'';
|
|
|
|
|
2019-10-26 17:39:27 +02:00
|
|
|
installFlags = [
|
|
|
|
"prefix=${placeholder ''out''}"
|
|
|
|
];
|
2009-10-07 13:18:54 +02:00
|
|
|
|
2014-06-30 14:12:35 +02:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2009-10-07 13:18:54 +02:00
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://www.info-zip.org";
|
2009-10-07 13:18:54 +02:00
|
|
|
description = "An extraction utility for archives compressed in .zip format";
|
2021-01-15 10:19:50 +01:00
|
|
|
license = lib.licenses.free; # http://www.info-zip.org/license.html
|
|
|
|
platforms = lib.platforms.all;
|
2009-10-07 13:18:54 +02:00
|
|
|
};
|
2014-06-30 13:57:20 +02:00
|
|
|
}
|