media-libs/libglvnd: Fix a couple of mistakes
[gentoo.git] / media-libs / libglvnd / libglvnd-1.3.0.ebuild
1 # Copyright 2018-2019 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=7
5
6 EGIT_REPO_URI="https://gitlab.freedesktop.org/glvnd/libglvnd.git"
7
8 if [[ ${PV} = 9999* ]]; then
9         GIT_ECLASS="git-r3"
10 fi
11
12 PYTHON_COMPAT=( python3_{5,6,7,8} )
13 VIRTUALX_REQUIRED=manual
14
15 inherit ${GIT_ECLASS} meson multilib-minimal python-any-r1 virtualx
16
17 DESCRIPTION="The GL Vendor-Neutral Dispatch library"
18 HOMEPAGE="https://gitlab.freedesktop.org/glvnd/libglvnd"
19 if [[ ${PV} = 9999* ]]; then
20         SRC_URI=""
21 else
22         KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
23         SRC_URI="https://gitlab.freedesktop.org/glvnd/${PN}/-/archive/v${PV}/${PN}-v${PV}.tar.bz2 -> ${P}.tar.bz2"
24         S=${WORKDIR}/${PN}-v${PV}
25 fi
26
27 LICENSE="MIT"
28 SLOT="0"
29 IUSE="test X"
30 RESTRICT="!test? ( test )"
31
32 BDEPEND="${PYTHON_DEPS}
33         test? ( X? ( ${VIRTUALX_DEPEND} ) )"
34 RDEPEND="
35         !media-libs/mesa[-libglvnd(-)]
36         !<media-libs/mesa-19.2.2
37         X? (
38                 x11-libs/libX11[${MULTILIB_USEDEP}]
39                 x11-libs/libXext[${MULTILIB_USEDEP}]
40         )"
41 DEPEND="${RDEPEND}
42         X? ( x11-base/xorg-proto )"
43
44 PATCHES=(
45         "${FILESDIR}"/${P}-meson-Fix-the-armv7-build.patch
46         "${FILESDIR}"/${P}-meson-Fix-the-PPC64-build.patch
47 )
48
49 multilib_src_configure() {
50         local emesonargs=(
51                 $(meson_feature X x11)
52                 $(meson_feature X glx)
53         )
54         meson_src_configure
55 }
56
57 multilib_src_compile() {
58         meson_src_compile
59 }
60
61 multilib_src_test() {
62         if use X; then
63                 virtx meson_src_test
64         else
65                 meson_src_test
66         fi
67 }
68
69 multilib_src_install() {
70         meson_src_install
71 }