diff options
author | Mike Frysinger <vapier@gentoo.org> | 2015-03-06 09:12:42 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2015-03-06 09:12:42 +0000 |
commit | aa1a5e97ef4a13990e690aa19f072e2a59a2680a (patch) | |
tree | b4f963ea72cecd885930d50deb9d28d59acf486c | |
parent | Version BUmp (diff) | |
download | gentoo-2-aa1a5e97ef4a13990e690aa19f072e2a59a2680a.tar.gz gentoo-2-aa1a5e97ef4a13990e690aa19f072e2a59a2680a.tar.bz2 gentoo-2-aa1a5e97ef4a13990e690aa19f072e2a59a2680a.zip |
Fix USE=-snappy handling #541186 by Johan Bergström. Move memenv.h header to leveldb/helpers/ to match Debian.
(Portage version: 2.2.17/cvs/Linux x86_64, signed Manifest commit with key D2E96200)
-rw-r--r-- | dev-libs/leveldb/ChangeLog | 9 | ||||
-rw-r--r-- | dev-libs/leveldb/files/leveldb-1.18-configure.patch | 52 | ||||
-rw-r--r-- | dev-libs/leveldb/leveldb-1.18-r1.ebuild | 67 |
3 files changed, 127 insertions, 1 deletions
diff --git a/dev-libs/leveldb/ChangeLog b/dev-libs/leveldb/ChangeLog index a0ef9bf01c7f..dc0dcbcccada 100644 --- a/dev-libs/leveldb/ChangeLog +++ b/dev-libs/leveldb/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-libs/leveldb # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/leveldb/ChangeLog,v 1.27 2015/02/21 18:34:07 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/leveldb/ChangeLog,v 1.28 2015/03/06 09:12:42 vapier Exp $ + +*leveldb-1.18-r1 (06 Mar 2015) + + 06 Mar 2015; Mike Frysinger <vapier@gentoo.org> + +files/leveldb-1.18-configure.patch, +leveldb-1.18-r1.ebuild: + Fix USE=-snappy handling #541186 by Johan Bergström. Move memenv.h header to + leveldb/helpers/ to match Debian. *leveldb-1.18 (21 Feb 2015) 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/leveldb-1.18-r1.ebuild b/dev-libs/leveldb/leveldb-1.18-r1.ebuild new file mode 100644 index 000000000000..6750bc377c0a --- /dev/null +++ b/dev-libs/leveldb/leveldb-1.18-r1.ebuild @@ -0,0 +1,67 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/leveldb/leveldb-1.18-r1.ebuild,v 1.1 2015/03/06 09:12:42 vapier Exp $ + +EAPI=5 + +inherit eutils multilib toolchain-funcs versionator + +DESCRIPTION="a fast key-value storage library written at Google" +HOMEPAGE="http://leveldb.org/ https://github.com/google/leveldb" +SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64 ~arm ~arm64 ~mips ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux" +IUSE="+snappy static-libs +tcmalloc" + +DEPEND="tcmalloc? ( dev-util/google-perftools ) + snappy? ( + app-arch/snappy + static-libs? ( app-arch/snappy[static-libs] ) + )" +RDEPEND="${DEPEND}" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-1.18-mips.patch + epatch "${FILESDIR}"/${PN}-1.18-configure.patch #541186 + + local SHARED_MINOR=$(get_version_component_range 2) + sed \ + -e "s/\(^ SHARED_MINOR =\).*/\1 ${SHARED_MINOR}/" \ + "${FILESDIR}/${PN}-1.9.0-memenv-so.patch" > memenv-so.patch + epatch memenv-so.patch +} + +src_configure() { + # These vars all get picked up by build_detect_platform + # which the Makefile runs for us automatically. + 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 ./ +} + +src_compile() { + emake $(usex static-libs 'libmemenv.a' 'LIBRARY=') all libmemenv.SHARED +} + +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 libleveldb*$(get_libname)* + use static-libs && dolib.a libleveldb.a libmemenv.a + dolib.so libmemenv*$(get_libname)* +} |