sci-mathematics/rstudio: Thanks to tomboy-64 for fixing bug Bug 534152 - sci-mathemat...
[gentoo.git] / dev-libs / leveldb / leveldb-1.10.0-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=4
6
7 inherit eutils multilib toolchain-funcs
8
9 DESCRIPTION="a fast key-value storage library written at Google"
10 HOMEPAGE="https://github.com/google/leveldb"
11 SRC_URI="https://${PN}.googlecode.com/files/${P}.tar.gz"
12
13 LICENSE="BSD"
14 SLOT="0"
15 KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86 ~amd64-linux ~x86-linux"
16 IUSE="+snappy static-libs +tcmalloc"
17
18 DEPEND="tcmalloc? ( dev-util/google-perftools )
19         snappy? (
20                 app-arch/snappy
21                 static-libs? ( app-arch/snappy[static-libs] )
22         )"
23 RDEPEND="${DEPEND}"
24
25 src_prepare() {
26         epatch "${FILESDIR}"/${PN}-1.9.0-forwardcompat.patch
27 }
28
29 src_configure() {
30         # These vars all get picked up by build_detect_platform
31         # which the Makefile runs for us automatically.
32         tc-export AR CC CXX
33         export OPT="-DNDEBUG ${CPPFLAGS}"
34         # Probably needs more filling out
35         export TARGET_OS
36         case ${CHOST} in
37         *) TARGET_OS="Linux";;
38         esac
39         export USE_SNAPPY=$(usex snappy)
40         export USE_TCMALLOC=no
41 }
42
43 src_compile() {
44         emake $(usex static-libs '' 'LIBRARY=') all libmemenv.a
45 }
46
47 src_test() {
48         emake check
49 }
50
51 src_install() {
52         insinto /usr/include
53         doins -r include/* helpers/memenv/memenv.h
54         dolib.so libleveldb*$(get_libname)*
55         use static-libs && dolib.a libleveldb.a
56         dolib.a libmemenv.a
57 }