*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-util / include-what-you-use / include-what-you-use-8.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 PYTHON_COMPAT=( python2_7 python3_6 )
7
8 inherit cmake-utils flag-o-matic llvm python-single-r1
9
10 DESCRIPTION="Find unused include directives in C/C++ programs"
11 HOMEPAGE="https://include-what-you-use.org/"
12 SRC_URI="https://github.com/${PN}/${PN}/archive/clang_${PV}.tar.gz -> ${P}.src.tar.gz"
13
14 LICENSE="GPL-2"
15 SLOT="0"
16 KEYWORDS="~amd64 ~x86"
17
18 LLVM_MAX_SLOT=8
19
20 RDEPEND="sys-devel/llvm:${LLVM_MAX_SLOT}
21         sys-devel/clang:${LLVM_MAX_SLOT}
22         ${PYTHON_DEPS}
23 "
24 DEPEND="${RDEPEND}"
25
26 REQUIRED_USE=${PYTHON_REQUIRED_USE}
27
28 S=${WORKDIR}/${PN}-clang_${PV}
29
30 pkg_setup() {
31         llvm_pkg_setup
32         python-single-r1_pkg_setup
33 }
34
35 src_prepare() {
36         cmake-utils_src_prepare
37         python_fix_shebang .
38 }
39
40 src_configure() {
41         local mycmakeargs=(
42                 # Note [llvm install path]
43                 # Unfortunately all binaries using clang driver
44                 # have to reside at the same path depth as
45                 # 'clang' binary itself. See bug #625972
46                 # Thus as a hack we install it to the same directory
47                 # as llvm/clang itself.
48                 -DCMAKE_INSTALL_PREFIX="$(get_llvm_prefix "${LLVM_MAX_SLOT}")"
49         )
50         cmake-utils_src_configure
51 }
52
53 src_test() {
54         "${EPYTHON}" run_iwyu_tests.py
55 }