diff options
author | Arthur Zamarin <arthurzam@gentoo.org> | 2022-02-04 22:47:54 +0200 |
---|---|---|
committer | Arthur Zamarin <arthurzam@gentoo.org> | 2022-02-04 22:49:21 +0200 |
commit | 00fc32dea248405068c7bef23904ef8d3e10655d (patch) | |
tree | d6a0dcfd5f637db1b24d3b48496cb985103a6705 /dev-libs/leveldb | |
parent | app-arch/lzip: Bump to 1.23 (diff) | |
download | gentoo-00fc32dea248405068c7bef23904ef8d3e10655d.tar.gz gentoo-00fc32dea248405068c7bef23904ef8d3e10655d.tar.bz2 gentoo-00fc32dea248405068c7bef23904ef8d3e10655d.zip |
dev-libs/leveldb: Revert drop 1.20
Reverts: 5d0bd6ede5c8f6107be8c62ea98ec9aafe79c58a
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'dev-libs/leveldb')
-rw-r--r-- | dev-libs/leveldb/Manifest | 1 | ||||
-rw-r--r-- | dev-libs/leveldb/files/leveldb-1.18-configure.patch | 52 | ||||
-rw-r--r-- | dev-libs/leveldb/files/leveldb-1.20-memenv-so.patch | 33 | ||||
-rw-r--r-- | dev-libs/leveldb/leveldb-1.20.ebuild | 64 |
4 files changed, 150 insertions, 0 deletions
diff --git a/dev-libs/leveldb/Manifest b/dev-libs/leveldb/Manifest index 02ce0049311b..26c4a7fc073c 100644 --- a/dev-libs/leveldb/Manifest +++ b/dev-libs/leveldb/Manifest @@ -1 +1,2 @@ +DIST leveldb-1.20.tar.gz 223141 BLAKE2B 57ab5cb191679b8fbfaa28fa0a61ee1dcd757bb9c70215dd325daebfd93b30aa9bbe3c993a1758aa9804a7cd6f2c31df7cf98bdf98320cd1aebc14f5eb77d9a5 SHA512 c59258f2f58ce2d5680e9ab3da4ab0923d91cd4648dcf63cdaa26cdde92bf45e094544539ad11d8e09a4a4813435286143ed0e86c21c6c31a0596903ed4744d2 DIST leveldb-1.23.tar.gz 242925 BLAKE2B ef9ac853cdc2f376b9b4299c1017db8c262cb318ad771f40fe81c9fb71ea06ee56ac533b3e8af4e6fdd28577a2f87cfd103ecb49098187d099ccd6019b8ca1d2 SHA512 ac15eac29387b9f702a901b6567d47a9f8c17cf5c7d8700a77ec771da25158c83b04959c33f3d4de7a3f033ef08f545d14ba823a8d527e21889c4b78065b0f84 diff --git a/dev-libs/leveldb/files/leveldb-1.18-configure.patch b/dev-libs/leveldb/files/leveldb-1.18-configure.patch new file mode 100644 index 000000000000..ba30fc731ad5 --- /dev/null +++ b/dev-libs/leveldb/files/leveldb-1.18-configure.patch @@ -0,0 +1,52 @@ +we'll handle configure ourselves in src_configure + +--- a/Makefile ++++ b/Makefile +@@ -14,9 +14,6 @@ OPT ?= -O2 -DNDEBUG + # OPT ?= -O2 -g2 -DNDEBUG + #----------------------------------------------- + +-# detect what platform we're building on +-$(shell CC="$(CC)" CXX="$(CXX)" TARGET_OS="$(TARGET_OS)" \ +- ./build_detect_platform build_config.mk ./) + # this file is generated by the previous line to set build flags and sources + include build_config.mk + + +control snappy/tcmalloc explicitly + +--- a/build_detect_platform ++++ a/build_detect_platform +@@ -190,6 +190,7 @@ + COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX" + fi + ++if [ "${USE_SNAPPY:-auto}" = "auto" ]; then + # Test whether Snappy library is installed + # http://code.google.com/p/snappy/ + $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT 2>/dev/null <<EOF +@@ -197,15 +198,24 @@ + int main() {} + EOF + if [ "$?" = 0 ]; then ++ USE_SNAPPY="yes" ++ fi ++fi ++ if [ "$USE_SNAPPY" = "yes" ]; then + COMMON_FLAGS="$COMMON_FLAGS -DSNAPPY" + PLATFORM_LIBS="$PLATFORM_LIBS -lsnappy" + fi + ++if [ "${USE_TCMALLOC:-auto}" = "auto" ]; then + # Test whether tcmalloc is available + $CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF + int main() {} + EOF + if [ "$?" = 0 ]; then ++ USE_TCMALLOC="yes" ++ fi ++fi ++ if [ "$USE_TCMALLOC" = "yes" ]; then + PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc" + fi + diff --git a/dev-libs/leveldb/files/leveldb-1.20-memenv-so.patch b/dev-libs/leveldb/files/leveldb-1.20-memenv-so.patch new file mode 100644 index 000000000000..d443ef0ad262 --- /dev/null +++ b/dev-libs/leveldb/files/leveldb-1.20-memenv-so.patch @@ -0,0 +1,33 @@ +# Create libmemenv.so and don't compile programs by default +# Add a static_programs target to compile test programs +--- a/Makefile 2018-06-03 16:52:28.839614213 +0200 ++++ b/Makefile 2018-06-03 16:52:18.209544310 +0200 +@@ -128,15 +128,27 @@ + ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB1) + $(SHARED_OUTDIR)/$(SHARED_LIB2): $(SHARED_OUTDIR)/$(SHARED_LIB3) + ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB2) ++SHARED_MEMENV_LIB1 = libmemenv.$(PLATFORM_SHARED_EXT) ++SHARED_MEMENV_LIB2 = $(SHARED_MEMENV_LIB1).$(SHARED_VERSION_MAJOR) ++SHARED_MEMENV_LIB3 = $(SHARED_MEMENV_LIB1).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR) ++SHARED_MEMENV_LIBS = $(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB1) $(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB2) $(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB3) ++$(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB1): $(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB3) ++ ln -fs $(SHARED_MEMENV_LIB3) $(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB1) ++$(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB2): $(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB3) ++ ln -fs $(SHARED_MEMENV_LIB3) $(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB2) + SHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.a + endif + + $(SHARED_OUTDIR)/$(SHARED_LIB3): $(SHARED_LIBOBJECTS) + $(CXX) $(LDFLAGS) $(PLATFORM_SHARED_LDFLAGS)$(SHARED_LIB2) $(SHARED_LIBOBJECTS) -o $(SHARED_OUTDIR)/$(SHARED_LIB3) $(LIBS) ++$(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB3): $(SHARED_MEMENVOBJECTS) ++ $(CXX) $(LDFLAGS) $(PLATFORM_SHARED_LDFLAGS)$(SHARED_MEMENV_LIB2) $(SHARED_MEMENVOBJECTS) -o $(SHARED_OUTDIR)/$(SHARED_MEMENV_LIB3) $(LIBS) + + endif # PLATFORM_SHARED_EXT + +-all: $(SHARED_LIBS) $(SHARED_PROGRAMS) $(STATIC_OUTDIR)/libleveldb.a $(STATIC_OUTDIR)/libmemenv.a $(STATIC_PROGRAMS) ++all: $(SHARED_LIBS) $(SHARED_MEMENV_LIBS) ++ ++static_programs: $(STATIC_PROGRAMS) + + check: $(STATIC_PROGRAMS) + for t in $(notdir $(TESTS)); do echo "***** Running $$t"; $(STATIC_OUTDIR)/$$t || exit 1; done diff --git a/dev-libs/leveldb/leveldb-1.20.ebuild b/dev-libs/leveldb/leveldb-1.20.ebuild new file mode 100644 index 000000000000..6961f094c8cc --- /dev/null +++ b/dev-libs/leveldb/leveldb-1.20.ebuild @@ -0,0 +1,64 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit multilib toolchain-funcs + +DESCRIPTION="a fast key-value storage library written at Google" +HOMEPAGE="https://github.com/google/leveldb" +SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +# https://github.com/google/leveldb/issues/536 +SLOT="0/1" +KEYWORDS="amd64 arm arm64 ~mips ppc ppc64 ~riscv ~sparc x86 ~amd64-linux ~x86-linux" +IUSE="+snappy static-libs +tcmalloc test" +RESTRICT="!test? ( test )" + +DEPEND="tcmalloc? ( dev-util/google-perftools ) + snappy? ( + app-arch/snappy:= + )" +RDEPEND="${DEPEND}" + +# https://bugs.gentoo.org/651604 +REQUIRED_USE="snappy? ( !static-libs )" + +# https://github.com/google/leveldb/issues/234 +# https://github.com/google/leveldb/issues/236 +PATCHES=( "${FILESDIR}"/{${PN}-1.18-configure.patch,${P}-memenv-so.patch} ) + +src_configure() { + # These vars all get picked up by build_detect_platform + tc-export AR CC CXX + export OPT="-DNDEBUG ${CPPFLAGS}" + + TARGET_OS=Linux \ + USE_SNAPPY=$(usex snappy) \ + USE_TCMALLOC=no \ + TMPDIR=${T} \ + sh -x ./build_detect_platform build_config.mk ./ || die +} + +src_compile() { + default + usex static-libs && emake out-static/lib{leveldb,memenv}.a + use test && emake static_programs +} + +src_test() { + emake check +} + +src_install() { + insinto /usr/include + doins -r include/. + # This matches the path Debian picked. Upstream provides no guidance. + insinto /usr/include/leveldb/helpers + doins helpers/memenv/memenv.h + + dolib.so out-shared/libleveldb*$(get_libname)* + use static-libs && dolib.a out-static/lib{leveldb,memenv}.a + dolib.so out-shared/libmemenv*$(get_libname)* +} |