summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-libs/raft/Manifest1
-rw-r--r--dev-libs/raft/files/raft-0.10.0-toggle-zfs.patch21
-rw-r--r--dev-libs/raft/metadata.xml3
-rw-r--r--dev-libs/raft/raft-0.10.0.ebuild52
4 files changed, 77 insertions, 0 deletions
diff --git a/dev-libs/raft/Manifest b/dev-libs/raft/Manifest
index 244ae96fe1fb..efa508bf3f0e 100644
--- a/dev-libs/raft/Manifest
+++ b/dev-libs/raft/Manifest
@@ -1 +1,2 @@
+DIST raft-0.10.0.tar.gz 315569 BLAKE2B 2365ee2ef4aca44257cf7631875013a6778d8858427946443ec02411783517f3ef129529c3302eceedbd43d9a57de9a3fc20a762b51ce8c7ed96045d4c8d27b0 SHA512 5039e2305c92f5002de4ef33f3c0b76dac1e72b8d983440ae0f5cb65d99213278e23a80401476617f32857c1913ab30bf257265d92f6bb5992d2701d4c25f977
DIST raft-0.9.25.tar.gz 313444 BLAKE2B a2a15287cef28b03b012ea372d83e7d0b70bc561f5996eb36fb5ef898261188ee8dfef1aa1619333ada2c8f20a37aa1af3f68a1d97c11919d521544c89629e55 SHA512 8709a909c527b7062072165356dcc012cf7af6cf85e3a3be515220ea4a863637dd06e7c4376af4284006bce65034002d1639ca52ac1ce108be2efa0725a82b70
diff --git a/dev-libs/raft/files/raft-0.10.0-toggle-zfs.patch b/dev-libs/raft/files/raft-0.10.0-toggle-zfs.patch
new file mode 100644
index 000000000000..f31b599b6101
--- /dev/null
+++ b/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/dev-libs/raft/metadata.xml b/dev-libs/raft/metadata.xml
index c96395f90242..d1012a6417a7 100644
--- a/dev-libs/raft/metadata.xml
+++ b/dev-libs/raft/metadata.xml
@@ -9,6 +9,9 @@
<email>virtualization@gentoo.org</email>
<name>Gentoo Virtualization Project</name>
</maintainer>
+ <use>
+ <flag name="zfs">ZFS support</flag>
+ </use>
<longdescription>
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,
diff --git a/dev-libs/raft/raft-0.10.0.ebuild b/dev-libs/raft/raft-0.10.0.ebuild
new file mode 100644
index 000000000000..ffd134995c1b
--- /dev/null
+++ b/dev-libs/raft/raft-0.10.0.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2020-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit autotools
+
+DESCRIPTION="C implementation of the Raft consensus protocol"
+HOMEPAGE="https://github.com/canonical/raft"
+SRC_URI="https://github.com/canonical/raft/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-3-with-linking-exception"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+IUSE="test zfs"
+RESTRICT="!test? ( test )"
+
+DEPEND="dev-libs/libuv"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/raft-0.9.25-Always-skip-init-oom-test.patch
+ "${FILESDIR}"/raft-0.10.0-toggle-zfs.patch
+ )
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ local myeconfargs=(
+ --enable-uv
+
+ --disable-benchmark
+ --disable-debug
+ --disable-example
+ --disable-sanitize
+ --disable-static
+
+ $(use_enable test fixture)
+
+ $(use_with zfs)
+ )
+
+ econf "${myeconfargs[@]}"
+}
+
+src_install() {
+ default
+ find "${ED}" -name '*.la' -delete || die
+}