libarchive: fix tests on Darwin with recent Nix/Lix (#429407)

Emily 3d00bd70 6473890e

Changed files
+27
pkgs
+22
pkgs/by-name/li/libarchive/fix-darwin-tmpdir-handling.patch
···
+
From 87bbe8ec8d343c70ae42ccb9606ec80ad73ceffb Mon Sep 17 00:00:00 2001
+
From: Emily <hello@emily.moe>
+
Date: Tue, 29 Jul 2025 16:53:15 +0100
+
Subject: [PATCH] Fix setup_mac_metadata when TMPDIR does not end with a slash
+
+
---
+
libarchive/archive_read_disk_entry_from_file.c | 2 +-
+
1 file changed, 1 insertion(+), 1 deletion(-)
+
+
diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
+
index 19d049770b..87389642db 100644
+
--- a/libarchive/archive_read_disk_entry_from_file.c
+
+++ b/libarchive/archive_read_disk_entry_from_file.c
+
@@ -364,7 +364,7 @@ setup_mac_metadata(struct archive_read_disk *a,
+
tempdir = _PATH_TMP;
+
archive_string_init(&tempfile);
+
archive_strcpy(&tempfile, tempdir);
+
- archive_strcat(&tempfile, "tar.md.XXXXXX");
+
+ archive_strcat(&tempfile, "/tar.md.XXXXXX");
+
tempfd = mkstemp(tempfile.s);
+
if (tempfd < 0) {
+
archive_set_error(&a->archive, errno,
+5
pkgs/by-name/li/libarchive/package.nix
···
url = "https://github.com/libarchive/libarchive/commit/489d0b8e2f1fafd3b7ebf98f389ca67462c34651.patch?full_index=1";
hash = "sha256-r+tSJ+WA0VKCjg+8MfS5/RqcB+aAMZ2dK0YUh+U1q78=";
})
+
# Fix the tests on Darwin when `$TMPDIR` does not end with a slash
+
# and its parent directory is not writable by the build user, as on
+
# Nix ≥ 2.30.0 and Lix ≥ 2.91.2, ≥ 2.92.2, ≥ 2.93.1.
+
# <https://github.com/libarchive/libarchive/pull/2708>
+
./fix-darwin-tmpdir-handling.patch
];
outputs = [