Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Jun 2020 09:23:13 +0000 (UTC)
From:      Emmanuel Vadot <manu@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r538079 - in head/graphics: mesa-dri mesa-libs
Message-ID:  <202006060923.0569ND31049992@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: manu
Date: Sat Jun  6 09:23:13 2020
New Revision: 538079
URL: https://svnweb.freebsd.org/changeset/ports/538079

Log:
   mesa*: Add platforms option
  
  Mesa support different platforms, add some options that control which one
  we are enabling and build the -Dplatform meson arg based on that.
  Keep the WAYLAND option for now but if you're using it switch to the
  newly created PLATFORM_WAYLAND.
  
  PR:		246969
  Approved by:	zeising (x11@ implicit)

Modified:
  head/graphics/mesa-dri/Makefile
  head/graphics/mesa-libs/Makefile

Modified: head/graphics/mesa-dri/Makefile
==============================================================================
--- head/graphics/mesa-dri/Makefile	Sat Jun  6 09:13:40 2020	(r538078)
+++ head/graphics/mesa-dri/Makefile	Sat Jun  6 09:23:13 2020	(r538079)
@@ -11,8 +11,16 @@ COMMENT=	OpenGL hardware acceleration drivers for DRI2
 USES=		xorg
 USE_XORG=	xorgproto x11 xdamage xext xfixes xshmfence xv xvmc
 
+OPTIONS_GROUP=			PLATFORM
+OPTIONS_GROUP_PLATFORM=		PLATFORM_X11 PLATFORM_WAYLAND PLATFORM_DRM PLATFORM_SURFACELESS
+PLATFORM_X11_DESC=		Enable X11 support for GBM/EGL
+PLATFORM_WAYLAND_DESC=		Enable Wayland support for GBM/EGL
+PLATFORM_DRM_DESC=		Enable DRM support for GBM/EGL
+PLATFORM_SURFACELESS_DESC=	Enable Surfaceless support for GBM/EGL
+PLATFORM_WAYLAND_IMPLIES=	WAYLAND
+
 OPTIONS_DEFINE=	VAAPI VDPAU WAYLAND
-OPTIONS_DEFAULT=WAYLAND
+OPTIONS_DEFAULT=WAYLAND PLATFORM_X11 PLATFORM_WAYLAND PLATFORM_DRM PLATFORM_SURFACELESS
 OPTIONS_SUB=	yes
 
 VAAPI_MESON_ON=		-Dgallium-va=true
@@ -25,6 +33,7 @@ VDPAU_LIB_DEPENDS=	libvdpau.so:multimedia/libvdpau
 WAYLAND_DESC=		Enable support for the Wayland platform in Vulkan drivers
 WAYLAND_BUILD_DEPENDS=	wayland-protocols>=1.8:graphics/wayland-protocols
 WAYLAND_LIB_DEPENDS=	libwayland-client.so:graphics/wayland
+WAYLAND_IMPLIES=	PLATFORM_WAYLAND
 
 .include <bsd.port.options.mk>
 .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
@@ -63,14 +72,26 @@ USE_XORG+=		xcb xrandr
 
 LDFLAGS_i386=		-Wl,-znotext
 
-# enables VK_KHR_wayland_surface in Vulkan drivers
-.if ${PORT_OPTIONS:MWAYLAND} && !empty(VULKAN_DRIVERS)
-MESON_ARGS+=	-Dplatforms=x11,surfaceless,drm,wayland
+.if ${PORT_OPTIONS:MPLATFORM_X11}
+MESA_PLATFORMS+=	x11
 .endif
 
