nixpkgs/pkgs/tools/compression/bzip2/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

76 lines
2.2 KiB
Nix
Raw Normal View History

{ 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
, testers
}:
# 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.
stdenv.mkDerivation (finalAttrs: let
inherit (finalAttrs) version;
in {
pname = "bzip2";
version = "1.0.8";
src = fetchurl {
url = "https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz";
sha256 = "sha256-q1oDF27hBtPw+pDjgdpHjdrkBZGBU8yiSOaCzQxKImk=";
};
patchFlags = ["-p0"];
2020-01-02 22:57:56 +00:00
patches = [
(fetchurl {
url = "ftp://ftp.suse.com/pub/people/sbrabec/bzip2/for_downstream/bzip2-1.0.6.2-autoconfiscated.patch";
sha256 = "sha256-QMufl6ffJVVVVZespvkCbFpB6++R1lnq1687jEsUjr0=";
})
];
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
'';
strictDeps = true;
nativeBuildInputs = [ autoreconfHook ];
outputs = [ "bin" "dev" "out" "man" ];
2023-06-12 23:51:59 +00:00
configureFlags = lib.concatLists [
(lib.optional enableStatic "--enable-static")
(lib.optional (!enableShared) "--disable-shared")
];
dontDisableStatic = enableStatic;
2019-05-12 15:26:58 +00:00
enableParallelBuilding = true;
postInstall = ''
ln -s $out/lib/libbz2.so.1.0.* $out/lib/libbz2.so.1.0
'';
passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
meta = with lib; {
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;
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 ];
};
})