summaryrefslogtreecommitdiff
blob: 107df7ef7cf74f55e891fc1565ad7ceb63f35119 (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
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit scons-utils eutils toolchain-funcs

DESCRIPTION="Binary-decimal and decimal-binary conversion routines for IEEE doubles"
HOMEPAGE="https://github.com/google/double-conversion"
SRC_URI="https://github.com/google/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="0/1"
KEYWORDS="amd64 ~arm ~arm64 hppa ~mips ppc ppc64 x86 ~amd64-linux ~x86-linux"
IUSE="static-libs"

LIBNAME=lib${PN}

src_prepare() {
	epatch "${FILESDIR}"/${P}-scons.patch
}

src_compile() {
	sed -i -e "s/g++/$(tc-getCXX)/" SConstruct || die
	escons ${LIBNAME}.so.1
	use static-libs && escons ${LIBNAME}.a
}

src_test() {
	escons run_tests
	export LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}"
	./run_tests --list | tr -d '<' | xargs ./run_tests || die
}

src_install() {
	dolib.so ${LIBNAME}.so*
	use static-libs && dolib.a ${LIBNAME}.a
	insinto /usr/include/double-conversion
	doins src/{double-conversion,utils}.h
	dodoc README Changelog AUTHORS
}