+.if ${PORT_OPTIONS:MPLATFORM_DRM}
+MESA_PLATFORMS+=	drm
+.endif
+
+.if ${PORT_OPTIONS:MPLATFORM_SURFACELESS}
+MESA_PLATFORMS+=	surfaceless
+.endif
+
+# .if ${PORT_OPTIONS:MPLATFORM_WAYLAND} && !${PORT_OPTIONS:MWAYLAND}
+# .error "Platform Wayland is selected but Wayland support is disabled"
+# .endif
+
 MESON_ARGS+=	-Ddri-drivers="${DRI_DRIVERS:ts,:tl}" \
 			-Dgallium-drivers="${GALLIUM_DRIVERS:ts,:tl}" \
-			-Dvulkan-drivers="${VULKAN_DRIVERS:ts,:tl}"
+			-Dvulkan-drivers="${VULKAN_DRIVERS:ts,:tl}" \
+			-Dplatforms="${MESA_PLATFORMS:ts,:tl}"
 
 # Disable some options
 MESON_ARGS+=	-Dgallium-xa=false \

Modified: head/graphics/mesa-libs/Makefile
==============================================================================
--- head/graphics/mesa-libs/Makefile	Sat Jun  6 09:13:40 2020	(r538078)
+++ head/graphics/mesa-libs/Makefile	Sat Jun  6 09:23:13 2020	(r538079)
@@ -13,13 +13,22 @@ USES=		xorg
 USE_XORG=	xorgproto x11 xcb xdamage xext \
 		xfixes xshmfence xxf86vm xrandr
 
+OPTIONS_GROUP=			PLATFORM
+OPTIONS_GROUP_PLATFORM=		PLATFORM_X11 PLATFORM_WAYLAND PLATFORM_DRM PLATFORM_SURFACELESS
+PLATFORM_X11_DESC=		Enable X11 support for GBM/EGL
+PLATFORM_WAYLAND_DESC=		Enable Wayland support for GBM/EGL
+PLATFORM_DRM_DESC=		Enable DRM support for GBM/EGL
+PLATFORM_SURFACELESS_DESC=	Enable Surfaceless support for GBM/EGL
+PLATFORM_WAYLAND_IMPLIES=	WAYLAND
+
 OPTIONS_DEFINE=	WAYLAND
-OPTIONS_DEFAULT=WAYLAND
+OPTIONS_DEFAULT=WAYLAND PLATFORM_X11 PLATFORM_WAYLAND PLATFORM_DRM PLATFORM_SURFACELESS
 OPTIONS_SUB=	yes
 
 WAYLAND_DESC=		Enable support for the Wayland platform in EGL
 WAYLAND_BUILD_DEPENDS=	wayland-protocols>=1.8:graphics/wayland-protocols
 WAYLAND_LIB_DEPENDS=	libwayland-egl.so:graphics/wayland
+WAYLAND_IMPLIES=	PLATFORM_WAYLAND
 
 .include <bsd.port.options.mk>
 .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common"
@@ -40,9 +49,23 @@ MESON_ARGS+=	-Dgallium-drivers="" \
 # Building EGL and GBM requires a dri driver so add swrast
 MESON_ARGS+=	-Ddri-drivers="swrast"
 
-.if ${PORT_OPTIONS:MWAYLAND}
-MESON_ARGS+=	-Dplatforms=x11,surfaceless,drm,wayland
+.if ${PORT_OPTIONS:MPLATFORM_X11}
+MESA_PLATFORMS+=	x11
 .endif
+
+.if ${PORT_OPTIONS:MPLATFORM_WAYLAND} && ${PORT_OPTIONS:MWAYLAND}
+MESA_PLATFORMS+=	wayland
+.endif
+
+.if ${PORT_OPTIONS:MPLATFORM_DRM}
+MESA_PLATFORMS+=	drm
+.endif
+
+.if ${PORT_OPTIONS:MPLATFORM_SURFACELESS}
+MESA_PLATFORMS+=	surfaceless
+.endif
+
+MESON_ARGS+=	-Dplatforms="${MESA_PLATFORMS:ts,:tl}"
 
 .if ${ARCH} == "i386"
 # PR230239 Fix the build for i386 when WITH_LLD_IS_LD is set



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202006060923.0569ND31049992>