From a0eac9d9bcc92c20ea94c29b106629a457b0ae7a Mon Sep 17 00:00:00 2001
From: Emmanuel Vadot <manu@FreeBSD.Org>
Date: Tue, 21 Jan 2020 19:59:29 +0100
Subject: [PATCH 4/4] graphics/libdrm: Only install vmware and virtgpu driver
 on i386/amd64
Content-Type: text/plain; charset=UTF-8

Signed-off-by: Emmanuel Vadot <manu@FreeBSD.Org>
---
 graphics/libdrm/Makefile  | 4 +++-
 graphics/libdrm/pkg-plist | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/graphics/libdrm/Makefile b/graphics/libdrm/Makefile
index 2633329b4536..6cd08bd03578 100644
--- a/graphics/libdrm/Makefile
+++ b/graphics/libdrm/Makefile
@@ -1,76 +1,78 @@
 # Created by: lesi@FreeBSD.org
 # $FreeBSD$
 
 PORTNAME=	libdrm
 PORTVERSION=	2.4.99
 PORTEPOCH=	1
-PORTREVISION=	3
+PORTREVISION=	4
 CATEGORIES=	graphics x11
 MASTER_SITES=	https://dri.freedesktop.org/libdrm/
 
 MAINTAINER=	x11@FreeBSD.org
 COMMENT=	Userspace interface to kernel Direct Rendering Module services
 
 LICENSE=	MIT
 
 BUILD_DEPENDS=	${LOCALBASE}/libdata/pkgconfig/pthread-stubs.pc:devel/libpthread-stubs
 LIB_DEPENDS=	libpciaccess.so:devel/libpciaccess
 
 USES=		gnome meson pkgconfig tar:bzip2
 USE_LDCONFIG=	yes
 
 OPTIONS_DEFINE=	MANPAGES TESTS LEGACY
 OPTIONS_SUB=	yes
 
 TESTS_DESC=	Install test programs (which are always built)
 LEGACY_DESC=	Install legacy drivers headers
 
 .if defined(PACKAGE_BUILDING)
 OPTIONS_DEFAULT+=	MANPAGES
 .endif
 
 MANPAGES_BUILD_DEPENDS=	${LOCALBASE}/share/xsl/docbook/manpages/docbook.xsl:textproc/docbook-xsl
 MANPAGES_USE=		GNOME=libxslt:build
 MANPAGES_MESON_TRUE=	man-pages
 
 TESTS_MESON_TRUE=	install-test-programs
 
 # avoid circular dependency in case cairo supports OpenGL (cairo->mesa-libs->libdrm->cairo)
 CONFIGURE_ARGS+=	-Dcairo-tests=false
 
 .include <bsd.port.options.mk>
 
 .if ${ARCH} == amd64 || ${ARCH} == i386
 PLIST_SUB+=	ARM_DRIVERS="@comment "
 PLIST_SUB+=	INTEL_DRIVER=""
 PLIST_SUB+=	NOUVEAU_DRIVER=""
 PLIST_SUB+=	RADEON_DRIVERS=""
+PLIST_SUB+=	VIRTGPU_DRIVER=""
+PLIST_SUB+=	VMWGFX_DRIVER=""
 .elif ${ARCH:Mpowerpc*}
 PLIST_SUB+=	ARM_DRIVERS="@comment "
 PLIST_SUB+=	INTEL_DRIVER="@comment "
 PLIST_SUB+=	NOUVEAU_DRIVER=""
 PLIST_SUB+=	RADEON_DRIVERS=""
 .elif ${ARCH} == aarch64
 PLIST_SUB+=	ARM_DRIVERS=""
 PLIST_SUB+=	INTEL_DRIVER="@comment "
 PLIST_SUB+=	NOUVEAU_DRIVER=""
 PLIST_SUB+=	RADEON_DRIVERS=""
 .elif ${ARCH:Marm*}
 PLIST_SUB+=	ARM_DRIVERS=""
 PLIST_SUB+=	INTEL_DRIVER="@comment "
 PLIST_SUB+=	NOUVEAU_DRIVER="@comment "
 PLIST_SUB+=	RADEON_DRIVERS="@comment "
 .else
 PLIST_SUB+=	ARM_DRIVERS="@comment "
 PLIST_SUB+=	INTEL_DRIVER="@comment "
 PLIST_SUB+=	NOUVEAU_DRIVER="@comment "
 PLIST_SUB+=	RADEON_DRIVERS="@comment "
 .endif
 
 # This variable is not for users. So use a non-default name, intended for
 # people working on DRM kernel module development.
 .if ${OPSYS} == FreeBSD && !defined(LIBDRM_SKIP_RETURN_PATCH)
 EXTRA_PATCHES+=	${FILESDIR}/extra-xf86drm.c
 .endif
 
 .include <bsd.port.mk>
