From 56eda53b353b897aa89056d5d4dc034ac8bcc9c1 Mon Sep 17 00:00:00 2001 From: Mathieu Tortuyaux Date: Wed, 14 May 2025 17:20:24 +0200 Subject: [PATCH] dev-libs/raft: new package It's from Gentoo commit 91137d52c4f6307b512c6f447236bc75e8f8b3ec. Signed-off-by: Mathieu Tortuyaux --- .../portage-stable/dev-libs/raft/Manifest | 1 + .../raft/files/raft-0.10.0-toggle-zfs.patch | 21 +++++++ .../portage-stable/dev-libs/raft/metadata.xml | 25 ++++++++ .../dev-libs/raft/raft-0.22.1.ebuild | 60 +++++++++++++++++++ 4 files changed, 107 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/raft/Manifest create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/raft/files/raft-0.10.0-toggle-zfs.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/raft/metadata.xml create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/raft/raft-0.22.1.ebuild diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/raft/Manifest b/sdk_container/src/third_party/portage-stable/dev-libs/raft/Manifest new file mode 100644 index 0000000000..c390ca568b --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/raft/Manifest @@ -0,0 +1 @@ +DIST raft-0.22.1.tar.gz 362393 BLAKE2B b6fc8f8e9dc6801ac8ad1b9d94f984b249b83def00a08776292500b079bb777330e8a83cf40153bfb1baae921105788d758c9f61a021d5519d5c27048b6be8b9 SHA512 fb4ea98321336daaa605e1c3cd55f672860fc8894d479fdff4e1862a4eb5622dbaf7a943e030dd2bcdaa14cc639e7e11ac43d71f00bdbd27f12c6b67653b70e4 diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/raft/files/raft-0.10.0-toggle-zfs.patch b/sdk_container/src/third_party/portage-stable/dev-libs/raft/files/raft-0.10.0-toggle-zfs.patch new file mode 100644 index 0000000000..f31b599b61 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/raft/files/raft-0.10.0-toggle-zfs.patch @@ -0,0 +1,21 @@ +diff -Naur a/configure.ac b/configure.ac +--- a/configure.ac 2021-03-16 14:45:58.000000000 +0200 ++++ b/configure.ac 2021-03-23 07:45:06.875557286 +0200 +@@ -47,13 +47,10 @@ + # Checks for header files. + AC_CHECK_HEADERS([stdlib.h string.h stdio.h assert.h unistd.h linux/io_uring.h linux/aio_abi.h]) + +-# Check if zfs >= 0.8.0 is available (for direct I/O support). +-AC_CHECK_PROG(have_zfs, zfs, yes) +-AS_IF([test x"$have_zfs" = x"yes"], +- [AX_COMPARE_VERSION($(cat /sys/module/zfs/version | cut -f 1 -d -), [ge], [0.8.0], +- [AC_DEFINE(RAFT_HAVE_ZFS_WITH_DIRECT_IO)], []) +- ], +- []) ++# zfs support. We have 0.8.6 as stable in Gentoo, which is plenty above the required minimum. ++AC_ARG_WITH([zfs], AS_HELP_STRING([--with-zfs], [Build with zfs support (default: disabled)])) ++AS_IF([test "x$with_zfs" = "xyes"], ++ [AC_DEFINE(RAFT_HAVE_ZFS_WITH_DIRECT_IO)], []) + + # Checks for typedefs, structures, and compiler characteristics. + AC_TYPE_SIZE_T diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/raft/metadata.xml b/sdk_container/src/third_party/portage-stable/dev-libs/raft/metadata.xml new file mode 100644 index 0000000000..94076382bb --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/raft/metadata.xml @@ -0,0 +1,25 @@ + + + + + juippis@gentoo.org + Joonas Niilola + + + virtualization@gentoo.org + Gentoo Virtualization Project + + + ZFS support + + + The library has modular design: its core part implements only the core + Raft algorithm logic, in a fully platform independent way. On top of that, + a pluggable interface defines the I/O implementation for networking + (send/receive RPC messages) and disk persistence (store log entries and + snapshots). + + + cowsql/raft + + diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/raft/raft-0.22.1.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/raft/raft-0.22.1.ebuild new file mode 100644 index 0000000000..39daa1268b --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/raft/raft-0.22.1.ebuild @@ -0,0 +1,60 @@ +# Copyright 2020-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit autotools + +DESCRIPTION="C implementation of the Raft consensus protocol" +HOMEPAGE="https://github.com/cowsql/raft" +SRC_URI="https://github.com/cowsql/raft/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="LGPL-3-with-linking-exception" + +# Upstream change from canonical to cowsql resetted SONAME, 3 -> 0. bgo#915960 +SLOT="0/0" +KEYWORDS="amd64 ~arm64 ~x86" +IUSE="lz4 test zfs" +RESTRICT="!test? ( test )" + +DEPEND="dev-libs/libuv:= + lz4? ( app-arch/lz4:= )" +RDEPEND="${DEPEND}" +BDEPEND="virtual/pkgconfig" + +PATCHES=( + "${FILESDIR}"/raft-0.10.0-toggle-zfs.patch +) + +src_prepare() { + default + eautoreconf +} + +src_configure() { + # --disable-hardening: most of these are covered on non-hardened Gentoo already. + local myeconfargs=( + --enable-uv + --enable-v0 + + --disable-backtrace + --disable-benchmark + --disable-debug + --disable-example + --disable-hardening + --disable-sanitize + --disable-static + + $(use_enable test fixture) + + $(use_with lz4) + $(use_with zfs) + ) + + econf "${myeconfargs[@]}" +} + +src_install() { + default + find "${ED}" -name '*.la' -delete || die +}