From 525263cc6c71d195c2237b0f150132bccb0dd86c Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Wed, 21 May 2025 00:12:36 -0600 Subject: [PATCH 1/2] libarchive: 3.7.8 -> 3.8.0 --- .../li/libarchive/fix-pkg-config-iconv.patch | 18 --------------- pkgs/by-name/li/libarchive/package.nix | 22 ++----------------- 2 files changed, 2 insertions(+), 38 deletions(-) delete mode 100644 pkgs/by-name/li/libarchive/fix-pkg-config-iconv.patch diff --git a/pkgs/by-name/li/libarchive/fix-pkg-config-iconv.patch b/pkgs/by-name/li/libarchive/fix-pkg-config-iconv.patch deleted file mode 100644 index 209a293b460b..000000000000 --- a/pkgs/by-name/li/libarchive/fix-pkg-config-iconv.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 0fdfaf06a5..d08611848c 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -453,13 +453,8 @@ - AC_CHECK_HEADERS([iconv.h],[],[],[#include ]) - if test "x$am_cv_func_iconv" = "xyes"; then - AC_CHECK_HEADERS([localcharset.h]) -- am_save_LIBS="$LIBS" - LIBS="${LIBS} ${LIBICONV}" -- if test -n "$LIBICONV"; then -- LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }iconv" -- fi - AC_CHECK_FUNCS([locale_charset]) -- LIBS="${am_save_LIBS}" - if test "x$ac_cv_func_locale_charset" != "xyes"; then - # If locale_charset() is not in libiconv, we have to find libcharset. - AC_CHECK_LIB(charset,locale_charset) diff --git a/pkgs/by-name/li/libarchive/package.nix b/pkgs/by-name/li/libarchive/package.nix index bf43230d9333..430f8c192ad1 100644 --- a/pkgs/by-name/li/libarchive/package.nix +++ b/pkgs/by-name/li/libarchive/package.nix @@ -11,7 +11,6 @@ lzo, openssl, pkg-config, - sharutils, xz, zlib, zstd, @@ -33,31 +32,15 @@ assert xarSupport -> libxml2 != null; stdenv.mkDerivation (finalAttrs: { pname = "libarchive"; - version = "3.7.8"; + version = "3.8.0"; src = fetchFromGitHub { owner = "libarchive"; repo = "libarchive"; rev = "v${finalAttrs.version}"; - hash = "sha256-fjE3b9rDHf1Xubpm9guvX6I8a2loYsGHj3epLceueUw="; + hash = "sha256-nL2p2h+U25fhQQjbj16yhxhU8xEEuhNynIx7SNzl6Mo="; }; - patches = [ - # The `.pc` file lists `iconv` in `Requires.private` when `-liconv` - # is required, even though common platforms in that situation like - # Darwin don’t ship a `.pc` file for their `libiconv`. This isn’t - # upstreamed as there are a handful of closed or regressed PRs - # trying to fix it already and it seems upstream added this to deal - # with some non‐portable MSYS2 thing or something. - # - # See: - # - # * - # * - # * - ./fix-pkg-config-iconv.patch - ]; - outputs = [ "out" "lib" @@ -109,7 +92,6 @@ stdenv.mkDerivation (finalAttrs: { zlib zstd ] - ++ lib.optional stdenv.hostPlatform.isUnix sharutils ++ lib.optionals stdenv.hostPlatform.isLinux [ acl attr From 8fa0b532afdaa4146287b968d2de39ae20f87e5d Mon Sep 17 00:00:00 2001 From: Zhaofeng Li Date: Sat, 24 May 2025 18:52:59 -0600 Subject: [PATCH 2/2] 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"