*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / sys-cluster / rdma-core / rdma-core-9999.ebuild
1 # Copyright 2019-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 PYTHON_COMPAT=( python3_{6,7} )
7
8 inherit cmake-utils python-single-r1 udev systemd
9
10 DESCRIPTION="Userspace components for the Linux Kernel's drivers/infiniband subsystem"
11 HOMEPAGE="https://github.com/linux-rdma/rdma-core"
12
13 if [[ ${PV} == "9999" ]]; then
14         inherit git-r3
15         EGIT_REPO_URI="https://github.com/linux-rdma/rdma-core"
16 else
17         SRC_URI="https://github.com/linux-rdma/rdma-core/releases/download/v${PV}/${P}.tar.gz"
18         KEYWORDS="~amd64 ~x86"
19 fi
20
21 LICENSE="|| ( GPL-2 ( CC0-1.0 MIT BSD BSD-with-attribution ) )"
22 SLOT="0"
23 IUSE="neigh python static-libs systemd valgrind"
24 REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
25
26 COMMON_DEPEND="
27         virtual/libudev:=
28         neigh? ( dev-libs/libnl:3 )
29         systemd? ( sys-apps/systemd:= )
30         valgrind? ( dev-util/valgrind )
31         python? ( ${PYTHON_DEPS} )"
32
33 DEPEND="${COMMON_DEPEND}
34         python? ( dev-python/cython[${PYTHON_USEDEP}] )"
35
36 RDEPEND="${COMMON_DEPEND}
37         !!sys-fabric/infiniband-diags
38         !sys-fabric/libibverbs
39         !sys-fabric/librdmacm
40         !sys-fabric/libibumad
41         !sys-fabric/ibacm
42         !sys-fabric/libibmad
43         !sys-fabric/srptools
44         !sys-fabric/infinipath-psm
45         !sys-fabric/libcxgb3
46         !sys-fabric/libcxgb4
47         !sys-fabric/libmthca
48         !sys-fabric/libmlx4
49         !sys-fabric/libmlx5
50         !sys-fabric/libocrdma
51         !sys-fabric/libnes"
52
53 BDEPEND="virtual/pkgconfig"
54
55 pkg_setup() {
56         python-single-r1_pkg_setup
57
58 }
59
60 src_configure() {
61         local mycmakeargs=(
62                 -DCMAKE_INSTALL_SYSCONFDIR=/etc
63                 -DCMAKE_INSTALL_FULL_RUNDIR=/run
64                 -DCMAKE_INSTALL_SHAREDSTATEDIR=/var/lib
65                 -DCMAKE_INSTALL_UDEV_RULESDIR="$(get_udevdir)"/rules.d
66                 -DCMAKE_INSTALL_SYSTEMD_SERVICEDIR="$(systemd_get_systemunitdir)"
67                 -DCMAKE_DISABLE_FIND_PACKAGE_pandoc=yes
68                 $(ver_test -ge 25 && echo -DCMAKE_DISABLE_FIND_PACKAGE_rst2man=yes)
69                 -DCMAKE_DISABLE_FIND_PACKAGE_Systemd="$(usex systemd no yes)"
70                 -DENABLE_VALGRIND="$(usex valgrind)"
71                 -DENABLE_RESOLVE_NEIGH="$(usex neigh)"
72                 -DENABLE_STATIC="$(usex static-libs)"
73         )
74
75         if use python; then
76                 mycmakeargs+=( -DNO_PYVERBS=OFF )
77         else
78                 mycmakeargs+=( -DNO_PYVERBS=ON )
79         fi
80
81         cmake-utils_src_configure
82 }
83
84 src_install() {
85         cmake-utils_src_install
86
87         udev_dorules "${D}"/etc/udev/rules.d/70-persistent-ipoib.rules
88         rm -r "${D}"/etc/{udev,init.d} || die
89
90         newinitd "${FILESDIR}"/ibacm.init ibacm
91         newinitd "${FILESDIR}"/iwpmd.init iwpmd
92         newinitd "${FILESDIR}"/srpd.init srpd
93 }