libarchive: fix tests on Darwin with recent Nix/Lix

Emily 76a80617 8d3f059d

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