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