commit:     6d35e642cd7c454256eb22759ac1afe28a0c38ef
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue May  9 13:42:21 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue May  9 13:43:39 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d35e642

dev-libs/libbsd: fix build w/ musl-1.2.4

Closes: https://bugs.gentoo.org/905912
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/libbsd/files/libbsd-0.11.7-musl-lfs.patch | 32 ++++++++++++++++++++++
 dev-libs/libbsd/libbsd-0.11.7-r2.ebuild            |  1 +
 2 files changed, 33 insertions(+)

diff --git a/dev-libs/libbsd/files/libbsd-0.11.7-musl-lfs.patch 
b/dev-libs/libbsd/files/libbsd-0.11.7-musl-lfs.patch
new file mode 100644
index 000000000000..41cc27e75237
--- /dev/null
+++ b/dev-libs/libbsd/files/libbsd-0.11.7-musl-lfs.patch
@@ -0,0 +1,32 @@
+https://bugs.gentoo.org/905912
+https://gitlab.freedesktop.org/libbsd/libbsd/-/merge_requests/24
+
+From c36c29f014b0ef56a3aef984fa40b0e100b6f419 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Thu, 15 Dec 2022 09:02:22 -0800
+Subject: [PATCH] funopen: Replace off64_t with off_t in funopen_seek
+
+AC_SYS_LARGEFILE in configure.ac is setting needed defines to make
+64bit off_t on relevant platforms.
+
+Fixes build on musl
+
+| ../../../../../../../../workspace/sources/libbsd/src/funopen.c:68:28: error: 
unknown type name 'off64_t'; did you mean 'off_t'?
+| funopen_seek(void *cookie, off64_t *offset, int whence)
+|                            ^~~~~~~
+|                            off_t
+
+Signed-off-by: Khem Raj <[email protected]>
+--- a/src/funopen.c
++++ b/src/funopen.c
+@@ -65,7 +65,7 @@ funopen_write(void *cookie, const char *buf, size_t size)
+ }
+ 
+ static int
+-funopen_seek(void *cookie, off64_t *offset, int whence)
++funopen_seek(void *cookie, off_t *offset, int whence)
+ {
+       struct funopen_cookie *cookiewrap = cookie;
+       off_t soff = *offset;
+-- 
+GitLab

diff --git a/dev-libs/libbsd/libbsd-0.11.7-r2.ebuild 
b/dev-libs/libbsd/libbsd-0.11.7-r2.ebuild
index 1383b676c74a..cc3316c69e98 100644
--- a/dev-libs/libbsd/libbsd-0.11.7-r2.ebuild
+++ b/dev-libs/libbsd/libbsd-0.11.7-r2.ebuild
@@ -24,6 +24,7 @@ BDEPEND="verify-sig? ( sec-keys/openpgp-keys-guillemjover )"
 
 PATCHES=(
        
"${FILESDIR}/libbsd-build-Fix-version-script-linker-support-detection.patch"
+       "${FILESDIR}/libbsd-0.11.7-musl-lfs.patch"
 )
 
 src_prepare() {

Reply via email to