pbzip2: fix clang-19 build (#371515)

authored by Emily and committed by GitHub 61faebd4 c5e7b24a

+21 -4
+21 -4
pkgs/by-name/pb/pbzip2/package.nix
··· 2 2 lib, 3 3 stdenv, 4 4 fetchurl, 5 + fetchpatch, 5 6 bzip2, 6 7 }: 7 8 ··· 18 19 sha256 = "1rnvgcdixjzbrmcr1nv9b6ccrjfrhryaj7jwz28yxxv6lam3xlcg"; 19 20 }; 20 21 21 - buildInputs = [ bzip2 ]; 22 + patches = [ 23 + # https://libcxx.llvm.org/ReleaseNotes/19.html#deprecations-and-removals 24 + # https://bugs.launchpad.net/pbzip2/+bug/2081588 25 + (fetchpatch { 26 + url = "https://github.com/freebsd/freebsd-ports/raw/974d3ff054965d2bd2ab884a0579ed06c5a08b07/archivers/pbzip2/files/patch-BZ2StreamScanner.cpp"; 27 + extraPrefix = ""; 28 + hash = "sha256-dvXdp+5S41akavy+mvPGHpUxHxenXS7bbTVBVkIJj0s="; 29 + }) 30 + (fetchpatch { 31 + url = "https://github.com/freebsd/freebsd-ports/raw/974d3ff054965d2bd2ab884a0579ed06c5a08b07/archivers/pbzip2/files/patch-BZ2StreamScanner.h"; 32 + extraPrefix = ""; 33 + hash = "sha256-/twP8HyHP4cAVgb5cUPq0CgDxUgDYPdd9haH9wDOrz8="; 34 + }) 35 + ]; 22 36 23 - preBuild = "substituteInPlace Makefile --replace g++ c++"; 37 + postPatch = '' 38 + substituteInPlace pbzip2.cpp \ 39 + --replace-fail '"PRIuMAX"' '" PRIuMAX "' 40 + ''; 24 41 25 - installFlags = [ "PREFIX=$(out)" ]; 42 + buildInputs = [ bzip2 ]; 26 43 27 - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=reserved-user-defined-literal"; 44 + installFlags = [ "PREFIX=$(out)" ]; 28 45 29 46 meta = with lib; { 30 47 homepage = "http://compression.ca/pbzip2/";