Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/opencolorio/, media-libs/opencolorio/files/
Date: Thu, 01 Sep 2022 02:06:34
Message-Id: 1661997926.855ef95061367779af0f38f7afd291af21616403.sam@gentoo
1 commit: 855ef95061367779af0f38f7afd291af21616403
2 Author: brahmajit das <listout <AT> protonmail <DOT> com>
3 AuthorDate: Tue Aug 23 09:25:51 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Thu Sep 1 02:05:26 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=855ef950
7
8 media-libs/opencolorio: Fix strtol_l on musl
9
10 Fix strtol_l missing on musl. On musl libc use strtol
11 Taken from Alpine Linux, please refer:
12 https://git.alpinelinux.org/aports/tree/community/opencolorio/0002-fix-strtol.patch
13
14 Closes: https://bugs.gentoo.org/829453
15
16 Signed-off-by: brahmajit das <listout <AT> protonmail.com>
17 Closes: https://github.com/gentoo/gentoo/pull/26855
18 Signed-off-by: Sam James <sam <AT> gentoo.org>
19
20 .../files/opencolorio-2.1.2-musl-strtol.patch | 27 ++++++++++++++++++++++
21 media-libs/opencolorio/opencolorio-2.1.2.ebuild | 1 +
22 2 files changed, 28 insertions(+)
23
24 diff --git a/media-libs/opencolorio/files/opencolorio-2.1.2-musl-strtol.patch b/media-libs/opencolorio/files/opencolorio-2.1.2-musl-strtol.patch
25 new file mode 100644
26 index 000000000000..87059614ff03
27 --- /dev/null
28 +++ b/media-libs/opencolorio/files/opencolorio-2.1.2-musl-strtol.patch
29 @@ -0,0 +1,27 @@
30 +# Fix strtol_l missing on musl. On musl libc use strtol
31 +# Taken from Alpine Linux, please refer:
32 +# https://git.alpinelinux.org/aports/tree/community/opencolorio/0002-fix-strtol.patch?id=dd7ba461824ab0618f0493cbb450b221fdc2513c
33 +# Please refer: https://github.com/AcademySoftwareFoundation/OpenColorIO/issues/1624
34 +--- a/src/utils/NumberUtils.h
35 ++++ b/src/utils/NumberUtils.h
36 +@@ -68,7 +68,7 @@ really_inline from_chars_result from_chars(const char *first, const char *last,
37 + tempval = ::strtod_l(first, &endptr, loc.local);
38 + #endif
39 +
40 +- if (errno != 0)
41 ++ if (errno != 0 && errno != EINVAL)
42 + {
43 + return {first + (endptr - first), std::errc::result_out_of_range};
44 + }
45 +@@ -139,8 +139,10 @@ really_inline from_chars_result from_chars(const char *first, const char *last,
46 + long int
47 + #ifdef _WIN32
48 + tempval = _strtol_l(first, &endptr, 0, loc.local);
49 +-#else
50 ++#elif defined(__GLIBC__)
51 + tempval = ::strtol_l(first, &endptr, 0, loc.local);
52 ++#else
53 ++ tempval = ::strtol(first, &endptr, 0);
54 + #endif
55 +
56 + if (errno != 0)
57
58 diff --git a/media-libs/opencolorio/opencolorio-2.1.2.ebuild b/media-libs/opencolorio/opencolorio-2.1.2.ebuild
59 index 17b4b7fb8e1f..eda322b00de6 100644
60 --- a/media-libs/opencolorio/opencolorio-2.1.2.ebuild
61 +++ b/media-libs/opencolorio/opencolorio-2.1.2.ebuild
62 @@ -55,6 +55,7 @@ RESTRICT="test"
63
64 PATCHES=(
65 "${FILESDIR}"/${PN}-2.1.1-gcc12.patch
66 + "${FILESDIR}"/${PN}-2.1.2-musl-strtol.patch
67 )
68
69 pkg_setup() {