summaryrefslogtreecommitdiff
blob: 0ff6a725e1161feb5949cd0b012ecb114b86bd92 (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
# Copyright 1999-2018 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=6

USE_RUBY="ruby22 ruby23 ruby24 ruby25"

MY_P="hiredis-rb-${PV}"

RUBY_FAKEGEM_RECIPE_DOC="rdoc"
RUBY_FAKEGEM_EXTRADOC="CHANGELOG.md README.md"

inherit ruby-fakegem

DESCRIPTION="Wrapper for hiredis (protocol serialization/deserialization and blocking I/O)"
HOMEPAGE="https://github.com/redis/hiredis-rb"
SRC_URI="https://github.com/redis/hiredis-rb/archive/v${PV}.tar.gz -> ${MY_P}.tar.gz"

LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE=""

RDEPEND+=" =dev-libs/hiredis-0.13*:="
DEPEND+=" dev-libs/hiredis test? ( dev-ruby/test-unit:2 )"

RUBY_S="${MY_P}"

PATCHES=( "${FILESDIR}/${P}-unvendor-hiredis.patch" )

all_ruby_prepare() {
	sed -i -e 's:/tmp/:'${T}'/:' test/connection_test.rb || die
}

each_ruby_configure() {
	CC=$(tc-getCC) ${RUBY} -Cext/hiredis_ext extconf.rb || die
}

each_ruby_compile() {
	emake V=1 -Cext/hiredis_ext
	cp ext/hiredis_ext/hiredis_ext.so lib/hiredis/ext/ || die
}

each_ruby_test() {
	${RUBY} -Ilib:. -e 'Dir["test/*_test.rb"].each{|f| require f}' || die
}