summaryrefslogtreecommitdiff
blob: c5a5cce5e1d8d576cb24f241fcfda57d2a1509ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Copyright 2020-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

DESCRIPTION="Embeddable, persistent key-value store for fast storage"
HOMEPAGE="http://rocksdb.org https://github.com/facebook/rocksdb/"
SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~arm64 ~ppc64 ~riscv ~x86"
IUSE="jemalloc numa static-libs tbb test"

RESTRICT="!test? ( test )"

DEPEND="
	app-arch/bzip2:=
	app-arch/lz4:=
	app-arch/snappy:=
	app-arch/zstd:=
	dev-cpp/gflags:=
	sys-libs/liburing:=
	sys-libs/zlib:=
	sys-process/numactl
	jemalloc? ( dev-libs/jemalloc:= )
	tbb? ( dev-cpp/tbb:= )
"
RDEPEND="${DEPEND}"

src_prepare() {
	sed -i -e 's/liburing.a/uring/' cmake/modules/Finduring.cmake || die
	sed -i -e '/find_program(CCACHE_FOUND ccache)/d' CMakeLists.txt || die
	cmake_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DFAIL_ON_WARNINGS=OFF
		-DPORTABLE=1
		-DROCKSDB_BUILD_SHARED=$(usex static-libs OFF ON)
		-DWITH_ALL_TESTS=$(usex test)
		-DWITH_ASAN=OFF
		-DWITH_BENCHMARK=OFF
		-DWITH_BENCHMARK_TOOLS=OFF
		-DWITH_BZ2=ON
		-DWITH_CORE_TOOLS=ON
		-DWITH_DYNAMIC_EXTENSION=ON
		-DWITH_EXAMPLES=OFF
		-DWITH_FALLOCATE=ON
		-DWITH_GFLAGS=ON
		-DWITH_IOSTATS_CONTEXT=ON
		-DWITH_JEMALLOC=$(usex jemalloc ON OFF)
		-DWITH_JNI=OFF
		-DWITH_LIBURING=ON
		-DWITH_LZ4=ON
		-DWITH_MD_LIBRARY=ON
		-DWITH_NUMA=$(usex numa)
		-DWITH_SNAPPY=ON
		-DWITH_TBB=$(usex tbb)
		-DWITH_TOOLS=ON
		-DWITH_TRACE_TOOLS=ON
		-DWITH_TSAN=OFF
		-DWITH_ZLIB=ON
		-DWITH_ZSTD=ON
	)
	# -DWITH_TESTS option works only with debug build, needs to be set here
	# to not be overriden by cmake.eclass
	CMAKE_BUILD_TYPE=$(usex test Debug RelWithDebInfo) cmake_src_configure
}

src_install() {
	cmake_src_install

	if ! use static-libs; then
		rm "${ED}"/usr/$(get_libdir)/*.a || die
	fi
}