summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernd Waibel <waebbl@gmail.com>2020-08-17 22:16:16 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-08-18 12:13:41 +0200
commitb91a3525b936c1510e18570acb34edac890e7cff (patch)
tree8e38baced5a7aff67a21e0aec79ec1097e2d9a62
parentmedia-video/plasma-mediacenter: Remove last-rited package (diff)
downloadgentoo-b91a3525b936c1510e18570acb34edac890e7cff.tar.gz
gentoo-b91a3525b936c1510e18570acb34edac890e7cff.tar.bz2
gentoo-b91a3525b936c1510e18570acb34edac890e7cff.zip
media-libs/ilmbase: fix build against musl
Reported-by: tonemgub@cool.fr.nf <tonemgub@cool.fr.nf> Closes: https://bugs.gentoo.org/737474 Package-Manager: Portage-3.0.2, Repoman-2.3.23 Signed-off-by: Bernd Waibel <waebbl@gmail.com> Closes: https://github.com/gentoo/gentoo/pull/17152 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
-rw-r--r--media-libs/ilmbase/files/ilmbase-2.5.2-musl.patch50
-rw-r--r--media-libs/ilmbase/ilmbase-2.5.2.ebuild2
2 files changed, 52 insertions, 0 deletions
diff --git a/media-libs/ilmbase/files/ilmbase-2.5.2-musl.patch b/media-libs/ilmbase/files/ilmbase-2.5.2-musl.patch
new file mode 100644
index 00000000000..80f11e44c12
--- /dev/null
+++ b/media-libs/ilmbase/files/ilmbase-2.5.2-musl.patch
@@ -0,0 +1,50 @@
+From c7af102e6bce6638add2f38576ffe9c6741ba768 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@nh2.me>
+Date: Thu, 30 Jul 2020 02:21:07 +0200
+Subject: [PATCH] IexMathFpu.cpp: Fix build on non-glibc (e.g. musl libc).
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Originally from:
+https://github.com/void-linux/void-packages/blob/80bbc168faa25448bd3399f4df331b836e74b85c/srcpkgs/ilmbase/patches/musl-_fpstate.patch
+
+Fixes error:
+
+ IlmBase/IexMath/IexMathFpu.cpp: In function ‘void Iex_2_4::FpuControl::restoreControlRegs(const ucontext_t&, bool)’:
+ IlmBase/IexMath/IexMathFpu.cpp:284:38: error: ‘struct _fpstate’ has no member named ‘cw’; did you mean ‘cwd’?
+ 284 | setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal);
+ | ^~
+ | cwd
+ IlmBase/IexMath/IexMathFpu.cpp:287:20: error: ‘struct Iex_2_4::FpuControl::_fpstate_64’ has no member named ‘magic’
+ 287 | setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
+ | ^~~~~
+
+Signed-off-by: Niklas Hambüchen <mail@nh2.me>
+---
+ IlmBase/IexMath/IexMathFpu.cpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/IlmBase/IexMath/IexMathFpu.cpp b/IlmBase/IexMath/IexMathFpu.cpp
+index ceed658e0..439329e50 100644
+--- a/IexMath/IexMathFpu.cpp
++++ b/IexMath/IexMathFpu.cpp
+@@ -281,10 +281,18 @@ restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
+ inline void
+ restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
+ {
++#if defined(__GLIBC__) || defined(__i386__)
+ setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal);
++#else
++ setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal);
++#endif
+
+ _fpstate * kfp = reinterpret_cast<_fpstate *> (ucon.uc_mcontext.fpregs);
++#if defined(__GLIBC__) || defined(__i386__)
+ setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
++#else
++ setMxcsr (kfp->mxcsr, clearExceptions);
++#endif
+ }
+
+ #endif
diff --git a/media-libs/ilmbase/ilmbase-2.5.2.ebuild b/media-libs/ilmbase/ilmbase-2.5.2.ebuild
index 47154bbc258..3e9e28c4411 100644
--- a/media-libs/ilmbase/ilmbase-2.5.2.ebuild
+++ b/media-libs/ilmbase/ilmbase-2.5.2.ebuild
@@ -22,6 +22,8 @@ S="${WORKDIR}/openexr-${PV}/IlmBase"
MULTILIB_WRAPPED_HEADERS=( /usr/include/OpenEXR/IlmBaseConfigInternal.h )
+PATCHES=( "${FILESDIR}"/${P}-musl.patch )
+
multilib_src_configure() {
local mycmakeargs=(
-DBUILD_TESTING=$(usex test)