summaryrefslogtreecommitdiff
blob: 29224ff19f9f16b9e7c03c1752e6c1aa7b886c2b (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
# Copyright 2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

PYTHON_COMPAT=( python3_{8..10} )

inherit flag-o-matic distutils-r1

GTEST_VER="23b2a3b1cf803999fb38175f6e9e038a4495c8a5"

DESCRIPTION="Utilities for writing C++ extension modules"
HOMEPAGE="https://quantopian.github.io/libpy/
	https://github.com/quantopian/libpy"
SRC_URI="
	https://github.com/quantopian/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
	test? ( https://github.com/google/googletest/archive/${GTEST_VER}.tar.gz -> gtest-${GTEST_VER}.tar.gz )
"

LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="sparsehash test"

COMMON_DEPEND="
	>=dev-python/numpy-1.11.3[${PYTHON_USEDEP}]
"
RDEPEND="${COMMON_DEPEND}"
BDEPEND="${COMMON_DEPEND}
	sparsehash? ( dev-cpp/sparsehash )
	test? (
		dev-cpp/gtest
		>=dev-python/pytest-4.4.1[${PYTHON_USEDEP}]
	)
"

RESTRICT="!test? ( test )"
REQUIRED_USE="test? ( sparsehash )"

PATCHES=(
	"${FILESDIR}/libpy-0.2.5-no-werror.patch"
	"${FILESDIR}/libpy-0.2.5-permissions.patch"
	"${FILESDIR}/libpy-0.2.5-cflags.patch"
)

python_test() {
	emake GTEST_ROOT="${WORKDIR}/googletest-${GTEST_VER}" test
}

python_configure() {
	replace-flags '-O*' '-O3'
}