Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/ilmbase/, media-libs/ilmbase/files/
Date: Tue, 18 Aug 2020 10:14:01
Message-Id: 1597745621.b91a3525b936c1510e18570acb34edac890e7cff.asturm@gentoo
1 commit: b91a3525b936c1510e18570acb34edac890e7cff
2 Author: Bernd Waibel <waebbl <AT> gmail <DOT> com>
3 AuthorDate: Mon Aug 17 20:16:16 2020 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 18 10:13:41 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b91a3525
7
8 media-libs/ilmbase: fix build against musl
9
10 Reported-by: tonemgub <AT> cool.fr.nf <tonemgub@×××××××.nf>
11 Closes: https://bugs.gentoo.org/737474
12 Package-Manager: Portage-3.0.2, Repoman-2.3.23
13 Signed-off-by: Bernd Waibel <waebbl <AT> gmail.com>
14 Closes: https://github.com/gentoo/gentoo/pull/17152
15 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
16
17 media-libs/ilmbase/files/ilmbase-2.5.2-musl.patch | 50 +++++++++++++++++++++++
18 media-libs/ilmbase/ilmbase-2.5.2.ebuild | 2 +
19 2 files changed, 52 insertions(+)
20
21 diff --git a/media-libs/ilmbase/files/ilmbase-2.5.2-musl.patch b/media-libs/ilmbase/files/ilmbase-2.5.2-musl.patch
22 new file mode 100644
23 index 00000000000..80f11e44c12
24 --- /dev/null
25 +++ b/media-libs/ilmbase/files/ilmbase-2.5.2-musl.patch
26 @@ -0,0 +1,50 @@
27 +From c7af102e6bce6638add2f38576ffe9c6741ba768 Mon Sep 17 00:00:00 2001
28 +From: =?UTF-8?q?Niklas=20Hamb=C3=BCchen?= <mail@×××.me>
29 +Date: Thu, 30 Jul 2020 02:21:07 +0200
30 +Subject: [PATCH] IexMathFpu.cpp: Fix build on non-glibc (e.g. musl libc).
31 +MIME-Version: 1.0
32 +Content-Type: text/plain; charset=UTF-8
33 +Content-Transfer-Encoding: 8bit
34 +
35 +Originally from:
36 +https://github.com/void-linux/void-packages/blob/80bbc168faa25448bd3399f4df331b836e74b85c/srcpkgs/ilmbase/patches/musl-_fpstate.patch
37 +
38 +Fixes error:
39 +
40 + IlmBase/IexMath/IexMathFpu.cpp: In function ‘void Iex_2_4::FpuControl::restoreControlRegs(const ucontext_t&, bool)’:
41 + IlmBase/IexMath/IexMathFpu.cpp:284:38: error: ‘struct _fpstate’ has no member named ‘cw’; did you mean ‘cwd’?
42 + 284 | setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal);
43 + | ^~
44 + | cwd
45 + IlmBase/IexMath/IexMathFpu.cpp:287:20: error: ‘struct Iex_2_4::FpuControl::_fpstate_64’ has no member named ‘magic’
46 + 287 | setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
47 + | ^~~~~
48 +
49 +Signed-off-by: Niklas Hambüchen <mail@×××.me>
50 +---
51 + IlmBase/IexMath/IexMathFpu.cpp | 8 ++++++++
52 + 1 file changed, 8 insertions(+)
53 +
54 +diff --git a/IlmBase/IexMath/IexMathFpu.cpp b/IlmBase/IexMath/IexMathFpu.cpp
55 +index ceed658e0..439329e50 100644
56 +--- a/IexMath/IexMathFpu.cpp
57 ++++ b/IexMath/IexMathFpu.cpp
58 +@@ -281,10 +281,18 @@ restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
59 + inline void
60 + restoreControlRegs (const ucontext_t & ucon, bool clearExceptions)
61 + {
62 ++#if defined(__GLIBC__) || defined(__i386__)
63 + setCw ((ucon.uc_mcontext.fpregs->cw & cwRestoreMask) | cwRestoreVal);
64 ++#else
65 ++ setCw ((ucon.uc_mcontext.fpregs->cwd & cwRestoreMask) | cwRestoreVal);
66 ++#endif
67 +
68 + _fpstate * kfp = reinterpret_cast<_fpstate *> (ucon.uc_mcontext.fpregs);
69 ++#if defined(__GLIBC__) || defined(__i386__)
70 + setMxcsr (kfp->magic == 0 ? kfp->mxcsr : 0, clearExceptions);
71 ++#else
72 ++ setMxcsr (kfp->mxcsr, clearExceptions);
73 ++#endif
74 + }
75 +
76 + #endif
77
78 diff --git a/media-libs/ilmbase/ilmbase-2.5.2.ebuild b/media-libs/ilmbase/ilmbase-2.5.2.ebuild
79 index 47154bbc258..3e9e28c4411 100644
80 --- a/media-libs/ilmbase/ilmbase-2.5.2.ebuild
81 +++ b/media-libs/ilmbase/ilmbase-2.5.2.ebuild
82 @@ -22,6 +22,8 @@ S="${WORKDIR}/openexr-${PV}/IlmBase"
83
84 MULTILIB_WRAPPED_HEADERS=( /usr/include/OpenEXR/IlmBaseConfigInternal.h )
85
86 +PATCHES=( "${FILESDIR}"/${P}-musl.patch )
87 +
88 multilib_src_configure() {
89 local mycmakeargs=(
90 -DBUILD_TESTING=$(usex test)