summaryrefslogtreecommitdiff
blob: ebe13740b79fbccb3285646b5cfe8636c49fb5bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $

EAPI=5

EGIT_REPO_URI="https://github.com/aerospike/aerospike-client-c.git"

inherit autotools git-2

DESCRIPTION="Aerospike C Client"
HOMEPAGE="https://github.com/aerospike/aerospike-client-c"
SRC_URI=""

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64"
IUSE="luajit +static-libs"

S="${WORKDIR}/aerospike-client-c-${PV}"

# tests fails to build ?
RESTRICT="test"

RDEPEND=">=dev-lang/lua-5.1.5:*
	>=dev-libs/openssl-1.0.1g:=
	dev-vcs/git
	luajit? ( >=dev-lang/luajit-2.0.3:* )"
DEPEND="${RDEPEND}"

src_prepare() {
	#TODO: still using bundled libs, that sucks
	#sed -e 's/^USE_LUAMOD = 1/USE_LUAMOD = 0/g' -i Makefile

	# luajit USE
	use luajit && sed -e 's/^USE_LUAJIT = 0/USE_LUAJIT = 1/g' -i Makefile

	git submodule update --init

	# main, applies to all modules
	sed -e "s/CC = cc/CC = $(tc-getCC)/g" \
		-e "s/LD = cc/CC = $(tc-getCC)/g" \
		-i project/settings.mk || die

	# include dir
	sed -e 's@/usr/local@/usr@g' -i Makefile -i modules/mod-lua/Makefile -i modules/luajit/src/Makefile -i modules/ck/Makefile.in -i modules/luajit/Makefile || die
}

src_compile() {
	# forced MAKEOPTS, see:
	# https://github.com/aerospike/aerospike-client-c/issues/22
	CC=$(tc-getCC) LD=$(tc-getCC) MAKEOPTS="-j1" PREFIX=/usr emake all
}

src_install() {
	dolib target/Linux-x86_64/lib/libaerospike.so
	use static-libs && dolib.a target/Linux-x86_64/lib/libaerospike.a

	insinto /usr/include/
	doins -r target/Linux-x86_64/include/{aerospike,citrusleaf,ck}

	insinto /opt/aerospike/client/sys/udf/lua/
	doins modules/lua-core/src/{aerospike,as,stream_ops}.lua
}