summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJory Pratt <anarchy@gentoo.org>2022-06-22 13:21:34 -0500
committerJory Pratt <anarchy@gentoo.org>2022-06-22 13:24:22 -0500
commit72e5e8c938fdcfcbae27c8cd37b4449e5c8623f4 (patch)
tree8bb3804240cb62d76f8917711e10bd1d03df093a /dev-libs
parentdev-python/immutables: Stabilize 0.18 ppc64, #853796 (diff)
downloadgentoo-72e5e8c938fdcfcbae27c8cd37b4449e5c8623f4.tar.gz
gentoo-72e5e8c938fdcfcbae27c8cd37b4449e5c8623f4.tar.bz2
gentoo-72e5e8c938fdcfcbae27c8cd37b4449e5c8623f4.zip
dev-libs/flatbuffers: Fix base.h for locale define
Package-Manager: Portage-3.0.30, Repoman-3.0.3 Signed-off-by: Jory Pratt <anarchy@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/flatbuffers/files/flatbuffers-2.0.6-locales-detection-fixup.patch26
-rw-r--r--dev-libs/flatbuffers/flatbuffers-2.0.6-r1.ebuild (renamed from dev-libs/flatbuffers/flatbuffers-2.0.6.ebuild)6
2 files changed, 30 insertions, 2 deletions
diff --git a/dev-libs/flatbuffers/files/flatbuffers-2.0.6-locales-detection-fixup.patch b/dev-libs/flatbuffers/files/flatbuffers-2.0.6-locales-detection-fixup.patch
new file mode 100644
index 000000000000..6ab1b085876c
--- /dev/null
+++ b/dev-libs/flatbuffers/files/flatbuffers-2.0.6-locales-detection-fixup.patch
@@ -0,0 +1,26 @@
+From f10f1fdeab9dedf8206965b73a52e02e3de3bc41 Mon Sep 17 00:00:00 2001
+From: Jory Pratt <anarchy@gentoo.org>
+Date: Wed, 22 Jun 2022 13:09:43 -0500
+Subject: [PATCH] Fix base.h to only include locale support for glibc users
+
+Signed-off-by: Jory Pratt <anarchy@gentoo.org>
+---
+ include/flatbuffers/base.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/flatbuffers/base.h b/include/flatbuffers/base.h
+index 458ac3f..46d6d80 100644
+--- a/include/flatbuffers/base.h
++++ b/include/flatbuffers/base.h
+@@ -262,7 +262,7 @@ namespace flatbuffers {
+ #ifndef FLATBUFFERS_LOCALE_INDEPENDENT
+ // Enable locale independent functions {strtof_l, strtod_l,strtoll_l, strtoull_l}.
+ #if ((defined(_MSC_VER) && _MSC_VER >= 1800) || \
+- (defined(_XOPEN_VERSION) && (_XOPEN_VERSION>=700)) && (!defined(__ANDROID_API__) || (defined(__ANDROID_API__) && (__ANDROID_API__>=21))))
++ (defined(__GLIBC__) && defined(_XOPEN_VERSION) && (_XOPEN_VERSION>=700)) && (!defined(__ANDROID_API__) || (defined(__ANDROID_API__) && (__ANDROID_API__>=21))))
+ #define FLATBUFFERS_LOCALE_INDEPENDENT 1
+ #else
+ #define FLATBUFFERS_LOCALE_INDEPENDENT 0
+--
+2.35.1
+
diff --git a/dev-libs/flatbuffers/flatbuffers-2.0.6.ebuild b/dev-libs/flatbuffers/flatbuffers-2.0.6-r1.ebuild
index 64468eb1ae19..85b401a3de3a 100644
--- a/dev-libs/flatbuffers/flatbuffers-2.0.6.ebuild
+++ b/dev-libs/flatbuffers/flatbuffers-2.0.6-r1.ebuild
@@ -21,6 +21,10 @@ RESTRICT="test !test? ( test )"
DOCS=( readme.md )
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.0.6-locales-detection-fixup.patch
+)
+
src_configure() {
local mycmakeargs=(
-DFLATBUFFERS_BUILD_FLATLIB=$(usex static-libs)
@@ -29,7 +33,5 @@ src_configure() {
-DFLATBUFFERS_BUILD_BENCHMARKS=OFF
)
- use elibc_musl && mycmakeargs+=( -DFLATBUFFERS_LOCALE_INDEPENDENT=0 )
-
cmake_src_configure
}