commit:     436a86c6ba463931212876d2ed96d067f20d378e
Author:     Ian Jordan <immoloism <AT> gmail <DOT> com>
AuthorDate: Wed Jul 19 15:26:58 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed Jul 19 18:30:57 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=436a86c6

app-arch/libarchive: fix build on musl

Cherrypicked patch from master repo to fix compiling 3.7.0
under musl. Tested with both GCC and LLVM.

Also added BDEP for sys-libs/queue-standalone for this version.

Closes: https://bugs.gentoo.org/910552
Signed-off-by: Ian Jordan <immoloism <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/31959
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/libarchive-3.7.0-f_namemax-fix.patch        | 19 +++++++++++++++++++
 app-arch/libarchive/libarchive-3.7.0.ebuild           |  6 ++++++
 2 files changed, 25 insertions(+)

diff --git a/app-arch/libarchive/files/libarchive-3.7.0-f_namemax-fix.patch 
b/app-arch/libarchive/files/libarchive-3.7.0-f_namemax-fix.patch
new file mode 100644
index 000000000000..36ed70fca44b
--- /dev/null
+++ b/app-arch/libarchive/files/libarchive-3.7.0-f_namemax-fix.patch
@@ -0,0 +1,19 @@
+From: 
https://github.com/libarchive/libarchive/commit/bd074c2531e867078788fe8539376c31119e4e55.patch
+From: Wong Hoi Sing Edison <[email protected]>
+Date: Wed, 19 Jul 2023 16:59:32 +0800
+Subject: [PATCH] Replace `svfs.f_namelen` with `svfs.f_namemax` (#1924)
+
+The equivalent for `f_namelen` in struct statvfs is `f_namemax`.
+
+Signed-off-by: Wong Hoi Sing Edison <[email protected]>
+--- a/libarchive/archive_read_disk_posix.c
++++ b/libarchive/archive_read_disk_posix.c
+@@ -1866,7 +1866,7 @@ setup_current_filesystem(struct archive_read_disk *a)
+ #if defined(USE_READDIR_R)
+       /* Set maximum filename length. */
+ #if defined(HAVE_STATVFS)
+-      t->current_filesystem->name_max = svfs.f_namelen;
++      t->current_filesystem->name_max = svfs.f_namemax;
+ #else
+       t->current_filesystem->name_max = sfs.f_namelen;
+ #endif

diff --git a/app-arch/libarchive/libarchive-3.7.0.ebuild 
b/app-arch/libarchive/libarchive-3.7.0.ebuild
index d6d88d91c98f..0346154a7172 100644
--- a/app-arch/libarchive/libarchive-3.7.0.ebuild
+++ b/app-arch/libarchive/libarchive-3.7.0.ebuild
@@ -46,8 +46,14 @@ DEPEND="${RDEPEND}
 "
 BDEPEND="
        verify-sig? ( >=sec-keys/openpgp-keys-libarchive-20221209 )
+       elibc_musl? ( sys-libs/queue-standalone )
 "
 
+# Bug #910552 Only required for version 3.7.0
+PATCHES=(
+       "${FILESDIR}/${P}-f_namemax-fix.patch"
+)
+
 # false positives (checks for libc-defined hash functions)
 QA_CONFIG_IMPL_DECL_SKIP=(
        SHA256_Init SHA256_Update SHA256_Final

Reply via email to