about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/compression/bzip2
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/compression/bzip2')
-rw-r--r--nixpkgs/pkgs/tools/compression/bzip2/1_1.nix47
-rw-r--r--nixpkgs/pkgs/tools/compression/bzip2/default.nix70
2 files changed, 117 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/compression/bzip2/1_1.nix b/nixpkgs/pkgs/tools/compression/bzip2/1_1.nix
new file mode 100644
index 000000000000..e9d6f7c44dab
--- /dev/null
+++ b/nixpkgs/pkgs/tools/compression/bzip2/1_1.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv
+, fetchFromGitLab
+, meson
+, python3
+, ninja
+, testers
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "bzip2-unstable";
+  version = "2020-08-11";
+
+  src = fetchFromGitLab {
+    owner = "federicomenaquintero";
+    repo = "bzip2";
+    rev = "15255b553e7c095fb7a26d4dc5819a11352ebba1";
+    sha256 = "sha256-BAyz35D62LWi47B/gNcCSKpdaECHBGSpt21vtnk3fKs=";
+  };
+
+  postPatch = ''
+    patchShebangs install_links.py
+  '';
+
+  nativeBuildInputs = [
+    meson
+    python3
+    ninja
+  ];
+
+  outputs = [ "bin" "dev" "out" "man" ];
+
+  mesonFlags = [
+    "-Ddocs=disabled"
+  ];
+
+  strictDeps = true;
+
+  passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+
+  meta = with lib; {
+    description = "High-quality data compression program";
+    license = licenses.bsdOriginal;
+    pkgConfigModules = [ "bz2" ];
+    platforms = platforms.all;
+    maintainers = [];
+  };
+})
diff --git a/nixpkgs/pkgs/tools/compression/bzip2/default.nix b/nixpkgs/pkgs/tools/compression/bzip2/default.nix
new file mode 100644
index 000000000000..be456cf59442
--- /dev/null
+++ b/nixpkgs/pkgs/tools/compression/bzip2/default.nix
@@ -0,0 +1,70 @@
+{ lib, stdenv, fetchurl
+, linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin
+, 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"];
+
+  patches = [
+    (fetchurl {
+      url = "https://ftp.suse.com/pub/people/sbrabec/bzip2/for_downstream/bzip2-1.0.6.2-autoconfiscated.patch";
+      sha256 = "sha256-QMufl6ffJVVVVZespvkCbFpB6++R1lnq1687jEsUjr0=";
+    })
+  ];
+  # 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" ];
+
+  configureFlags =
+    lib.optionals linkStatic [ "--enable-static" "--disable-shared" ];
+
+  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";
+    homepage = "https://www.sourceware.org/bzip2";
+    changelog = "https://sourceware.org/git/?p=bzip2.git;a=blob;f=CHANGES;hb=HEAD";
+    license = licenses.bsdOriginal;
+    pkgConfigModules = [ "bzip2" ];
+    platforms = platforms.all;
+    maintainers = with maintainers; [ mic92 ];
+  };
+})