2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchurl
|
2023-06-12 23:51:59 +00:00
|
|
|
, enableStatic ? with stdenv.hostPlatform; isStatic || isCygwin
|
|
|
|
, enableShared ? true
|
2020-01-02 22:57:56 +00:00
|
|
|
, autoreconfHook
|
2023-02-07 14:19:50 +00:00
|
|
|
, testers
|
2016-04-29 11:39:28 +00:00
|
|
|
}:
|
2011-12-12 17:06:31 +00:00
|
|
|
|
2020-06-26 20:44:45 +00: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.
|
|
|
|
|
2023-02-07 14:19:50 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: let
|
|
|
|
inherit (finalAttrs) version;
|
|
|
|
in {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "bzip2";
|
2022-07-12 08:50:56 +00:00
|
|
|
version = "1.0.8";
|
2010-10-07 13:14:25 +00:00
|
|
|
|
2003-11-04 08:36:32 +00:00
|
|
|
src = fetchurl {
|
2022-07-12 08:50:56 +00:00
|
|
|
url = "https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz";
|
|
|
|
sha256 = "sha256-q1oDF27hBtPw+pDjgdpHjdrkBZGBU8yiSOaCzQxKImk=";
|
2003-11-04 08:36:32 +00:00
|
|
|
};
|
2006-10-24 22:40:33 +00:00
|
|
|
|
2022-07-12 08:50:56 +00:00
|
|
|
patchFlags = ["-p0"];
|
2020-01-02 22:57:56 +00:00
|
|
|
|
2016-12-01 00:30:52 +00:00
|
|
|
patches = [
|
2022-07-12 08:50:56 +00:00
|
|
|
(fetchurl {
|
2023-12-07 09:08:43 +00:00
|
|
|
url = "ftp://ftp.suse.com/pub/people/sbrabec/bzip2/for_downstream/bzip2-1.0.6.2-autoconfiscated.patch";
|
2022-07-12 08:50:56 +00:00
|
|
|
sha256 = "sha256-QMufl6ffJVVVVZespvkCbFpB6++R1lnq1687jEsUjr0=";
|
|
|
|
})
|
2016-12-01 00:30:52 +00:00
|
|
|
];
|
2022-07-16 09:37:20 +00:00
|
|
|
# Fix up hardcoded version from the above patch, e.g. seen in bzip2.pc or libbz2.so.1.0.N
|
|
|
|
postPatch = ''
|
|
|
|
patch <<-EOF
|
|
|
|
--- configure.ac
|
|
|
|
+++ configure.ac
|
|
|
|
@@ -3,3 +3,3 @@
|
|
|
|
-AC_INIT([bzip2], [1.0.6], [Julian Seward <jseward@bzip.org>])
|
|
|
|
+AC_INIT([bzip2], [${version}], [Julian Seward <jseward@bzip.org>])
|
|
|
|
BZIP2_LT_CURRENT=1
|
|
|
|
-BZIP2_LT_REVISION=6
|
|
|
|
+BZIP2_LT_REVISION=${lib.versions.patch version}
|
|
|
|
EOF
|
|
|
|
'';
|
2016-12-01 00:30:52 +00:00
|
|
|
|
2022-07-12 08:50:56 +00:00
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [ autoreconfHook ];
|
2010-12-06 17:48:52 +00:00
|
|
|
|
2016-08-29 00:30:01 +00:00
|
|
|
outputs = [ "bin" "dev" "out" "man" ];
|
2009-11-08 00:32:12 +00:00
|
|
|
|
2023-06-12 23:51:59 +00:00
|
|
|
configureFlags = lib.concatLists [
|
|
|
|
(lib.optional enableStatic "--enable-static")
|
|
|
|
(lib.optional (!enableShared) "--disable-shared")
|
|
|
|
];
|
|
|
|
|
|
|
|
dontDisableStatic = enableStatic;
|
2010-10-07 13:14:25 +00:00
|
|
|
|
2019-05-12 15:26:58 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-03-23 07:54:09 +00:00
|
|
|
postInstall = ''
|
|
|
|
ln -s $out/lib/libbz2.so.1.0.* $out/lib/libbz2.so.1.0
|
|
|
|
'';
|
|
|
|
|
2023-02-07 14:19:50 +00:00
|
|
|
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-06-20 10:53:46 +00: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 09:14:50 +00:00
|
|
|
license = licenses.bsdOriginal;
|
2023-02-07 14:19:50 +00:00
|
|
|
pkgConfigModules = [ "bzip2" ];
|
2018-08-09 09:14:50 +00:00
|
|
|
platforms = platforms.all;
|
2021-01-31 19:16:52 +00:00
|
|
|
maintainers = with maintainers; [ mic92 ];
|
2008-01-31 10:11:09 +00:00
|
|
|
};
|
2023-02-07 14:19:50 +00:00
|
|
|
})
|