blob: a8aa7ed63ec70221ee12040c056c3319cf8fc4bf [file] [log] [blame]
Denis Nikitin0d5d3402020-02-24 13:13:15 -08001# Copyright 1999-2018 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2
3
4EAPI=6
5
6PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6,3_7} )
7inherit python-r1
8
9MY_P=cfe-${PV/_/}.src
10DESCRIPTION="Python bindings for sys-devel/clang"
11HOMEPAGE="https://llvm.org/"
12SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz"
13
14LICENSE="UoI-NCSA"
15SLOT="0"
16KEYWORDS="*"
17IUSE="test"
18RESTRICT="!test? ( test )"
19REQUIRED_USE="${PYTHON_REQUIRED_USE}"
20
21# The module is opening libclang.so directly, and doing some blasphemy
22# on top of it.
23RDEPEND="
24 >=sys-devel/clang-${PV}:*
25 !sys-devel/llvm:0[clang(-),python(-)]
26 !sys-devel/clang:0[python(-)]
27 ${PYTHON_DEPS}"
28DEPEND="${RDEPEND}"
29
30S=${WORKDIR}/${MY_P}/bindings/python
31
32PATCHES=(
33 # update completion test results due to completion changes
34 # https://reviews.llvm.org/D50171
35 "${FILESDIR}"/7.0.0/0001-python-tests-Update-test_code_completion.patch
36)
37
38src_unpack() {
39 einfo "Unpacking parts of ${MY_P}.tar.xz ..."
40 tar -xJf "${DISTDIR}/${MY_P}.tar.xz" "${MY_P}/bindings/python" || die
41}
42
43python_test() {
44 "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}"
45}
46
47src_test() {
48 python_foreach_impl python_test
49}
50
51src_install() {
52 python_foreach_impl python_domodule clang
53}