Diff leveldb-1.20 with a leveldb-1.23-r5

/usr/portage/dev-libs/leveldb/leveldb-1.23-r5.ebuild 2023-10-09 14:52:29.508368351 +0300
1
# Copyright 1999-2022 Gentoo Authors
1
# Copyright 1999-2023 Gentoo Authors
2 2
# Distributed under the terms of the GNU General Public License v2
3 3

  
4
EAPI=7
4
EAPI=8
5 5

  
6
inherit multilib toolchain-funcs
6
inherit cmake
7 7

  
8
DESCRIPTION="a fast key-value storage library written at Google"
8
DESCRIPTION="A fast key-value storage library written at Google"
9 9
HOMEPAGE="https://github.com/google/leveldb"
10
SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
10
SRC_URI="https://github.com/google/${PN}/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
11 11

  
12 12
LICENSE="BSD"
13
# https://github.com/google/leveldb/issues/536
14 13
SLOT="0/1"
15
KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux"
16
IUSE="+snappy static-libs +tcmalloc test"
14
KEYWORDS="amd64 arm arm64 ~loong ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux"
15
IUSE="+snappy +tcmalloc test"
17 16
RESTRICT="!test? ( test )"
18 17

  
19
DEPEND="tcmalloc? ( dev-util/google-perftools )
20
	snappy? (
21
		app-arch/snappy:=
22
	)"
18
DEPEND="
19
	dev-libs/crc32c
20
	snappy? ( app-arch/snappy:= )
21
	tcmalloc? ( dev-util/google-perftools:=[-minimal] )
22
"
23 23
RDEPEND="${DEPEND}"
24
BDEPEND="test? ( dev-cpp/gtest )"
24 25

  
25
# https://bugs.gentoo.org/651604
26
REQUIRED_USE="snappy? ( !static-libs )"
27

  
28
# https://github.com/google/leveldb/issues/234
29
# https://github.com/google/leveldb/issues/236
30
PATCHES=( "${FILESDIR}"/{${PN}-1.18-configure.patch,${P}-memenv-so.patch} )
31

  
32
src_configure() {
33
	# These vars all get picked up by build_detect_platform
34
	tc-export AR CC CXX
35
	export OPT="-DNDEBUG ${CPPFLAGS}"
36

  
37
	TARGET_OS=Linux \
38
	USE_SNAPPY=$(usex snappy) \
39
	USE_TCMALLOC=no \
40
	TMPDIR=${T} \
41
	sh -x ./build_detect_platform build_config.mk ./ || die
26
PATCHES=(
27
	"${FILESDIR}"/${PN}-1.23-system-testdeps.patch
28
	"${FILESDIR}"/${PN}-1.23-remove-benchmark-dep.patch
29
)
30

  
31
src_prepare() {
32
	sed -e '/fno-rtti/d' -i CMakeLists.txt || die
33
	cmake_src_prepare
42 34
}
43 35

  
44
src_compile() {
45
	default
46
	usex static-libs && emake out-static/lib{leveldb,memenv}.a
47
	use test && emake static_programs
36
src_configure() {
37
	local mycmakeargs=(
38
		-DCMAKE_CXX_STANDARD=14 # C++14 or later required for >=gtest-1.13.0
39
		-DHAVE_CRC32C=ON
40
		-DLEVELDB_BUILD_BENCHMARKS=OFF
41
		-DHAVE_SNAPPY=$(usex snappy)
42
		-DHAVE_TCMALLOC=$(usex tcmalloc)
43
		-DLEVELDB_BUILD_TESTS=$(usex test)
44
	)
45
	cmake_src_configure
48 46
}
49 47

  
50 48
src_test() {
51
	emake check
52
}
53

  
54
src_install() {
55
	insinto /usr/include
56
	doins -r include/.
57
	# This matches the path Debian picked. Upstream provides no guidance.
58
	insinto /usr/include/leveldb/helpers
59
	doins helpers/memenv/memenv.h
60

  
61
	dolib.so out-shared/libleveldb*$(get_libname)*
62
	use static-libs && dolib.a out-static/lib{leveldb,memenv}.a
63
	dolib.so out-shared/libmemenv*$(get_libname)*
49
	TEST_TMPDIR="${T}" TEMP="${T}" cmake_src_test
64 50
}
Thank you!