diff options
author | Emmanuel Vadot <manu@FreeBSD.org> | 2020-06-06 09:23:13 +0000 |
---|---|---|
committer | Emmanuel Vadot <manu@FreeBSD.org> | 2020-06-06 09:23:13 +0000 |
commit | d212d9633c93cb3277576e5e28990e17307c855e (patch) | |
tree | 3fea2be489c2dd27d5610e29e81a8d8b2c786b12 | |
parent | Merge r532982 from www/nginx-devel: (diff) |
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)
Notes
Notes:
svn path=/head/; revision=538079
-rw-r--r-- | graphics/mesa-dri/Makefile | 31 | ||||
-rw-r--r-- | graphics/mesa-libs/Makefile | 29 |
2 files changed, 52 insertions, 8 deletions
diff --git a/graphics/mesa-dri/Makefile b/graphics/mesa-dri/Makefile index be65e261cfe0..57719d24ea03 100644 --- a/graphics/mesa-dri/Makefile +++ b/graphics/mesa-dri/Makefile @@ -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 \ diff --git a/graphics/mesa-libs/Makefile b/graphics/mesa-libs/Makefile index e6fec368cead..01b9bab50191 100644 --- a/graphics/mesa-libs/Makefile +++ b/graphics/mesa-libs/Makefile @@ -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,10 +49,24 @@ 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 LDFLAGS+=-Wl,-z,notext |