From 8fa0b532afdaa4146287b968d2de39ae20f87e5d Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 24 May 2025 18:52:59 -0600 Subject: [PATCH] libarchive: Add patch to fix macOS metadata handling when reading certain tarballs This was merged in and fixes the root cause of the test_copy failure. --- pkgs/by-name/li/libarchive/package.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/pkgs/by-name/li/libarchive/package.nix b/pkgs/by-name/li/libarchive/package.nix index 430f8c192ad1..d8e1d405f985 100644 --- a/pkgs/by-name/li/libarchive/package.nix +++ b/pkgs/by-name/li/libarchive/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, acl, attr, autoreconfHook, @@ -41,6 +42,21 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-nL2p2h+U25fhQQjbj16yhxhU8xEEuhNynIx7SNzl6Mo="; }; + patches = [ + # Remove in next release + # + # Fixes macOS metadata file handling when reading certain tarballs + # (e.g, bsdtar-produced tar containing a file with xattrs whose name is exactly 99 bytes long) + # + # + # This also fixes test_copy in the test suite. + (fetchpatch { + name = "reset-header-state-after-mac-metadata.patch"; + url = "https://github.com/libarchive/libarchive/commit/5bb36db5e19aecabccec8f351ec22f8c3a8695f0.patch"; + hash = "sha256-eNGSunYZ5b0TrkBUtOO7MYGXc+SEn1Sxm8MYyI+4JsQ="; + }) + ]; + outputs = [ "out" "lib"