diff --git a/graphics/libdrm/pkg-plist b/graphics/libdrm/pkg-plist
index 86ecb5bdbe02..eb650a1dac6c 100644
--- a/graphics/libdrm/pkg-plist
+++ b/graphics/libdrm/pkg-plist
@@ -1,94 +1,94 @@
 %%TESTS%%bin/kms-steal-crtc
 %%TESTS%%bin/kms-universal-planes
 %%TESTS%%bin/kmstest
 %%TESTS%%bin/modeprint
 %%TESTS%%bin/modetest
 %%TESTS%%bin/proptest
 %%TESTS%%bin/vbltest
 %%ARM_DRIVERS%%include/freedreno/freedreno_drmif.h
 %%ARM_DRIVERS%%include/freedreno/freedreno_ringbuffer.h
 %%RADEON_DRIVERS%%include/libdrm/amdgpu.h
 %%RADEON_DRIVERS%%include/libdrm/amdgpu_drm.h
 include/libdrm/drm.h
 include/libdrm/drm_fourcc.h
 include/libdrm/drm_mode.h
 include/libdrm/drm_sarea.h
 %%INTEL_DRIVER%%include/libdrm/i915_drm.h
 %%INTEL_DRIVER%%include/libdrm/intel_aub.h
 %%INTEL_DRIVER%%include/libdrm/intel_bufmgr.h
 %%INTEL_DRIVER%%include/libdrm/intel_debug.h
 %%LEGACY%%include/libdrm/mach64_drm.h
 %%LEGACY%%include/libdrm/mga_drm.h
 %%LEGACY%%include/libdrm/msm_drm.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau/nouveau.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau/nvif/cl0080.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau/nvif/cl9097.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau/nvif/class.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau/nvif/if0002.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau/nvif/if0003.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau/nvif/ioctl.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau/nvif/unpack.h
 %%NOUVEAU_DRIVER%%include/libdrm/nouveau_drm.h
 %%LEGACY%%include/libdrm/qxl_drm.h
 %%LEGACY%%include/libdrm/r128_drm.h
 %%RADEON_DRIVERS%%include/libdrm/r600_pci_ids.h
 %%RADEON_DRIVERS%%include/libdrm/radeon_bo.h
 %%RADEON_DRIVERS%%include/libdrm/radeon_bo_gem.h
 %%RADEON_DRIVERS%%include/libdrm/radeon_bo_int.h
 %%RADEON_DRIVERS%%include/libdrm/radeon_cs.h
 %%RADEON_DRIVERS%%include/libdrm/radeon_cs_gem.h
 %%RADEON_DRIVERS%%include/libdrm/radeon_cs_int.h
 %%RADEON_DRIVERS%%include/libdrm/radeon_drm.h
 %%RADEON_DRIVERS%%include/libdrm/radeon_surface.h
 %%LEGACY%%include/libdrm/savage_drm.h
 %%LEGACY%%include/libdrm/sis_drm.h
 %%ARM_DRIVERS%%include/libdrm/tegra_drm.h
 %%ARM_DRIVERS%%include/libdrm/vc4_drm.h
 %%ARM_DRIVERS%%include/libdrm/vc4_packet.h
 %%ARM_DRIVERS%%include/libdrm/vc4_qpu_defines.h
 %%LEGACY%%include/libdrm/via_drm.h
-include/libdrm/virtgpu_drm.h
-include/libdrm/vmwgfx_drm.h
+%%VIRTGPU_DRIVER%%include/libdrm/virtgpu_drm.h
+%%VMWGFX_DRIVER%%include/libdrm/vmwgfx_drm.h
 include/libkms/libkms.h
 include/libsync.h
 include/xf86drm.h
 include/xf86drmMode.h
 lib/libdrm.so
 lib/libdrm.so.2
 lib/libdrm.so.2.4.0
 %%RADEON_DRIVERS%%lib/libdrm_amdgpu.so
 %%RADEON_DRIVERS%%lib/libdrm_amdgpu.so.1
 %%RADEON_DRIVERS%%lib/libdrm_amdgpu.so.1.0.0
 %%ARM_DRIVERS%%lib/libdrm_freedreno.so
 %%ARM_DRIVERS%%lib/libdrm_freedreno.so.1
 %%ARM_DRIVERS%%lib/libdrm_freedreno.so.1.0.0
 %%INTEL_DRIVER%%lib/libdrm_intel.so
 %%INTEL_DRIVER%%lib/libdrm_intel.so.1
 %%INTEL_DRIVER%%lib/libdrm_intel.so.1.0.0
 %%NOUVEAU_DRIVER%%lib/libdrm_nouveau.so
 %%NOUVEAU_DRIVER%%lib/libdrm_nouveau.so.2
 %%NOUVEAU_DRIVER%%lib/libdrm_nouveau.so.2.0.0
 %%RADEON_DRIVERS%%lib/libdrm_radeon.so
 %%RADEON_DRIVERS%%lib/libdrm_radeon.so.1
 %%RADEON_DRIVERS%%lib/libdrm_radeon.so.1.0.1
 lib/libkms.so
 lib/libkms.so.1
 lib/libkms.so.1.0.0
 libdata/pkgconfig/libdrm.pc
 %%RADEON_DRIVERS%%libdata/pkgconfig/libdrm_amdgpu.pc
 %%ARM_DRIVERS%%libdata/pkgconfig/libdrm_freedreno.pc
 %%INTEL_DRIVER%%libdata/pkgconfig/libdrm_intel.pc
 %%NOUVEAU_DRIVER%%libdata/pkgconfig/libdrm_nouveau.pc
 %%RADEON_DRIVERS%%libdata/pkgconfig/libdrm_radeon.pc
 %%ARM_DRIVERS%%libdata/pkgconfig/libdrm_vc4.pc
 libdata/pkgconfig/libkms.pc
 %%MANPAGES%%man/man3/drmAvailable.3.gz
 %%MANPAGES%%man/man3/drmHandleEvent.3.gz
 %%MANPAGES%%man/man3/drmModeGetResources.3.gz
 %%MANPAGES%%man/man7/drm-gem.7.gz
 %%MANPAGES%%man/man7/drm-kms.7.gz
 %%MANPAGES%%man/man7/drm-memory.7.gz
 %%MANPAGES%%man/man7/drm-mm.7.gz
 %%MANPAGES%%man/man7/drm-ttm.7.gz
 %%MANPAGES%%man/man7/drm.7.gz
 %%RADEON_DRIVERS%%%%DATADIR%%/amdgpu.ids
-- 
2.25.0