2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2020-12-20 06:11:26 +00:00
|
|
|
, linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin
|
2020-01-02 22:57:56 +00:00
|
|
|
, autoreconfHook
|
2016-04-29 12:39:28 +01:00
|
|
|
}:
|
2011-12-12 17:06:31 +00:00
|
|
|
|
2020-06-26 21:44:45 +01:00
|
|
|
# Note: this package is used for bootstrapping fetchurl, and thus
|
|
|
|
# cannot use fetchpatch! All mutable patches (generated by GitHub or
|
|
|
|
# cgit) that are needed here should be included directly in Nixpkgs as
|
|
|
|
# files.
|
|
|
|
|
2016-04-29 12:39:28 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "bzip2";
|
2021-02-20 19:06:26 +00:00
|
|
|
version = "1.0.6.0.2";
|
2010-10-07 14:14:25 +01:00
|
|
|
|
2016-04-29 12:39:28 +01:00
|
|
|
/* We use versions patched to use autotools style properly,
|
|
|
|
saving lots of trouble. */
|
2003-11-04 08:36:32 +00:00
|
|
|
src = fetchurl {
|
2016-04-29 12:39:28 +01:00
|
|
|
urls = map
|
2019-08-15 13:41:18 +01:00
|
|
|
(prefix: prefix + "/people/sbrabec/bzip2/tarballs/${pname}-${version}.tar.gz")
|
2016-04-29 12:39:28 +01:00
|
|
|
[
|
|
|
|
"http://ftp.uni-kl.de/pub/linux/suse"
|
|
|
|
"ftp://ftp.hs.uni-hamburg.de/pub/mirrors/suse"
|
|
|
|
"ftp://ftp.mplayerhq.hu/pub/linux/suse"
|
|
|
|
"http://ftp.suse.com/pub" # the original patched version but slow
|
|
|
|
];
|
2021-02-20 19:06:26 +00:00
|
|
|
sha256 = "sha256-FnhwNy4OHe8d5M6iYCClkxzcB/EHXg0veXwv43ZlxbA=";
|
2003-11-04 08:36:32 +00:00
|
|
|
};
|
2006-10-24 23:40:33 +01:00
|
|
|
|
2020-01-02 22:57:56 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
2016-12-01 00:30:52 +00:00
|
|
|
patches = [
|
|
|
|
./CVE-2016-3189.patch
|
2019-06-22 10:53:12 +01:00
|
|
|
./cve-2019-12900.patch
|
2016-12-01 00:30:52 +00:00
|
|
|
];
|
|
|
|
|
2016-02-11 12:56:38 +00:00
|
|
|
postPatch = ''
|
2016-04-29 12:39:28 +01:00
|
|
|
sed -i -e '/<sys\\stat\.h>/s|\\|/|' bzip2.c
|
2015-11-17 15:16:14 +00:00
|
|
|
'';
|
2010-12-06 17:48:52 +00:00
|
|
|
|
2016-08-29 01:30:01 +01:00
|
|
|
outputs = [ "bin" "dev" "out" "man" ];
|
2009-11-08 00:32:12 +00:00
|
|
|
|
2016-04-29 12:39:28 +01:00
|
|
|
configureFlags =
|
2021-01-15 09:19:50 +00:00
|
|
|
lib.optionals linkStatic [ "--enable-static" "--disable-shared" ];
|
2010-10-07 14:14:25 +01:00
|
|
|
|
2019-05-12 16:26:58 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-20 11:53:46 +01:00
|
|
|
description = "High-quality data compression program";
|
2021-02-21 19:22:12 +00:00
|
|
|
homepage = "https://www.sourceware.org/bzip2";
|
|
|
|
changelog = "https://sourceware.org/git/?p=bzip2.git;a=blob;f=CHANGES;hb=HEAD";
|
2018-08-09 10:14:50 +01:00
|
|
|
license = licenses.bsdOriginal;
|
|
|
|
platforms = platforms.all;
|
2021-01-31 19:16:52 +00:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2008-01-31 10:11:09 +00:00
|
|
|
};
|
2003-11-04 08:36:32 +00:00
|
|
|
}
|