diff --git a/graphics/libosmesa/Makefile b/graphics/libosmesa/Makefile index 21a6cd84ebd3..95d775e4062f 100644 --- a/graphics/libosmesa/Makefile +++ b/graphics/libosmesa/Makefile @@ -1,57 +1,59 @@ PORTNAME= libosmesa PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= Off-Screen Mesa implementation of the OpenGL API WWW= https://www.mesa3d.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/docs/license.rst +BROKEN= osmesa was removed upstream in mesa 25.1 + LIB_DEPENDS+= libglapi.so:graphics/mesa-libs USES= llvm:lib,noexport xorg USE_XORG= xorgproto USE_LDCONFIG= yes .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" # Disable some options MESON_ARGS+= -Dgallium-drivers="swrast" \ -Dvulkan-drivers="" \ -Dplatforms="" \ -Dandroid-libbacktrace=disabled \ -Dgallium-vdpau=disabled \ -Dgallium-omx=disabled \ -Dgallium-va=disabled \ -Dgallium-opencl=disabled \ -Dgallium-xa=disabled \ -Dgallium-nine=false \ -Dgles1=disabled \ -Dgles2=disabled \ -Dglvnd=disabled \ -Dlmsensors=disabled \ -Dmicrosoft-clc=disabled \ -Dopengl=true \ -Dglx=disabled \ -Degl=disabled \ -Dgbm=disabled \ -Dtools="" \ -Dvalgrind=disabled \ -Dxlib-lease=disabled \ -Dzstd=disabled LDFLAGS_i386= -Wl,-znotext MESON_ARGS+= -Dosmesa=true .if ${ARCH} != amd64 MESON_ARGS+= -Dintel-rt=disabled # https://gitlab.freedesktop.org/mesa/mesa/-/issues/10629 .endif post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/include/GL ${INSTALL_DATA} ${WRKSRC}/include/GL/osmesa.h \ ${STAGEDIR}${PREFIX}/include/GL .include diff --git a/graphics/mesa-dri/Makefile b/graphics/mesa-dri/Makefile index 368f39e9d33d..fe3e236e72a4 100644 --- a/graphics/mesa-dri/Makefile +++ b/graphics/mesa-dri/Makefile @@ -1,143 +1,145 @@ PORTNAME= mesa-dri PORTVERSION= ${MESAVERSION} -PORTREVISION= 12 CATEGORIES= graphics COMMENT= OpenGL hardware acceleration drivers for DRI2+ WWW= https://www.mesa3d.org/ BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply@${PY_FLAVOR} - -LIB_DEPENDS+= libglapi.so:graphics/mesa-libs +LIB_DEPENDS+= libgallium-${MESAVERSION}.so:graphics/mesa-libs \ + libgbm.so:graphics/mesa-libs USES+= llvm:lib,noexport OPTIONS_DEFINE= ZSTD OPTIONS_GROUP= GALLIUM PLATFORM VULKAN OPTIONS_DEFAULT= WAYLAND X11 ZSTD OPTIONS_SUB= yes ZSTD_DESC= Use ZSTD for shader cache ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd ZSTD_MESON_ENABLED= zstd OPTIONS_GROUP_PLATFORM= X11 WAYLAND X11_DESC= Enable X11 support for GBM/EGL WAYLAND_DESC= Enable Wayland support for GBM/EGL and Vulkan WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols WAYLAND_LIB_DEPENDS= libwayland-client.so:graphics/wayland -OPTIONS_GROUP_GALLIUM= crocus i915 iris panfrost r300 r600 radeonsi svga swrast zink +OPTIONS_GROUP_GALLIUM= crocus i915 iris llvmpipe panfrost r300 r600 radeonsi svga zink GALLIUM_DESC= Unified OpenGL drivers crocus_DESC= Intel GPU Gen4 (Broadwater) to Gen7 (Haswell) i915_DESC= Intel GPU Gen3 (Grantsdale to Pineview) iris_DESC= Intel GPU Gen8 (Broadwell) and newer iris_BUILD_DEPENDS= libclc-${LLVM_PORT:T}>0:devel/libclc@${LLVM_PORT:T} \ spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} iris_RUN_DEPENDS= spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} iris_CONFIGURE_ENV= PKG_CONFIG_PATH="${LLVM_PREFIX}/libdata/pkgconfig" iris_IMPLIES= SPIRV +llvmpipe_DESC= Software Rasterizer panfrost_DESC= ARM Midgard and Bifrost r300_DESC= AMD/ATI R300, R400 and R500 r600_DESC= AMD/ATI R600, R700, Evergreen, Northern Islands radeonsi_DESC= AMD/ATI Southern Islands and newer svga_DESC= VMWare Virtual GPU -swrast_DESC= Software Rasterizer zink_DESC= OpenGL on top of Khronos’ Vulkan API OPTIONS_EXCLUDE+= ${ARCH:Marmv7:C/.+/crocus i915 iris panfrost r300 r600 radeonsi svga zink/} OPTIONS_EXCLUDE+= ${ARCH:Naarch64:C/.+/panfrost/} OPTIONS_EXCLUDE+= ${ARCH:Namd64:Ni386:Nx86_64:C/.+/crocus i915 iris svga/} MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,} . for _gd in ${OPTIONS_GROUP_GALLIUM} OPTIONS_DEFAULT+= ${_gd} ${_gd}_VARS+= GALLIUM_DRIVERS+=${_gd} . endfor OPTIONS_GROUP_VULKAN= anv radv swrast_vk VULKAN_DESC= Vulkan drivers anv_DESC= Intel GPU Gen9 and newer Vulkan support anv_BUILD_DEPENDS= glslangValidator:graphics/glslang \ libclc-${LLVM_PORT:T}>0:devel/libclc@${LLVM_PORT:T} \ spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} anv_RUN_DEPENDS= spirv-tools>0:graphics/spirv-tools \ spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} anv_CONFIGURE_ENV= PKG_CONFIG_PATH="${LLVM_PREFIX}/libdata/pkgconfig" radv_DESC= AMD/ATI Southern Islands and newer Vulkan support radv_BUILD_DEPENDS= glslangValidator:graphics/glslang swrast_vk_DESC= Software Rasterizer Vulkan support OPTIONS_EXCLUDE+= ${ARCH:Marmv7:C/.+/anv radv/} OPTIONS_EXCLUDE+= ${ARCH:Namd64:Ni386:Nx86_64:C/.+/anv/} MESON_ARGS+= -Dvulkan-drivers=${VULKAN_DRIVERS:ts,} . for _vd in ${OPTIONS_GROUP_VULKAN} OPTIONS_DEFAULT+= ${_vd} ${_vd}_VARS+= VULKAN_DRIVERS+=${_vd:S/anv/intel/:S/radv/amd/:S/swrast_vk/swrast/} . endfor .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" LDFLAGS_i386= -Wl,-znotext .if ${PORT_OPTIONS:MX11} MESA_PLATFORMS+= x11 USE_XORG+= xcb xorgproto xrandr x11 xdamage xext xfixes xshmfence xv .else MESON_ARGS+= -Dxlib-lease=disabled .endif .if ${PORT_OPTIONS:MWAYLAND} MESA_PLATFORMS+= wayland .endif MESON_ARGS+= -Dplatforms="${MESA_PLATFORMS:ts,:tl}" # Vulkan Video extensions (keep in sync with mesa-gallium-va) MESON_ARGS+= -Dvideo-codecs="vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec" # Disable some options MESON_ARGS+= -Dandroid-libbacktrace=disabled \ - -Dgallium-xa=disabled \ -Dgallium-vdpau=disabled \ -Dgallium-va=disabled \ -Dgles1=enabled \ -Dgles2=enabled \ -Dglvnd=disabled \ -Dglx=disabled \ -Degl=enabled \ -Dlmsensors=disabled \ -Dmicrosoft-clc=disabled \ - -Dosmesa=false \ -Dvalgrind=disabled .if ${ARCH} != amd64 MESON_ARGS+= -Dintel-rt=disabled # https://gitlab.freedesktop.org/mesa/mesa/-/issues/10629 .endif .for _gd in ${OPTIONS_GROUP_GALLIUM} . if defined(GALLIUM_DRIVERS) && ${GALLIUM_DRIVERS:M${_gd}} PLIST_SUB+= ${_gd}="" . else PLIST_SUB+= ${_gd}="@comment " . endif .endfor PLIST_SUB += ARCH=${ARCH:S/amd/x86_/} .for _vd in ${OPTIONS_GROUP_VULKAN} . if defined(VULKAN_DRIVERS) && ${VULKAN_DRIVERS:M${_vd}} PLIST_SUB+= ${_vd}="" . else PLIST_SUB+= ${_vd}="@comment " . endif .endfor post-install: - @${RM} -r ${STAGEDIR}/etc/OpenCL +# Mesa 25: libgallium-${MESAVERSION}.so and the gbm/GL/dri.pc/drirc bits +# all belong to graphics/mesa-libs. Strip them from this port's stage tree. + ${RM} -r ${STAGEDIR}${PREFIX}/include + ${RM} ${STAGEDIR}${PREFIX}/lib/libgallium-${MESAVERSION}.so + ${RM} -r ${STAGEDIR}${PREFIX}/lib/gbm + ${RM} -r ${STAGEDIR}${PREFIX}/libdata/pkgconfig ${INSTALL_DATA} ${FILESDIR}/01-freebsd.conf \ ${STAGEDIR}${PREFIX}/share/drirc.d .include diff --git a/graphics/mesa-dri/Makefile.common b/graphics/mesa-dri/Makefile.common index 6862ddeb24ac..6fea3639e33c 100644 --- a/graphics/mesa-dri/Makefile.common +++ b/graphics/mesa-dri/Makefile.common @@ -1,83 +1,77 @@ # Makefile.common - shared code between MesaLib ports. # # !!! Here be dragons !!! (they seem to be everywhere these days) # # Remember to upgrade the following ports everytime you bump MESAVERSION: # # - graphics/libosmesa # - graphics/mesa-dri # - graphics/mesa-libs # - lang/clover -MESAVERSION= 24.1.7 +MESAVERSION= 25.2.8 MASTER_SITES= https://mesa.freedesktop.org/archive/ DISTFILES= mesa-${MESAVERSION}${EXTRACT_SUFX} -PATCH_SITES= https://gitlab.freedesktop.org/mesa/mesa/-/commit/ -PATCHFILES+= 4a253aae7ca437201d2a31d2a11a1a5434fe41f1.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26284 -PATCHFILES+= 5a9c052ba78e5d1b0020b8f8320d211d2205a958.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29993 -PATCHFILES+= 5d48fb19553c15bbbac498afcb7cc8710a803716.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31931 -PATCHFILES+= fa9cd89a85b904615ebc11da609445b5b751e68d.patch:-p1 # https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31533 - MAINTAINER= x11@FreeBSD.org LICENSE= MIT LICENSE_FILE= ${WRKSRC}/docs/license.rst COMPONENT= ${PORTNAME:tl:C/^lib//:C/mesa-//} BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}mako>0:textproc/py-mako@${PY_FLAVOR} \ - ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} + ${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}pyyaml>0:devel/py-pyyaml@${PY_FLAVOR} .if ${COMPONENT} != clover .if ${PORT_OPTIONS:MX11} USES+= xorg .endif .endif LIB_DEPENDS+= libdrm.so:graphics/libdrm .if ${COMPONENT} != osmesa LIB_DEPENDS+= libexpat.so:textproc/expat2 .endif USES+= compiler:c++11-lib bison meson pathfix pkgconfig \ python:build shebangfix tar:xz # only have one port to check with portscout. .if ${PORTNAME} != mesa-dri PORTSCOUT= ignore:1 .endif MASTERDIR= ${.CURDIR:H:H}/graphics/mesa-dri PATCHDIR= ${MASTERDIR}/files WRKSRC= ${WRKDIR}/mesa-${MESAVERSION} DESCR= ${.CURDIR}/pkg-descr PLIST= ${.CURDIR}/pkg-plist PKGHELP= ${.CURDIR}/pkg-help PKGINSTALL= ${.CURDIR}/pkg-install PKGDEINSTALL= ${.CURDIR}/pkg-deinstall .include BINARY_ALIAS+= python3=${PYTHON_VERSION} CONFIGURE_ENV+= LLVM_CONFIG=${LLVM_CONFIG} -# Deal with unclean env if the user have elfutils installed -# and build the port directly without poudriere +# mesa 25.x removed the -Dlibelf option; libelf is now auto-detected. +# If the user has elfutils installed in LOCALBASE, propagate it as a +# proper LIB_DEPENDS so the dependency is recorded. .if exists(${LOCALBASE}/include/libelf.h) LIB_DEPENDS+= libelf.so:devel/elfutils -MESON_ARGS+= -Dlibelf=enabled -.else -MESON_ARGS+= -Dlibelf=disabled .endif # Some symbols in mesa's linker version scripts are not always defined, # depending on configuration options. Suppress errors with lld >= 17 due to # these undefined symbols. LDFLAGS+= -Wl,--undefined-version LDFLAGS+= -Wl,-rpath=${LOCALBASE}/llvm${LLVM_VERSION}/lib MESON_ARGS+= -Dllvm=enabled \ - -Dlibunwind=disabled + -Dlibunwind=disabled \ + -Dgallium-mediafoundation=disabled diff --git a/graphics/mesa-dri/distinfo b/graphics/mesa-dri/distinfo index 61f1b44e1d26..39a69f4d89b2 100644 --- a/graphics/mesa-dri/distinfo +++ b/graphics/mesa-dri/distinfo @@ -1,11 +1,3 @@ -TIMESTAMP = 1745569914 -SHA256 (mesa-24.1.7.tar.xz) = ecd2e7b1c73998f4103542f39c6b8c968d251637ccc8caa42641aecb86cd2566 -SIZE (mesa-24.1.7.tar.xz) = 29206724 -SHA256 (4a253aae7ca437201d2a31d2a11a1a5434fe41f1.patch) = 84f18f14788bd8f387e2fc754b945bf30f84b517dd917785ed5d8ef1d594e24a -SIZE (4a253aae7ca437201d2a31d2a11a1a5434fe41f1.patch) = 1626 -SHA256 (5a9c052ba78e5d1b0020b8f8320d211d2205a958.patch) = 4b4b7e205ea333db66c809d442f17e1f865aa623c54e7e4d918c45a1f2c9704f -SIZE (5a9c052ba78e5d1b0020b8f8320d211d2205a958.patch) = 2162 -SHA256 (5d48fb19553c15bbbac498afcb7cc8710a803716.patch) = 316360bdb0e0eb46075a8e537e1147283d1e88f2ee48d9eac13bb8c24f7d7b46 -SIZE (5d48fb19553c15bbbac498afcb7cc8710a803716.patch) = 1090 -SHA256 (fa9cd89a85b904615ebc11da609445b5b751e68d.patch) = ec8acde15e1408a871f977db4743300f654efa888d032d680aed19938024ea24 -SIZE (fa9cd89a85b904615ebc11da609445b5b751e68d.patch) = 1346 +TIMESTAMP = 1777655135 +SHA256 (mesa-25.2.8.tar.xz) = 097842f3e49d996868b38688db87b006f7d4541e93ce86d2f341d8b3e7be7c93 +SIZE (mesa-25.2.8.tar.xz) = 43813260 diff --git a/graphics/mesa-dri/files/patch-include_renderdoc__app.h b/graphics/mesa-dri/files/patch-include_renderdoc__app.h new file mode 100644 index 000000000000..7334da88f9f2 --- /dev/null +++ b/graphics/mesa-dri/files/patch-include_renderdoc__app.h @@ -0,0 +1,11 @@ +--- include/renderdoc_app.h.orig 2026-05-01 23:38:47 UTC ++++ include/renderdoc_app.h +@@ -35,7 +35,7 @@ + + #if defined(WIN32) + #define RENDERDOC_CC __cdecl +-#elif defined(__linux__) ++#elif defined(__linux__) || defined(__FreeBSD__) || defined(__DragonFly__) + #define RENDERDOC_CC + #elif defined(__APPLE__) + #define RENDERDOC_CC diff --git a/graphics/mesa-dri/files/patch-llvmpipe-159fb9691d792594b91e0fbc4c7823e1a191620d.patch b/graphics/mesa-dri/files/patch-llvmpipe-159fb9691d792594b91e0fbc4c7823e1a191620d.patch deleted file mode 100644 index c3c250a8b8df..000000000000 --- a/graphics/mesa-dri/files/patch-llvmpipe-159fb9691d792594b91e0fbc4c7823e1a191620d.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 159fb9691d792594b91e0fbc4c7823e1a191620d Mon Sep 17 00:00:00 2001 -From: Lucas Fryzek -Date: Mon, 28 Oct 2024 13:02:26 -0400 -Subject: [PATCH] lp: Only close udmabuf handle if its valid - -Also change ifdef's from just `HAVE_LIBDRM` to check for both LIBDRM -and for UDMABUF HEADER. preventing unbalanced guards preventing part of -the code from being included if you just have LIBDRM or just have the -udmabuf headers. - -Fixes: 4cfaf10c ("llvmpipe: Only use udmabuf with libdrm") -Reviewed-by: Konstantin Seurer -Part-of: ---- - src/gallium/drivers/llvmpipe/lp_screen.c | 5 +++-- - src/gallium/drivers/llvmpipe/lp_screen.h | 2 +- - 2 files changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c -index 8ede54a1fdf20..f85911b4703ac 100644 ---- src/gallium/drivers/llvmpipe/lp_screen.c -+++ src/gallium/drivers/llvmpipe/lp_screen.c -@@ -939,8 +939,9 @@ llvmpipe_destroy_screen(struct pipe_screen *_screen) - - glsl_type_singleton_decref(); - --#ifdef HAVE_LIBDRM -- close(screen->udmabuf_fd); -+#if defined(HAVE_LIBDRM) && defined(HAVE_LINUX_UDMABUF_H) -+ if (screen->udmabuf_fd != -1) -+ close(screen->udmabuf_fd); - #endif - - #if DETECT_OS_LINUX -diff --git a/src/gallium/drivers/llvmpipe/lp_screen.h b/src/gallium/drivers/llvmpipe/lp_screen.h -index f36628340b3af..63ce25d56d1d3 100644 ---- src/gallium/drivers/llvmpipe/lp_screen.h -+++ src/gallium/drivers/llvmpipe/lp_screen.h -@@ -75,7 +75,7 @@ struct llvmpipe_screen - - struct disk_cache *disk_shader_cache; - --#ifdef HAVE_LIBDRM -+#if defined(HAVE_LIBDRM) && defined(HAVE_LINUX_UDMABUF_H) - int udmabuf_fd; - #endif - --- -GitLab - diff --git a/graphics/mesa-dri/files/patch-meson.build b/graphics/mesa-dri/files/patch-meson.build index b94c2e4dd7ba..dee5fd0ef099 100644 --- a/graphics/mesa-dri/files/patch-meson.build +++ b/graphics/mesa-dri/files/patch-meson.build @@ -1,11 +1,11 @@ ---- meson.build.orig 2023-09-20 17:15:34 UTC +--- meson.build.orig 2026-05-01 17:13:34 UTC +++ meson.build -@@ -709,7 +709,7 @@ if _power8.allowed() - int main() { - vector unsigned char r; - vector unsigned int v = vec_splat_u32 (1); -- r = __builtin_vec_vgbbd ((vector unsigned char) v); -+ r = __builtin_altivec_vgbbd ((vector unsigned char) v); - return 0; - }''', - args : '-mpower8-vector', +@@ -734,7 +734,7 @@ if host_machine.cpu_family() == 'ppc64' and host_machi + int main() { + vector unsigned char r; + vector unsigned int v = vec_splat_u32 (1); +- r = __builtin_vec_vgbbd ((vector unsigned char) v); ++ r = __builtin_altivec_vgbbd ((vector unsigned char) v); + return 0; + }''', + name : 'POWER8 intrinsics') diff --git a/graphics/mesa-dri/pkg-plist b/graphics/mesa-dri/pkg-plist index 5c06f06c0b75..6288ae10fb87 100644 --- a/graphics/mesa-dri/pkg-plist +++ b/graphics/mesa-dri/pkg-plist @@ -1,64 +1,34 @@ -@comment include/EGL/egl.h -@comment include/EGL/eglext_angle.h -@comment include/EGL/eglext.h -@comment include/EGL/eglmesaext.h -@comment include/EGL/eglplatform.h -include/GL/internal/dri_interface.h -@comment include/GL/gl.h -@comment include/GL/glcorearb.h -@comment include/GL/glext.h -@comment include/GLES/egl.h -@comment include/GLES/gl.h -@comment include/GLES/glext.h -@comment include/GLES/glplatform.h -@comment include/GLES2/gl2.h -@comment include/GLES2/gl2ext.h -@comment include/GLES2/gl2platform.h -@comment include/GLES3/gl3.h -@comment include/GLES3/gl31.h -@comment include/GLES3/gl32.h -@comment include/GLES3/gl3ext.h -@comment include/GLES3/gl3platform.h -@comment include/KHR/khrplatform.h -@comment include/gbm.h +lib/dri/libdril_dri.so %%crocus%%lib/dri/crocus_dri.so %%i915%%lib/dri/i915_dri.so %%iris%%lib/dri/iris_dri.so %%panfrost%%lib/dri/panfrost_dri.so %%panfrost%%lib/dri/rockchip_dri.so %%r300%%lib/dri/r300_dri.so %%r600%%lib/dri/r600_dri.so %%radeonsi%%lib/dri/radeonsi_dri.so %%svga%%lib/dri/vmwgfx_dri.so -%%swrast%%lib/dri/kms_swrast_dri.so -%%swrast%%lib/dri/swrast_dri.so +%%llvmpipe%%lib/dri/kms_swrast_dri.so +%%llvmpipe%%lib/dri/swrast_dri.so %%zink%%lib/dri/zink_dri.so @comment lib/libEGL.so @comment lib/libEGL.so.1 @comment lib/libEGL.so.1.0.0 @comment lib/libgbm.so @comment lib/libgbm.so.1 @comment lib/libgbm.so.1.0.0 -@comment lib/libglapi.so -@comment lib/libglapi.so.0 -@comment lib/libglapi.so.0.0.0 @comment lib/libGLESv1_CM.so @comment lib/libGLESv1_CM.so.1 @comment lib/libGLESv1_CM.so.1.1.0 @comment lib/libGLESv2.so @comment lib/libGLESv2.so.2 @comment lib/libGLESv2.so.2.0.0 %%anv%%lib/libvulkan_intel.so %%radv%%lib/libvulkan_radeon.so %%swrast_vk%%lib/libvulkan_lvp.so -libdata/pkgconfig/dri.pc -@comment libdata/pkgconfig/egl.pc -@comment libdata/pkgconfig/gbm.pc -@comment libdata/pkgconfig/glesv1_cm.pc -@comment libdata/pkgconfig/glesv2.pc share/drirc.d/00-mesa-defaults.conf %%radv%%share/drirc.d/00-radv-defaults.conf share/drirc.d/01-freebsd.conf %%anv%%share/vulkan/icd.d/intel_icd.%%ARCH%%.json %%radv%%share/vulkan/icd.d/radeon_icd.%%ARCH%%.json %%swrast_vk%%share/vulkan/icd.d/lvp_icd.%%ARCH%%.json diff --git a/graphics/mesa-gallium-va/Makefile b/graphics/mesa-gallium-va/Makefile index 84e1e1e22d9b..c9f47f2d85de 100644 --- a/graphics/mesa-gallium-va/Makefile +++ b/graphics/mesa-gallium-va/Makefile @@ -1,89 +1,91 @@ PORTNAME= mesa-gallium-va PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= Mesa Gallium VAAPI drivers WWW= https://www.mesa3d.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/docs/license.rst ONLY_FOR_ARCHS= aarch64 i386 amd64 powerpc64 powerpc64le ONLY_FOR_ARCHS_REASON= used only by AMD/Radeon hardware BUILD_DEPENDS= libva>=0:multimedia/libva -LIB_DEPENDS= libzstd.so:archivers/zstd +LIB_DEPENDS= libzstd.so:archivers/zstd \ + libgallium-${MESAVERSION}.so:graphics/mesa-libs USES= llvm:lib,noexport OPTIONS_DEFINE= X11 OPTIONS_GROUP= GALLIUM OPTIONS_DEFAULT= X11 OPTIONS_SUB= yes X11_DESC= Enable X11 support X11_USES= xorg X11_USE= xorg=xorgproto,x11,xcb,xdamage,xext,xfixes,xshmfence,xxf86vm,xrandr OPTIONS_GROUP_GALLIUM= radeonsi r600 GALLIUM_DESC= Gallium Video Drivers radeonsi_DESC= AMD/ATI Southern Islands and newer r600_DESC= AMD/ATI R600, R700, Evergreen, Northern Islands OPTIONS_EXCLUDE+= ${ARCH:Mi386:C/.+/radeonsi/} MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,} . for _gd in ${OPTIONS_GROUP_GALLIUM} OPTIONS_DEFAULT+= ${_gd} ${_gd}_VARS+= GALLIUM_DRIVERS+=${_gd} . endfor .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" MESON_ARGS+= -Dvideo-codecs="vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec" \ -Dvulkan-drivers="" \ -Dandroid-libbacktrace=disabled \ -Dgallium-vdpau=disabled \ - -Dgallium-omx=disabled \ - -Dgallium-xa=disabled \ - -Dgallium-opencl=disabled \ - -Dgallium-nine=false \ -Dgbm=disabled \ -Dgles1=disabled \ -Dgles2=disabled \ -Dglvnd=disabled \ -Dlmsensors=disabled \ -Dmicrosoft-clc=disabled \ - -Dosmesa=false \ -Dvalgrind=disabled \ - -Dglx=disabled \ - -Ddri3=enabled + -Dglx=disabled LDFLAGS_i386= -Wl,-znotext MESON_ARGS+= -Dgallium-va=enabled .if ${ARCH} != amd64 MESON_ARGS+= -Dintel-rt=disabled # https://gitlab.freedesktop.org/mesa/mesa/-/issues/10629 .endif .for _gd in ${OPTIONS_GROUP_GALLIUM} . if defined(GALLIUM_DRIVERS) && ${GALLIUM_DRIVERS:M${_gd}} PLIST_SUB+= ${_gd}="" . else PLIST_SUB+= ${_gd}="@comment " . endif .endfor .if ${PORT_OPTIONS:MX11} MESON_ARGS+= -Dplatforms="x11" .else MESON_ARGS+= -Dglx=disabled \ -Degl=disabled \ -Dopengl=false \ -Dshared-glapi=disabled \ -Dxlib-lease=disabled \ -Dplatforms="" .endif +post-install: +# Mesa 25: libgallium-${MESAVERSION}.so is owned by graphics/mesa-libs. + ${RM} -f ${STAGEDIR}${PREFIX}/lib/libgallium-${MESAVERSION}.so + ${RM} -f ${STAGEDIR}${PREFIX}/lib/dri/r300_dri.so + ${RM} -f ${STAGEDIR}${PREFIX}/lib/dri/r600_dri.so + ${RM} -f ${STAGEDIR}${PREFIX}/lib/dri/radeonsi_dri.so + .include diff --git a/graphics/mesa-gallium-vdpau/Makefile b/graphics/mesa-gallium-vdpau/Makefile index a4d2f06c89db..33ddf93dc2d7 100644 --- a/graphics/mesa-gallium-vdpau/Makefile +++ b/graphics/mesa-gallium-vdpau/Makefile @@ -1,74 +1,76 @@ PORTNAME= mesa-gallium-vdpau PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= Mesa Gallium VDPAU drivers WWW= https://www.mesa3d.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/docs/license.rst ONLY_FOR_ARCHS= aarch64 i386 amd64 powerpc64 powerpc64le ONLY_FOR_ARCHS_REASON= used only by AMD/Radeon hardware BUILD_DEPENDS= libvdpau>=0:multimedia/libvdpau -LIB_DEPENDS= libzstd.so:archivers/zstd +LIB_DEPENDS= libzstd.so:archivers/zstd \ + libgallium-${MESAVERSION}.so:graphics/mesa-libs USES= llvm:lib,noexport xorg USE_XORG= xorgproto x11 xcb xdamage xext xfixes xshmfence xxf86vm xrandr OPTIONS_GROUP= GALLIUM OPTIONS_SUB= yes OPTIONS_GROUP_GALLIUM= radeonsi r600 GALLIUM_DESC= Gallium Video Drivers radeonsi_DESC= AMD/ATI Southern Islands and newer r600_DESC= AMD/ATI R600, R700, Evergreen, Northern Islands OPTIONS_EXCLUDE+= ${ARCH:Mi386:C/.+/radeonsi/} MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,} . for _gd in ${OPTIONS_GROUP_GALLIUM} OPTIONS_DEFAULT+= ${_gd} ${_gd}_VARS+= GALLIUM_DRIVERS+=${_gd} . endfor .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" MESON_ARGS+= -Dvulkan-drivers="" \ -Dandroid-libbacktrace=disabled \ -Dgallium-va=disabled \ - -Dgallium-omx=disabled \ - -Dgallium-xa=disabled \ - -Dgallium-opencl=disabled \ - -Dgallium-nine=false \ -Dgbm=disabled \ -Dgles1=disabled \ -Dgles2=disabled \ -Dglvnd=disabled \ -Dlmsensors=disabled \ -Dmicrosoft-clc=disabled \ - -Dosmesa=false \ -Dvalgrind=disabled \ - -Dglx=disabled \ - -Ddri3=enabled + -Dglx=disabled LDFLAGS_i386= -Wl,-znotext MESON_ARGS+= -Dplatforms="x11" \ -Dgallium-vdpau=enabled .if ${ARCH} != amd64 MESON_ARGS+= -Dintel-rt=disabled # https://gitlab.freedesktop.org/mesa/mesa/-/issues/10629 .endif .for _gd in ${OPTIONS_GROUP_GALLIUM} . if defined(GALLIUM_DRIVERS) && ${GALLIUM_DRIVERS:M${_gd}} PLIST_SUB+= ${_gd}="" . else PLIST_SUB+= ${_gd}="@comment " . endif .endfor +post-install: +# Mesa 25: libgallium-${MESAVERSION}.so is owned by graphics/mesa-libs. + ${RM} -f ${STAGEDIR}${PREFIX}/lib/libgallium-${MESAVERSION}.so + ${RM} -f ${STAGEDIR}${PREFIX}/lib/dri/r300_dri.so + ${RM} -f ${STAGEDIR}${PREFIX}/lib/dri/r600_dri.so + ${RM} -f ${STAGEDIR}${PREFIX}/lib/dri/radeonsi_dri.so + .include diff --git a/graphics/mesa-gallium-xa/Makefile b/graphics/mesa-gallium-xa/Makefile index 3d09f7ab433a..eb8d0b1d8a46 100644 --- a/graphics/mesa-gallium-xa/Makefile +++ b/graphics/mesa-gallium-xa/Makefile @@ -1,51 +1,53 @@ PORTNAME= mesa-gallium-xa PORTVERSION= ${MESAVERSION} CATEGORIES= graphics COMMENT= Mesa Gallium XA state tracker WWW= https://www.mesa3d.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/docs/license.rst +BROKEN= gallium-xa was removed upstream in mesa 25.1 + ONLY_FOR_ARCHS= amd64 i386 ONLY_FOR_ARCHS_REASON= used only by VMware supported architectures USES= llvm:lib,noexport xorg USE_XORG= xorgproto .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" MESON_ARGS+= -Dgallium-drivers="svga" \ -Dvulkan-drivers="" \ -Dplatforms="" \ -Dandroid-libbacktrace=disabled \ -Dgallium-vdpau=disabled \ -Dgallium-omx=disabled \ -Dgallium-va=disabled \ -Dgallium-opencl=disabled \ -Dgallium-nine=false \ -Degl=disabled \ -Dgbm=disabled \ -Dgles1=disabled \ -Dgles2=disabled \ -Dglx=disabled \ -Dlmsensors=disabled \ -Dmicrosoft-clc=disabled \ -Dopengl=false \ -Dshared-glapi=disabled \ -Dosmesa=false \ -Dvalgrind=disabled \ -Dglvnd=disabled \ -Dxlib-lease=disabled LDFLAGS_i386= -Wl,-znotext MESON_ARGS+= -Dgallium-xa=enabled .if ${ARCH} != amd64 MESON_ARGS+= -Dintel-rt=disabled # https://gitlab.freedesktop.org/mesa/mesa/-/issues/10629 .endif .include diff --git a/graphics/mesa-libs/Makefile b/graphics/mesa-libs/Makefile index 7ffe5201b2a5..d653b3b01348 100644 --- a/graphics/mesa-libs/Makefile +++ b/graphics/mesa-libs/Makefile @@ -1,84 +1,103 @@ PORTNAME= mesa-libs PORTVERSION= ${MESAVERSION} -PORTREVISION= 1 CATEGORIES= graphics COMMENT= OpenGL libraries that support GLX and EGL clients WWW= https://www.mesa3d.org/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/docs/license.rst USES= llvm:noexport -BUILD_DEPENDS= libglvnd>=0:graphics/libglvnd +BUILD_DEPENDS= libglvnd>=0:graphics/libglvnd \ + ${PYTHON_PKGNAMEPREFIX}ply>0:devel/py-ply@${PY_FLAVOR} \ + libclc-${LLVM_PORT:T}>0:devel/libclc@${LLVM_PORT:T} \ + spirv-tools>0:graphics/spirv-tools \ + spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} +RUN_DEPENDS= spirv-tools>0:graphics/spirv-tools \ + spirv-llvm-translator-${LLVM_PORT:T}>0:devel/spirv-llvm-translator@${LLVM_PORT:T} + +CONFIGURE_ENV+= PKG_CONFIG_PATH="${LLVM_PREFIX}/libdata/pkgconfig" OPTIONS_GROUP= PLATFORM OPTIONS_GROUP_PLATFORM= X11 WAYLAND X11_DESC= Enable X11 support for GBM/EGL WAYLAND_DESC= Enable Wayland support for GBM/EGL WAYLAND_BUILD_DEPENDS= wayland-protocols>=1.8:graphics/wayland-protocols WAYLAND_LIB_DEPENDS= libwayland-server.so:graphics/wayland OPTIONS_DEFINE= ZSTD OPTIONS_DEFAULT= WAYLAND X11 ZSTD OPTIONS_SUB= yes ZSTD_DESC= Use ZSTD for shader cache ZSTD_LIB_DEPENDS= libzstd.so:archivers/zstd ZSTD_MESON_ENABLED= zstd USE_LDCONFIG= yes .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" +LDFLAGS_i386= -Wl,-znotext + +# mesa-libs is the home of libgallium-${MESAVERSION}.so (the unified gallium +# runtime introduced in mesa 25's "megalib" refactor). It must be built with +# a real gallium driver set so install_megadrivers actually ships the lib; +# the per-driver lib/dri/*_dri.so shims that fall out of this build are +# stripped in post-install (they belong to graphics/mesa-dri). +GALLIUM_DRIVERS= crocus i915 iris llvmpipe panfrost r300 r600 radeonsi svga zink +.if ${ARCH} != amd64 && ${ARCH} != i386 && ${ARCH} != x86_64 +GALLIUM_DRIVERS:= ${GALLIUM_DRIVERS:Ncrocus:Ni915:Niris:Nsvga} +.endif +.if ${ARCH} == armv7 +GALLIUM_DRIVERS= llvmpipe +.endif + +MESON_ARGS+= -Dgallium-drivers=${GALLIUM_DRIVERS:ts,} +MESON_ARGS+= -Dvulkan-drivers="" + MESON_ARGS+= -Dandroid-libbacktrace=disabled \ -Dgallium-vdpau=disabled \ - -Dgallium-omx=disabled \ -Dgallium-va=disabled \ - -Dgallium-xa=disabled \ - -Dgallium-nine=false \ -Dlmsensors=disabled \ -Dmicrosoft-clc=disabled \ - -Dosmesa=false \ -Dtools="" \ - -Dvalgrind=disabled \ - -Degl=enabled \ - -Dgbm=enabled \ - -Dvulkan-drivers="" \ - -Dglvnd=enabled -# Building EGL and GBM requires a driver so add r300 -MESON_ARGS+= -Dgallium-drivers="r300" + -Dvalgrind=disabled .if ${PORT_OPTIONS:MX11} MESA_PLATFORMS+= x11 USE_XORG+= xorgproto x11 xcb xdamage xext \ xfixes xshmfence xxf86vm xrandr PLIST_SUB+= GLX="" .else MESON_ARGS+= -Dglx=disabled -Dxlib-lease=disabled PLIST_SUB+= GLX="@comment " .endif .if ${PORT_OPTIONS:MWAYLAND} MESA_PLATFORMS+= wayland .endif MESON_ARGS+= -Dplatforms="${MESA_PLATFORMS:ts,:tl}" .if ${ARCH} != amd64 MESON_ARGS+= -Dintel-rt=disabled # https://gitlab.freedesktop.org/mesa/mesa/-/issues/10629 .endif .if ${ARCH} == "i386" # PR230239 Fix the build for i386 when WITH_LLD_IS_LD is set LDFLAGS+=-Wl,-z,notext .endif +PLIST_SUB+= MESAVERSION=${MESAVERSION} + post-install: # Fallback if GLX_EXT_libglvnd is missing or vendor library doesn't exist @${ECHO_CMD} "libGLX_indirect.so.0 libGLX_mesa.so.0" \ >${STAGEDIR}${PREFIX}/etc/libmap.d/mesa.conf +# Strip the per-hardware DRI shims; they are owned by graphics/mesa-dri. + ${RM} -rf ${STAGEDIR}${PREFIX}/lib/dri .include diff --git a/graphics/mesa-libs/pkg-plist b/graphics/mesa-libs/pkg-plist index 9d92766c8f37..de7084ae45a6 100644 --- a/graphics/mesa-libs/pkg-plist +++ b/graphics/mesa-libs/pkg-plist @@ -1,23 +1,21 @@ etc/libmap.d/mesa.conf include/EGL/eglext_angle.h include/EGL/eglmesaext.h -@comment include/GL/internal/dri_interface.h +include/GL/internal/dri_interface.h include/gbm.h -@comment lib/dri/radeon_dri.so -@comment lib/dri/r300_dri.so +include/gbm_backend_abi.h +lib/gbm/dri_gbm.so lib/libEGL_mesa.so lib/libEGL_mesa.so.0 lib/libEGL_mesa.so.0.0.0 %%GLX%%lib/libGLX_mesa.so %%GLX%%lib/libGLX_mesa.so.0 %%GLX%%lib/libGLX_mesa.so.0.0.0 +lib/libgallium-%%MESAVERSION%%.so lib/libgbm.so lib/libgbm.so.1 lib/libgbm.so.1.0.0 -lib/libglapi.so -lib/libglapi.so.0 -lib/libglapi.so.0.0.0 -@comment libdata/pkgconfig/dri.pc +libdata/pkgconfig/dri.pc libdata/pkgconfig/gbm.pc @comment share/drirc.d/00-mesa-defaults.conf share/glvnd/egl_vendor.d/50_mesa.json