You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1.1 KiB
50 lines
1.1 KiB
# Copyright 1999-2022 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=7
|
|
|
|
inherit cmake
|
|
|
|
DESCRIPTION="A fast key-value storage library written at Google"
|
|
HOMEPAGE="https://github.com/google/leveldb"
|
|
SRC_URI="https://github.com/google/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
|
|
|
|
LICENSE="BSD"
|
|
SLOT="0/1"
|
|
KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux"
|
|
IUSE="+snappy +tcmalloc test"
|
|
RESTRICT="!test? ( test )"
|
|
|
|
DEPEND="
|
|
dev-libs/crc32c
|
|
snappy? ( app-arch/snappy:= )
|
|
tcmalloc? ( dev-util/google-perftools:= )
|
|
"
|
|
RDEPEND="${DEPEND}"
|
|
BDEPEND="test? ( dev-cpp/gtest )"
|
|
|
|
PATCHES=(
|
|
"${FILESDIR}"/${PN}-1.23-system-testdeps.patch
|
|
"${FILESDIR}"/${PN}-1.23-remove-benchmark-dep.patch
|
|
)
|
|
|
|
src_prepare() {
|
|
sed -e '/fno-rtti/d' -i CMakeLists.txt || die
|
|
cmake_src_prepare
|
|
}
|
|
|
|
src_configure() {
|
|
local mycmakeargs=(
|
|
-DHAVE_CRC32C=ON
|
|
-DLEVELDB_BUILD_BENCHMARKS=OFF
|
|
-DHAVE_SNAPPY=$(usex snappy)
|
|
-DHAVE_TCMALLOC=$(usex tcmalloc)
|
|
-DLEVELDB_BUILD_TESTS=$(usex test)
|
|
)
|
|
cmake_src_configure
|
|
}
|
|
|
|
src_test() {
|
|
TEST_TMPDIR="${T}" TEMP="${T}" cmake_src_test
|
|
}
|