summaryrefslogtreecommitdiff
path: root/dev-cpp/folly
diff options
context:
space:
mode:
authorroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
committerroot <root@alpha.trunkmasters.com>2026-06-04 05:48:38 -0500
commitbfd9c39e4712ebdb442d4ca0673061faed1e70e1 (patch)
tree0d7a74b4463ee387f9cf9368ceb1b757f694f72a /dev-cpp/folly
parentf716a9fe6455d39eef01e718aae68dae61c19704 (diff)
downloadbaldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.gz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.tar.xz
baldeagleos-repo-bfd9c39e4712ebdb442d4ca0673061faed1e70e1.zip
Revert "Adding metadata"
This reverts commit f716a9fe6455d39eef01e718aae68dae61c19704.
Diffstat (limited to 'dev-cpp/folly')
-rw-r--r--dev-cpp/folly/Manifest3
-rw-r--r--dev-cpp/folly/files/folly-2023.05.22.00-musl-fix.patch26
-rw-r--r--dev-cpp/folly/files/folly-2023.06.19.00-fmt.patch62
-rw-r--r--dev-cpp/folly/files/folly-2024.11.04.00-musl-fix.patch30
-rw-r--r--dev-cpp/folly/files/folly-2025.04.14.00-CMake-Avoid-finding-liburing.patch30
-rw-r--r--dev-cpp/folly/files/folly-2025.04.14.00-boost-1.89.patch22
-rw-r--r--dev-cpp/folly/files/folly-2025.04.14.00-force-liburing-off.patch27
-rw-r--r--dev-cpp/folly/files/folly-2025.04.14.00-gcc16-workaround.patch62
-rw-r--r--dev-cpp/folly/folly-2023.06.19.00-r1.ebuild91
-rw-r--r--dev-cpp/folly/folly-2024.11.04.00-r2.ebuild116
-rw-r--r--dev-cpp/folly/folly-2025.04.14.00-r1.ebuild125
-rw-r--r--dev-cpp/folly/folly-2025.04.14.00-r2.ebuild127
-rw-r--r--dev-cpp/folly/metadata.xml15
13 files changed, 736 insertions, 0 deletions
diff --git a/dev-cpp/folly/Manifest b/dev-cpp/folly/Manifest
new file mode 100644
index 000000000000..c4bbc6ffb626
--- /dev/null
+++ b/dev-cpp/folly/Manifest
@@ -0,0 +1,3 @@
+DIST folly-v2023.06.19.00.tar.gz 3850872 BLAKE2B 6332b6de28fd4a0c19b20c4b23fa7093bded940fb07de92ad9fa7f44b8347fb5e5543e5a57c32d2414f345b4f7b306eed806c5d48a871a06833c1d2a71a34584 SHA512 9189adddf59019787969c7edb27a3e57436c2dca772f3142cdbf66e3a69b398be7ae4f2c36a9576c7ad9c51fd3703555e2a7ad6ed1ddce4036f8760d8095d371
+DIST folly-v2024.11.04.00.tar.gz 4185762 BLAKE2B 16eca3bde4320b2c5dd535afddb2640f567135ea90e7a270814bda56eb0d2ba4e864e07015879bb79d1146c68e05695eb06e2219e3dd3b4f71a1434e6f2998a5 SHA512 918ec7217a58789818c502c47302d9296867456bb3dd1c36480406905875eae9a7d52900def34ac1a936af9be6010b8b77897b351c36aa8ca09c16fe1775f508
+DIST folly-v2025.04.14.00.tar.gz 4297358 BLAKE2B df2687d1fe27cc71b0e5a5bfc4b82e1b45d7537bd372f51b3db7c2d20b467d3f0354b377f1c0a64a795f125fd56fb472b585eaad656e07df84c83efe9373d1dd SHA512 19623482df0372a9e2b43b0e718aeed22571f773b0f4e479a41b3e2cac58814f7dc73fb4ae3a3311e87d2836b32c72b92cbe51ef8621242a059e820a70a75e48
diff --git a/dev-cpp/folly/files/folly-2023.05.22.00-musl-fix.patch b/dev-cpp/folly/files/folly-2023.05.22.00-musl-fix.patch
new file mode 100644
index 000000000000..6f92db0a785a
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2023.05.22.00-musl-fix.patch
@@ -0,0 +1,26 @@
+# Elf.cpp expects __ELF_NATIVE_CLASS to be defined at least for platforms
+# besides FreeBSD-based ones, and so it defines FOLLY_ELF_NATIVE_CLASS with it.
+# Without __ELF_NATIVE_CLASS (and apparently musl does not define it),
+# FOLLY_ELF_NATIVE_CLASS is also not defined so what was supposed to be
+# expanded to ELFCLASS32 or ELFCLASS64 ends up being
+# ELFCLASSFOLLY_ELF_NATIVE_CLASS.
+#
+# Please refer: https://github.com/facebook/folly/issues/1478
+#
+# Closes: https://bugs.gentoo.org/835744
+--- a/folly/experimental/symbolizer/Elf.cpp
++++ b/folly/experimental/symbolizer/Elf.cpp
+@@ -39,12 +39,10 @@
+
+ #if defined(__ELF_NATIVE_CLASS)
+ #define FOLLY_ELF_NATIVE_CLASS __ELF_NATIVE_CLASS
+-#elif defined(__FreeBSD__)
+-#if defined(__LP64__)
++#elif defined(__LP64__)
+ #define FOLLY_ELF_NATIVE_CLASS 64
+ #else
+ #define FOLLY_ELF_NATIVE_CLASS 32
+-#endif
+ #endif // __ELF_NATIVE_CLASS
+
+ namespace folly {
diff --git a/dev-cpp/folly/files/folly-2023.06.19.00-fmt.patch b/dev-cpp/folly/files/folly-2023.06.19.00-fmt.patch
new file mode 100644
index 000000000000..80e4a2fbf80a
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2023.06.19.00-fmt.patch
@@ -0,0 +1,62 @@
+https://github.com/facebook/folly/commit/a65b35c03797c86969a7b0d9ec281935a21cfa18
+https://github.com/facebook/folly/pull/2022
+
+From a65b35c03797c86969a7b0d9ec281935a21cfa18 Mon Sep 17 00:00:00 2001
+From: Giuseppe Ottaviano <ott@meta.com>
+Date: Sun, 18 Jun 2023 00:40:43 -0700
+Subject: [PATCH] fmt/core.h is enough in Core.cpp
+
+Reviewed By: Orvid, luciang
+
+Differential Revision: D46788525
+
+fbshipit-source-id: 03da65f3499ca56b34baa4e75b2340bea36690f6
+---
+ folly/futures/detail/Core.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/folly/futures/detail/Core.cpp b/folly/futures/detail/Core.cpp
+index 26bd4afbffe..858229100f9 100644
+--- a/folly/futures/detail/Core.cpp
++++ b/folly/futures/detail/Core.cpp
+@@ -18,7 +18,7 @@
+
+ #include <new>
+
+-#include <fmt/format.h>
++#include <fmt/core.h>
+ #include <folly/lang/Assume.h>
+
+ namespace folly {
+
+From d783a64391c02b40d78dfc6be04932fa45c46b9a Mon Sep 17 00:00:00 2001
+From: Marcus Holland-Moritz <github@mhxnet.de>
+Date: Tue, 20 Jun 2023 11:59:42 +0200
+Subject: [PATCH] Fix libfmt errors from not finding enum formatter
+
+Recent versions of libfmt have become more strict and require
+`enum` types to be formattable:
+
+ static assertion failed due to requirement 'formattable': Cannot format an argument. To make type T formattable provide a formatter<T> specialization: https://fmt.dev/latest/api.html#udt
+
+This is a quick fix to simply use the underlying type.
+--- a/folly/futures/detail/Core.cpp
++++ b/folly/futures/detail/Core.cpp
+@@ -19,6 +19,7 @@
+ #include <new>
+
+ #include <fmt/core.h>
++#include <folly/Utility.h>
+ #include <folly/lang/Assume.h>
+
+ namespace folly {
+@@ -30,7 +31,7 @@ namespace {
+ template <class Enum>
+ void terminate_unexpected_state(fmt::string_view context, Enum state) {
+ terminate_with<std::logic_error>(
+- fmt::format("{} unexpected state: {}", context, state));
++ fmt::format("{} unexpected state: {}", context, to_underlying(state)));
+ }
+
+ } // namespace
+
diff --git a/dev-cpp/folly/files/folly-2024.11.04.00-musl-fix.patch b/dev-cpp/folly/files/folly-2024.11.04.00-musl-fix.patch
new file mode 100644
index 000000000000..df9a1db734a3
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2024.11.04.00-musl-fix.patch
@@ -0,0 +1,30 @@
+# Elf.cpp expects __ELF_NATIVE_CLASS to be defined at least for platforms
+# besides FreeBSD-based ones, and so it defines FOLLY_ELF_NATIVE_CLASS with it.
+# Without __ELF_NATIVE_CLASS (and apparently musl does not define it),
+# FOLLY_ELF_NATIVE_CLASS is also not defined so what was supposed to be
+# expanded to ELFCLASS32 or ELFCLASS64 ends up being
+# ELFCLASSFOLLY_ELF_NATIVE_CLASS.
+#
+# Please refer: https://github.com/facebook/folly/issues/1478
+#
+# Closes: https://bugs.gentoo.org/835744
+--- a/folly/debugging/symbolizer/Elf.cpp
++++ b/folly/debugging/symbolizer/Elf.cpp
+@@ -40,14 +40,12 @@
+
+ #if defined(__ELF_NATIVE_CLASS)
+ #define FOLLY_ELF_NATIVE_CLASS __ELF_NATIVE_CLASS
+-#elif defined(__FreeBSD__)
+-#if defined(__LP64__)
++#elif defined(__ANDROID__)
++#define FOLLY_ELF_NATIVE_CLASS __WORDSIZE
++#elif defined(__LP64__)
+ #define FOLLY_ELF_NATIVE_CLASS 64
+ #else
+ #define FOLLY_ELF_NATIVE_CLASS 32
+-#endif
+-#elif defined(__ANDROID__)
+-#define FOLLY_ELF_NATIVE_CLASS __WORDSIZE
+ #endif // __ELF_NATIVE_CLASS
+
+ namespace folly {
diff --git a/dev-cpp/folly/files/folly-2025.04.14.00-CMake-Avoid-finding-liburing.patch b/dev-cpp/folly/files/folly-2025.04.14.00-CMake-Avoid-finding-liburing.patch
new file mode 100644
index 000000000000..80399fb9c432
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2025.04.14.00-CMake-Avoid-finding-liburing.patch
@@ -0,0 +1,30 @@
+From a0d86ed3bc2150ddfad50ab1b2eb09bea7a277d2 Mon Sep 17 00:00:00 2001
+From: sin-ack <sin-ack@protonmail.com>
+Date: Thu, 24 Apr 2025 20:59:06 +0000
+Subject: [PATCH] CMake: Avoid finding liburing
+
+Otherwise, Folly will unconditionally add it to the list of libraries to
+link even if io_uring support is otherwise disabled, creating an
+implicit dependency on it that can't be tracked by package managers.
+---
+ CMake/folly-deps.cmake | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/CMake/folly-deps.cmake b/CMake/folly-deps.cmake
+index 6ce4c679a..b1e20a901 100644
+--- a/CMake/folly-deps.cmake
++++ b/CMake/folly-deps.cmake
+@@ -139,10 +139,6 @@ find_package(LibAIO)
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBAIO_LIBRARIES})
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBAIO_INCLUDE_DIRS})
+
+-find_package(LibUring)
+-list(APPEND FOLLY_LINK_LIBRARIES ${LIBURING_LIBRARIES})
+-list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBURING_INCLUDE_DIRS})
+-
+ find_package(Libsodium)
+ list(APPEND FOLLY_LINK_LIBRARIES ${LIBSODIUM_LIBRARIES})
+ list(APPEND FOLLY_INCLUDE_DIRECTORIES ${LIBSODIUM_INCLUDE_DIRS})
+--
+2.49.0
+
diff --git a/dev-cpp/folly/files/folly-2025.04.14.00-boost-1.89.patch b/dev-cpp/folly/files/folly-2025.04.14.00-boost-1.89.patch
new file mode 100644
index 000000000000..eb9e55e5739c
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2025.04.14.00-boost-1.89.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/962946
+https://github.com/facebook/folly/issues/2489
+--- a/CMake/folly-config.cmake.in
++++ b/CMake/folly-config.cmake.in
+@@ -38,7 +38,6 @@ find_dependency(Boost 1.51.0 MODULE
+ filesystem
+ program_options
+ regex
+- system
+ thread
+ REQUIRED
+ )
+--- a/CMake/folly-deps.cmake
++++ b/CMake/folly-deps.cmake
+@@ -41,7 +41,6 @@ find_package(Boost 1.51.0 MODULE
+ filesystem
+ program_options
+ regex
+- system
+ thread
+ REQUIRED
+ )
diff --git a/dev-cpp/folly/files/folly-2025.04.14.00-force-liburing-off.patch b/dev-cpp/folly/files/folly-2025.04.14.00-force-liburing-off.patch
new file mode 100644
index 000000000000..e0c76d131a29
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2025.04.14.00-force-liburing-off.patch
@@ -0,0 +1,27 @@
+From 1a86fa74e6468f1e10a361a79a441e95f2706d0d Mon Sep 17 00:00:00 2001
+From: sin-ack <sin-ack@protonmail.com>
+Date: Mon, 21 Apr 2025 14:43:56 +0200
+Subject: [PATCH] Forcibly disable liburing support
+
+Folly doesn't have a configure option for disabling liburing, so we
+must manually disable it with this patch.
+---
+ folly/io/async/Liburing.h | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/folly/io/async/Liburing.h b/folly/io/async/Liburing.h
+index 8e81aaae9..64c3ffc0c 100644
+--- a/folly/io/async/Liburing.h
++++ b/folly/io/async/Liburing.h
+@@ -16,8 +16,4 @@
+
+ #pragma once
+
+-#if defined(__linux__) && __has_include(<liburing.h>)
+-#define FOLLY_HAS_LIBURING 1
+-#else
+ #define FOLLY_HAS_LIBURING 0
+-#endif
+--
+2.49.0
+
diff --git a/dev-cpp/folly/files/folly-2025.04.14.00-gcc16-workaround.patch b/dev-cpp/folly/files/folly-2025.04.14.00-gcc16-workaround.patch
new file mode 100644
index 000000000000..975bd066bbfe
--- /dev/null
+++ b/dev-cpp/folly/files/folly-2025.04.14.00-gcc16-workaround.patch
@@ -0,0 +1,62 @@
+https://bugs.gentoo.org/963586
+https://gcc.gnu.org/PR122171
+--- a/folly/Fingerprint.cpp
++++ b/folly/Fingerprint.cpp
+@@ -86,7 +86,7 @@ constexpr auto copy_table(D const (&table)[S0][S1][S2]) {
+ }
+
+ template <size_t Deg>
+-constexpr poly_table<Deg> make_poly_table() {
++constexpr std::array<std::array<std::array<uint64_t, poly_size(Deg)>, 256>, 8> make_poly_table() {
+ FingerprintPolynomial<Deg> poly(FingerprintTablePoly<Deg>::data);
+ uint64_t table[8][256][poly_size(Deg)] = {};
+ // table[i][q] is Q(X) * X^(k+8*i) mod P(X),
+@@ -125,11 +125,11 @@ const uint64_t FingerprintTable<128>::poly[poly_size(128)] = {
+ FingerprintTablePoly<127>::data[0], FingerprintTablePoly<127>::data[1]};
+
+ template <>
+-const poly_table<64> FingerprintTable<64>::table = poly_table_63;
++const std::array<std::array<std::array<uint64_t, poly_size(64)>, 256>, 8> FingerprintTable<64>::table = poly_table_63;
+ template <>
+-const poly_table<96> FingerprintTable<96>::table = poly_table_95;
++const std::array<std::array<std::array<uint64_t, poly_size(96)>, 256>, 8> FingerprintTable<96>::table = poly_table_95;
+ template <>
+-const poly_table<128> FingerprintTable<128>::table = poly_table_127;
++const std::array<std::array<std::array<uint64_t, poly_size(128)>, 256>, 8> FingerprintTable<128>::table = poly_table_127;
+
+ } // namespace detail
+ } // namespace folly
+--- a/folly/Fingerprint.h
++++ b/folly/Fingerprint.h
+@@ -54,20 +54,16 @@ constexpr size_t poly_size(size_t bits) {
+ return 1 + (bits - 1) / 64;
+ }
+
+-template <size_t Deg>
+-using poly_table =
+- std::array<std::array<std::array<uint64_t, poly_size(Deg)>, 256>, 8>;
+-
+ template <int BITS>
+ struct FingerprintTable {
+ static const uint64_t poly[poly_size(BITS)];
+- static const poly_table<BITS> table;
++ static const std::array<std::array<std::array<uint64_t, poly_size(BITS)>, 256>, 8> table;
+ };
+
+ template <int BITS>
+ const uint64_t FingerprintTable<BITS>::poly[poly_size(BITS)] = {};
+ template <int BITS>
+-const poly_table<BITS> FingerprintTable<BITS>::table = {};
++const std::array<std::array<std::array<uint64_t, poly_size(BITS)>, 256>, 8> FingerprintTable<BITS>::table = {};
+
+ #ifndef _MSC_VER
+ // MSVC as of 2017 can't handle these extern specialization declarations,
+@@ -78,7 +74,7 @@ const poly_table<BITS> FingerprintTable<BITS>::table = {};
+ template <> \
+ const uint64_t FingerprintTable<BITS>::poly[poly_size(BITS)]; \
+ template <> \
+- const poly_table<BITS> FingerprintTable<BITS>::table
++ const std::array<std::array<std::array<uint64_t, poly_size(BITS)>, 256>, 8> FingerprintTable<BITS>::table
+
+ FOLLY_DECLARE_FINGERPRINT_TABLES(64);
+ FOLLY_DECLARE_FINGERPRINT_TABLES(96);
diff --git a/dev-cpp/folly/folly-2023.06.19.00-r1.ebuild b/dev-cpp/folly/folly-2023.06.19.00-r1.ebuild
new file mode 100644
index 000000000000..777723a3e707
--- /dev/null
+++ b/dev-cpp/folly/folly-2023.06.19.00-r1.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# These must be bumped together:
+# dev-cpp/edencommon
+# dev-cpp/folly
+# dev-util/watchman
+
+inherit cmake
+
+DESCRIPTION="An open-source C++ library developed and used at Facebook"
+HOMEPAGE="https://github.com/facebook/folly"
+SRC_URI="https://github.com/facebook/folly/releases/download/v${PV}/${PN}-v${PV}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~ppc64"
+IUSE="llvm-libunwind test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ app-arch/bzip2
+ app-arch/lz4:=
+ app-arch/snappy:=
+ app-arch/xz-utils
+ app-arch/zstd:=
+ dev-cpp/gflags:=
+ dev-cpp/glog:=[gflags]
+ dev-libs/boost:=[context]
+ dev-libs/double-conversion:=
+ dev-libs/libaio
+ dev-libs/libevent:=
+ <dev-libs/libfmt-11:=
+ dev-libs/libsodium:=
+ dev-libs/openssl:=
+ >=sys-libs/liburing-2.3:=
+ virtual/zlib:=
+ llvm-libunwind? ( llvm-runtimes/libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+"
+# libiberty is linked statically
+DEPEND="
+ ${RDEPEND}
+ sys-libs/binutils-libs
+ test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2023.05.22.00-musl-fix.patch
+ "${FILESDIR}"/${PN}-2023.06.19.00-fmt.patch
+)
+
+src_unpack() {
+ # Workaround for bug #889420
+ mkdir -p "${S}" || die
+ cd "${S}" || die
+ default
+}
+
+src_configure() {
+ # TODO: liburing could in theory be optional but fails to link
+ local mycmakeargs=(
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+
+ -DBUILD_TESTS=$(usex test)
+
+ # https://github.com/gentoo/gentoo/pull/29393
+ -DCMAKE_LIBRARY_ARCHITECTURE=$(usex amd64 x86_64 ${ARCH})
+ )
+
+ cmake_src_configure
+}
+
+src_test() {
+ local myctestargs=(
+ # - timeseries_histogram_test.TimeseriesHistogram.Percentile|HHWheelTimerTest
+ # Long-standing known test failure
+ # TODO: report upstream
+ # - HHWheelTimerTest.HHWheelTimerTest.CancelTimeout
+ # Timeouts are fragile
+ # - concurrent_hash_map_test.*
+ # TODO: All SIGSEGV, report upstream!
+ # - ssl_errors_test.SSLErrorsTest.TestMessage
+ # Network...?
+ -E "(timeseries_histogram_test.TimeseriesHistogram.Percentile|HHWheelTimerTest.HHWheelTimerTest.CancelTimeout|concurrent_hash_map_test.*|ssl_errors_test.SSLErrorsTest.TestMessage)"
+ )
+
+ cmake_src_test
+}
diff --git a/dev-cpp/folly/folly-2024.11.04.00-r2.ebuild b/dev-cpp/folly/folly-2024.11.04.00-r2.ebuild
new file mode 100644
index 000000000000..6c715c7b5636
--- /dev/null
+++ b/dev-cpp/folly/folly-2024.11.04.00-r2.ebuild
@@ -0,0 +1,116 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# These must be bumped together:
+# dev-cpp/edencommon
+# dev-cpp/fb303
+# dev-cpp/fbthrift
+# dev-cpp/fizz
+# dev-cpp/folly
+# dev-cpp/mvfst
+# dev-cpp/wangle
+# dev-util/watchman
+
+inherit flag-o-matic cmake toolchain-funcs
+
+DESCRIPTION="An open-source C++ library developed and used at Facebook"
+HOMEPAGE="https://github.com/facebook/folly"
+SRC_URI="https://github.com/facebook/folly/releases/download/v${PV}/${PN}-v${PV}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~arm64 ~ppc64"
+IUSE="llvm-libunwind test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ app-arch/bzip2
+ app-arch/lz4:=
+ app-arch/snappy:=
+ app-arch/xz-utils
+ app-arch/zstd:=
+ dev-cpp/fast_float:=
+ dev-cpp/gflags:=
+ dev-cpp/glog:=[gflags]
+ dev-libs/boost:=[context]
+ dev-libs/double-conversion:=
+ dev-libs/libaio
+ dev-libs/libevent:=
+ dev-libs/libfmt:=
+ dev-libs/libsodium:=
+ dev-libs/openssl:=
+ >=sys-libs/liburing-2.3:=
+ virtual/zlib:=
+ llvm-libunwind? ( llvm-runtimes/libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+"
+# libiberty is linked statically
+DEPEND="
+ ${RDEPEND}
+ sys-libs/binutils-libs
+ test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2024.11.04.00-musl-fix.patch
+)
+
+src_unpack() {
+ # Workaround for bug #889420
+ mkdir -p "${S}" || die
+ cd "${S}" || die
+ default
+}
+
+src_configure() {
+ # bug #949607
+ filter-lto
+
+ # TODO: liburing could in theory be optional but fails to link
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_DIR="$(get_libdir)/cmake/${PN}"
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+
+ -DBUILD_TESTS=$(usex test)
+
+ # https://github.com/gentoo/gentoo/pull/29393
+ -DCMAKE_LIBRARY_ARCHITECTURE=$(usex amd64 x86_64 ${ARCH})
+ )
+
+ # https://github.com/facebook/folly/issues/1984
+ use arm64 && append-cxxflags "-flax-vector-conversions"
+
+ cmake_src_configure
+}
+
+src_test() {
+ CMAKE_SKIP_TESTS=(
+ # Mysterious "invalid json" failure
+ io_async_ssl_session_test.SSLSessionTest
+ singleton_thread_local_test.SingletonThreadLocalDeathTest
+ # TODO: All SIGSEGV, report upstream!
+ 'concurrency_concurrent_hash_map_test.*'
+ )
+
+ if use arm64; then
+ CMAKE_SKIP_TESTS+=(
+ # Tests are flaky/timing dependent on both QEMU chroot and real hardware
+ io_async_hh_wheel_timer_test.HHWheelTimerTest
+ # Times out on real hardware
+ concurrent_skip_list_test.ConcurrentSkipList
+ futures_retrying_test.RetryingTest.largeRetries
+ )
+ fi
+
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ CMAKE_SKIP_TESTS+=(
+ # Aborts with libc++.
+ # https://github.com/facebook/folly/issues/2345
+ buffered_atomic_test.BufferedAtomic.singleThreadUnguardedAccess
+ )
+ fi
+
+ cmake_src_test
+}
diff --git a/dev-cpp/folly/folly-2025.04.14.00-r1.ebuild b/dev-cpp/folly/folly-2025.04.14.00-r1.ebuild
new file mode 100644
index 000000000000..c80379393b45
--- /dev/null
+++ b/dev-cpp/folly/folly-2025.04.14.00-r1.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# These must be bumped together:
+# dev-cpp/edencommon
+# dev-cpp/fb303
+# dev-cpp/fbthrift
+# dev-cpp/fizz
+# dev-cpp/folly
+# dev-cpp/mvfst
+# dev-cpp/wangle
+# dev-util/watchman
+
+inherit flag-o-matic cmake toolchain-funcs
+
+DESCRIPTION="An open-source C++ library developed and used at Facebook"
+HOMEPAGE="https://github.com/facebook/folly"
+SRC_URI="https://github.com/facebook/folly/releases/download/v${PV}/${PN}-v${PV}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~arm64 ~ppc64"
+IUSE="io-uring llvm-libunwind test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ app-arch/bzip2
+ app-arch/lz4:=
+ app-arch/snappy:=
+ app-arch/xz-utils
+ app-arch/zstd:=
+ dev-cpp/fast_float:=
+ dev-cpp/gflags:=
+ dev-cpp/glog:=[gflags]
+ dev-libs/boost:=[context]
+ dev-libs/double-conversion:=
+ dev-libs/libaio
+ dev-libs/libevent:=
+ dev-libs/libfmt:=
+ dev-libs/libsodium:=
+ dev-libs/openssl:=
+ virtual/zlib:=
+ llvm-libunwind? ( llvm-runtimes/libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+ io-uring? ( >=sys-libs/liburing-2.10:= )
+"
+DEPEND="
+ ${RDEPEND}
+ sys-libs/binutils-libs
+ test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2024.11.04.00-musl-fix.patch
+)
+
+src_unpack() {
+ # Workaround for bug #889420
+ mkdir -p "${S}" || die
+ cd "${S}" || die
+ default
+}
+
+src_prepare() {
+ # Folly has no configuration option for disabling io_uring support
+ # so we need to patch it out.
+ if use !io-uring; then
+ eapply "${FILESDIR}"/${PN}-2025.04.14.00-force-liburing-off.patch
+ eapply "${FILESDIR}"/${PN}-2025.04.14.00-CMake-Avoid-finding-liburing.patch
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # bug #949607
+ filter-lto
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_DIR="$(get_libdir)/cmake/${PN}"
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+
+ -DBUILD_TESTS=$(usex test)
+
+ # https://github.com/gentoo/gentoo/pull/29393
+ -DCMAKE_LIBRARY_ARCHITECTURE=$(usex amd64 x86_64 ${ARCH})
+ )
+
+ # https://github.com/facebook/folly/issues/1984
+ use arm64 && append-cxxflags "-flax-vector-conversions"
+
+ cmake_src_configure
+}
+
+src_test() {
+ CMAKE_SKIP_TESTS=(
+ # Mysterious "invalid json" failure
+ io_async_ssl_session_test.SSLSessionTest
+ singleton_thread_local_test.SingletonThreadLocalDeathTest
+ # TODO: All SIGSEGV, report upstream!
+ 'concurrency_concurrent_hash_map_test.*'
+ )
+
+ if use arm64; then
+ CMAKE_SKIP_TESTS+=(
+ # Tests are flaky/timing dependent on both QEMU chroot and real hardware
+ io_async_hh_wheel_timer_test.HHWheelTimerTest
+ # Times out on real hardware
+ concurrent_skip_list_test.ConcurrentSkipList
+ futures_retrying_test.RetryingTest.largeRetries
+ )
+ fi
+
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ CMAKE_SKIP_TESTS+=(
+ # Aborts with libc++.
+ # https://github.com/facebook/folly/issues/2345
+ buffered_atomic_test.BufferedAtomic.singleThreadUnguardedAccess
+ )
+ fi
+
+ cmake_src_test
+}
diff --git a/dev-cpp/folly/folly-2025.04.14.00-r2.ebuild b/dev-cpp/folly/folly-2025.04.14.00-r2.ebuild
new file mode 100644
index 000000000000..02a5f79eee62
--- /dev/null
+++ b/dev-cpp/folly/folly-2025.04.14.00-r2.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2026 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# These must be bumped together:
+# dev-cpp/edencommon
+# dev-cpp/fb303
+# dev-cpp/fbthrift
+# dev-cpp/fizz
+# dev-cpp/folly
+# dev-cpp/mvfst
+# dev-cpp/wangle
+# dev-util/watchman
+
+inherit flag-o-matic cmake toolchain-funcs
+
+DESCRIPTION="An open-source C++ library developed and used at Facebook"
+HOMEPAGE="https://github.com/facebook/folly"
+SRC_URI="https://github.com/facebook/folly/releases/download/v${PV}/${PN}-v${PV}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/${PV}"
+KEYWORDS="amd64 ~arm64 ~ppc64"
+IUSE="io-uring llvm-libunwind test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ app-arch/bzip2
+ app-arch/lz4:=
+ app-arch/snappy:=
+ app-arch/xz-utils
+ app-arch/zstd:=
+ dev-cpp/fast_float:=
+ dev-cpp/gflags:=
+ dev-cpp/glog:=[gflags]
+ >=dev-libs/boost-1.71:=[context]
+ dev-libs/double-conversion:=
+ dev-libs/libaio
+ dev-libs/libevent:=
+ dev-libs/libfmt:=
+ dev-libs/libsodium:=
+ dev-libs/openssl:=
+ virtual/zlib:=
+ llvm-libunwind? ( llvm-runtimes/libunwind:= )
+ !llvm-libunwind? ( sys-libs/libunwind:= )
+ io-uring? ( >=sys-libs/liburing-2.10:= )
+"
+DEPEND="
+ ${RDEPEND}
+ sys-libs/binutils-libs
+ test? ( dev-cpp/gtest )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2024.11.04.00-musl-fix.patch
+ "${FILESDIR}"/${PN}-2025.04.14.00-boost-1.89.patch
+ "${FILESDIR}"/${PN}-2025.04.14.00-gcc16-workaround.patch
+)
+
+src_unpack() {
+ # Workaround for bug #889420
+ mkdir -p "${S}" || die
+ cd "${S}" || die
+ default
+}
+
+src_prepare() {
+ # Folly has no configuration option for disabling io_uring support
+ # so we need to patch it out.
+ if use !io-uring; then
+ eapply "${FILESDIR}"/${PN}-2025.04.14.00-force-liburing-off.patch
+ eapply "${FILESDIR}"/${PN}-2025.04.14.00-CMake-Avoid-finding-liburing.patch
+ fi
+
+ cmake_src_prepare
+}
+
+src_configure() {
+ # bug #949607
+ filter-lto
+
+ local mycmakeargs=(
+ -DCMAKE_INSTALL_DIR="$(get_libdir)/cmake/${PN}"
+ -DLIB_INSTALL_DIR="$(get_libdir)"
+
+ -DBUILD_TESTS=$(usex test)
+
+ # https://github.com/gentoo/gentoo/pull/29393
+ -DCMAKE_LIBRARY_ARCHITECTURE=$(usex amd64 x86_64 ${ARCH})
+ )
+
+ # https://github.com/facebook/folly/issues/1984
+ use arm64 && append-cxxflags "-flax-vector-conversions"
+
+ cmake_src_configure
+}
+
+src_test() {
+ CMAKE_SKIP_TESTS=(
+ # Mysterious "invalid json" failure
+ io_async_ssl_session_test.SSLSessionTest
+ singleton_thread_local_test.SingletonThreadLocalDeathTest
+ # TODO: All SIGSEGV, report upstream!
+ 'concurrency_concurrent_hash_map_test.*'
+ )
+
+ if use arm64; then
+ CMAKE_SKIP_TESTS+=(
+ # Tests are flaky/timing dependent on both QEMU chroot and real hardware
+ io_async_hh_wheel_timer_test.HHWheelTimerTest
+ # Times out on real hardware
+ concurrent_skip_list_test.ConcurrentSkipList
+ futures_retrying_test.RetryingTest.largeRetries
+ )
+ fi
+
+ if [[ $(tc-get-cxx-stdlib) == libc++ ]]; then
+ CMAKE_SKIP_TESTS+=(
+ # Aborts with libc++.
+ # https://github.com/facebook/folly/issues/2345
+ buffered_atomic_test.BufferedAtomic.singleThreadUnguardedAccess
+ )
+ fi
+
+ cmake_src_test
+}
diff --git a/dev-cpp/folly/metadata.xml b/dev-cpp/folly/metadata.xml
new file mode 100644
index 000000000000..bb1ccfe101c1
--- /dev/null
+++ b/dev-cpp/folly/metadata.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>sin-ack@protonmail.com</email>
+ <name>sin-ack</name>
+ </maintainer>
+ <maintainer type="project" proxied="proxy">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">facebook/folly</remote-id>
+ </upstream>
+</pkgmetadata>