libarchive: fix tests on Darwin with recent Nix/Lix

This commit is contained in:
Emily
2025-07-29 16:56:47 +01:00
parent 8d3f059d13
commit 76a80617b1
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
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,

View File

@@ -48,6 +48,11 @@ stdenv.mkDerivation (finalAttrs: {
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 = [