1 # Copyright 1999-2024 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 EGIT_REPO_URI="https://gitlab.freedesktop.org/mesa/drm.git"
7 PYTHON_COMPAT=( python3_{10..13} )
9 if [[ ${PV} = 9999* ]]; then
13 inherit ${GIT_ECLASS} python-any-r1 meson-multilib
15 DESCRIPTION="X.Org libdrm library"
16 HOMEPAGE="https://dri.freedesktop.org/ https://gitlab.freedesktop.org/mesa/drm"
17 if [[ ${PV} != 9999* ]]; then
18 SRC_URI="https://dri.freedesktop.org/libdrm/${P}.tar.xz"
19 KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux"
22 VIDEO_CARDS="amdgpu exynos freedreno intel nouveau omap radeon tegra vc4 vivante vmware"
23 for card in ${VIDEO_CARDS}; do
24 IUSE_VIDEO_CARDS+=" video_cards_${card}"
29 IUSE="${IUSE_VIDEO_CARDS} doc test tools udev valgrind"
30 RESTRICT="!test? ( test )"
33 video_cards_intel? ( >=x11-libs/libpciaccess-0.13.1-r1:=[${MULTILIB_USEDEP}] )"
34 DEPEND="${COMMON_DEPEND}
35 valgrind? ( dev-debug/valgrind )"
36 RDEPEND="${COMMON_DEPEND}
38 tools? ( >=dev-util/cunit-2.1 )
39 test? ( >=dev-util/cunit-2.1 )
41 udev? ( virtual/udev )"
42 BDEPEND="${PYTHON_DEPS}
43 doc? ( $(python_gen_any_dep 'dev-python/docutils[${PYTHON_USEDEP}]') )"
47 python_has_version "dev-python/docutils[${PYTHON_USEDEP}]"
52 sed -i -e "/^PLATFORM_SYMBOLS/a '__gentoo_check_ldflags__'," \
53 symbols-check.py || die # bug #925550
56 multilib_src_configure() {
59 -Dcairo-tests=disabled
60 $(meson_feature video_cards_amdgpu amdgpu)
61 $(meson_feature video_cards_exynos exynos)
62 $(meson_feature video_cards_freedreno freedreno)
63 $(meson_feature video_cards_intel intel)
64 $(meson_feature video_cards_nouveau nouveau)
65 $(meson_feature video_cards_omap omap)
66 $(meson_feature video_cards_radeon radeon)
67 $(meson_feature video_cards_tegra tegra)
68 $(meson_feature video_cards_vc4 vc4)
69 $(meson_feature video_cards_vivante etnaviv)
70 $(meson_feature video_cards_vmware vmwgfx)
71 # valgrind installs its .pc file to the pkgconfig for the primary arch
72 -Dvalgrind=$(usex valgrind auto disabled)
73 $(meson_native_use_bool tools install-test-programs)
74 $(meson_native_use_feature doc man-pages)
77 if use test || { multilib_is_native_abi && use tools; }; then
78 emesonargs+=( -Dtests=true )
80 emesonargs+=( -Dtests=false )