Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchurl 2, linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin 3, autoreconfHook 4, testers 5}: 6 7# Note: this package is used for bootstrapping fetchurl, and thus 8# cannot use fetchpatch! All mutable patches (generated by GitHub or 9# cgit) that are needed here should be included directly in Nixpkgs as 10# files. 11 12stdenv.mkDerivation (finalAttrs: let 13 inherit (finalAttrs) version; 14in { 15 pname = "bzip2"; 16 version = "1.0.8"; 17 18 src = fetchurl { 19 url = "https://sourceware.org/pub/bzip2/bzip2-${version}.tar.gz"; 20 sha256 = "sha256-q1oDF27hBtPw+pDjgdpHjdrkBZGBU8yiSOaCzQxKImk="; 21 }; 22 23 patchFlags = ["-p0"]; 24 25 patches = [ 26 (fetchurl { 27 url = "https://ftp.suse.com/pub/people/sbrabec/bzip2/for_downstream/bzip2-1.0.6.2-autoconfiscated.patch"; 28 sha256 = "sha256-QMufl6ffJVVVVZespvkCbFpB6++R1lnq1687jEsUjr0="; 29 }) 30 ]; 31 # Fix up hardcoded version from the above patch, e.g. seen in bzip2.pc or libbz2.so.1.0.N 32 postPatch = '' 33 patch <<-EOF 34 --- configure.ac 35 +++ configure.ac 36 @@ -3,3 +3,3 @@ 37 -AC_INIT([bzip2], [1.0.6], [Julian Seward <jseward@bzip.org>]) 38 +AC_INIT([bzip2], [${version}], [Julian Seward <jseward@bzip.org>]) 39 BZIP2_LT_CURRENT=1 40 -BZIP2_LT_REVISION=6 41 +BZIP2_LT_REVISION=${lib.versions.patch version} 42 EOF 43 ''; 44 45 strictDeps = true; 46 nativeBuildInputs = [ autoreconfHook ]; 47 48 outputs = [ "bin" "dev" "out" "man" ]; 49 50 configureFlags = 51 lib.optionals linkStatic [ "--enable-static" "--disable-shared" ]; 52 53 enableParallelBuilding = true; 54 55 postInstall = '' 56 ln -s $out/lib/libbz2.so.1.0.* $out/lib/libbz2.so.1.0 57 ''; 58 59 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 60 61 meta = with lib; { 62 description = "High-quality data compression program"; 63 homepage = "https://www.sourceware.org/bzip2"; 64 changelog = "https://sourceware.org/git/?p=bzip2.git;a=blob;f=CHANGES;hb=HEAD"; 65 license = licenses.bsdOriginal; 66 pkgConfigModules = [ "bzip2" ]; 67 platforms = platforms.all; 68 maintainers = with maintainers; [ mic92 ]; 69 }; 70})