Denis Nikitin | 0d5d340 | 2020-02-24 13:13:15 -0800 | [diff] [blame] | 1 | # Copyright 1999-2018 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | |
| 4 | EAPI=6 |
| 5 | |
| 6 | PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6,3_7} ) |
| 7 | inherit python-r1 |
| 8 | |
| 9 | MY_P=cfe-${PV/_/}.src |
| 10 | DESCRIPTION="Python bindings for sys-devel/clang" |
| 11 | HOMEPAGE="https://llvm.org/" |
| 12 | SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P}.tar.xz" |
| 13 | |
| 14 | LICENSE="UoI-NCSA" |
| 15 | SLOT="0" |
| 16 | KEYWORDS="*" |
| 17 | IUSE="test" |
| 18 | RESTRICT="!test? ( test )" |
| 19 | REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
| 20 | |
| 21 | # The module is opening libclang.so directly, and doing some blasphemy |
| 22 | # on top of it. |
| 23 | RDEPEND=" |
Denis Nikitin | c98f5ce | 2020-02-24 13:20:09 -0800 | [diff] [blame^] | 24 | >=sys-devel/llvm-${PV}:* |
Denis Nikitin | 0d5d340 | 2020-02-24 13:13:15 -0800 | [diff] [blame] | 25 | !sys-devel/llvm:0[clang(-),python(-)] |
| 26 | !sys-devel/clang:0[python(-)] |
| 27 | ${PYTHON_DEPS}" |
| 28 | DEPEND="${RDEPEND}" |
| 29 | |
| 30 | S=${WORKDIR}/${MY_P}/bindings/python |
| 31 | |
| 32 | PATCHES=( |
| 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 | |
| 38 | src_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 | |
| 43 | python_test() { |
| 44 | "${EPYTHON}" -m unittest discover -v || die "Tests fail with ${EPYTHON}" |
| 45 | } |
| 46 | |
| 47 | src_test() { |
| 48 | python_foreach_impl python_test |
| 49 | } |
| 50 | |
| 51 | src_install() { |
| 52 | python_foreach_impl python_domodule clang |
| 53 | } |