2021-01-10 23:54:33 -08:00
|
|
|
{ lib, stdenv, fetchurl
|
2020-12-19 22:11:26 -08:00
|
|
|
, linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin
|
2020-01-02 14:57:56 -08:00
|
|
|
, autoreconfHook
|
2016-04-29 04:39:28 -07:00
|
|
|
}:
|
2011-12-12 09:06:31 -08:00
|
|
|
|
2020-06-26 13:44:45 -07: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 04:39:28 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 05:41:18 -07:00
|
|
|
pname = "bzip2";
|
2021-02-20 11:06:26 -08:00
|
|
|
version = "1.0.6.0.2";
|
2010-10-07 06:14:25 -07:00
|
|
|
|
2016-04-29 04:39:28 -07:00
|
|
|
/* We use versions patched to use autotools style properly,
|
|
|
|
saving lots of trouble. */
|
2003-11-04 00:36:32 -08:00
|
|
|
src = fetchurl {
|
2016-04-29 04:39:28 -07:00
|
|
|
urls = map
|
2019-08-15 05:41:18 -07:00
|
|
|
(prefix: prefix + "/people/sbrabec/bzip2/tarballs/${pname}-${version}.tar.gz")
|
2016-04-29 04:39:28 -07: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 11:06:26 -08:00
|
|
|
sha256 = "sha256-FnhwNy4OHe8d5M6iYCClkxzcB/EHXg0veXwv43ZlxbA=";
|
2003-11-04 00:36:32 -08:00
|
|
|
};
|
2006-10-24 15:40:33 -07:00
|
|
|
|
2020-01-02 14:57:56 -08:00
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
|
|
|
|
2016-11-30 16:30:52 -08:00
|
|
|
patches = [
|
|
|
|
./CVE-2016-3189.patch
|
2019-06-22 02:53:12 -07:00
|
|
|
./cve-2019-12900.patch
|
2016-11-30 16:30:52 -08:00
|
|
|
];
|
|
|
|
|
2016-02-11 04:56:38 -08:00
|
|
|
postPatch = ''
|
2016-04-29 04:39:28 -07:00
|
|
|
sed -i -e '/<sys\\stat\.h>/s|\\|/|' bzip2.c
|
2015-11-17 07:16:14 -08:00
|
|
|
'';
|
2010-12-06 09:48:52 -08:00
|
|
|
|
2016-08-28 17:30:01 -07:00
|
|
|
outputs = [ "bin" "dev" "out" "man" ];
|
2009-11-07 16:32:12 -08:00
|
|
|
|
2016-04-29 04:39:28 -07:00
|
|
|
configureFlags =
|
2021-01-15 01:19:50 -08:00
|
|
|
lib.optionals linkStatic [ "--enable-static" "--disable-shared" ];
|
2010-10-07 06:14:25 -07:00
|
|
|
|
2019-05-12 08:26:58 -07:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-01-10 23:54:33 -08:00
|
|
|
meta = with lib; {
|
2016-06-20 03:53:46 -07:00
|
|
|
description = "High-quality data compression program";
|
2021-02-21 11:22:12 -08:00
|
|
|
homepage = "https://www.sourceware.org/bzip2";
|
|
|
|
changelog = "https://sourceware.org/git/?p=bzip2.git;a=blob;f=CHANGES;hb=HEAD";
|
2018-08-09 02:14:50 -07:00
|
|
|
license = licenses.bsdOriginal;
|
|
|
|
platforms = platforms.all;
|
2021-01-31 11:16:52 -08:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2008-01-31 02:11:09 -08:00
|
|
|
};
|
2003-11-04 00:36:32 -08:00
|
|
|
}
|