sci-astronomy/siril: fix build on musl

Closes: https://bugs.gentoo.org/924664
Signed-off-by: Mario Haustein <mario.haustein@hrz.tu-chemnitz.de>
Closes: https://github.com/gentoo/gentoo/pull/35331
Signed-off-by: Joonas Niilola <juippis@gentoo.org>
This commit is contained in:
Mario Haustein 2024-02-16 22:05:48 +01:00 committed by Joonas Niilola
parent 012e61411f
commit 724f0706fd
No known key found for this signature in database
GPG Key ID: 7383942B8DC06962
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,52 @@
From 7f09478f4522b65b476c788a696159e5a4974286 Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Wed, 13 Dec 2023 21:00:08 +0100
Subject: [PATCH] Clean up and fix fseek64/ftell64
Upstream: https://gitlab.com/free-astro/siril/-/merge_requests/606
Test for the exception systems, GNU and Windows, and then fall back to
standard POSIX.
This fixes build with musl libc, which does not have fseeko64/ftello64.
Fixes https://gitlab.com/free-astro/siril/-/issues/1241
--- a/src/io/avi_pipp/pipp_utf8.h
+++ b/src/io/avi_pipp/pipp_utf8.h
@@ -31,27 +31,15 @@
#endif
// 64-bit fseek for various platforms
-#ifdef __linux__
-#define fseek64 fseeko64 // Linux
-#define ftell64 ftello64 // Linux
-#elif defined (OS_OSX)
-#define fseek64 fseeko // OS X
-#define ftell64 ftello // OS X
-#elif defined(BSD)
-#define fseek64 fseeko // DragonFly BSD, FreeBSD, OpenBSD, NetBSD
-#define ftell64 ftello // DragonFly BSD, FreeBSD, OpenBSD, NetBSD
-#elif defined (__FreeBSD_kernel__) && defined (__GLIBC__)
-#define fseek64 fseeko64 // KFreeBSD
-#define ftell64 ftello64 // KFreeBSD
-#elif defined (__gnu_hurd__)
-#define fseek64 fseeko64 // GNU/Hurd
-#define ftell64 ftello64 // GNU/Hurd
-#elif defined(__CYGWIN__)
-#define fseek64 fseeko // CYGWIN
-#define ftell64 ftello // CYGWIN
-#else
+#if defined(__GLIBC__) || defined(__gnu_hurd__)
+#define fseek64 fseeko64 // GNU
+#define ftell64 ftello64 // GNU
+#elif defined(_WIN32)
#define fseek64 _fseeki64 // Windows
#define ftell64 _ftelli64 // Windows
+#else // POSIX
+#define fseek64 fseeko // OS X, DragonFly BSD, FreeBSD, OpenBSD, NetBSD, musl
+#define ftell64 ftello // OS X, DragonFly BSD, FreeBSD, OpenBSD, NetBSD, musl
#endif
#endif // PIPP_UTF8_H
--
GitLab

View File

@ -52,6 +52,7 @@ BDEPEND="dev-build/cmake
PATCHES=(
"${FILESDIR}/${PN}-docfiles.patch"
"${FILESDIR}/${PN}-1.2-fseek64-musl.patch"
)
DOCS=( README.md NEWS ChangeLog AUTHORS )