Index: head/graphics/libosmesa/Makefile =================================================================== --- head/graphics/libosmesa/Makefile (revision 539357) +++ head/graphics/libosmesa/Makefile (revision 539358) @@ -1,51 +1,52 @@ # Created by: gahr # $FreeBSD$ PORTNAME= libosmesa PORTVERSION= ${MESAVERSION} +PORTREVISION= 1 CATEGORIES= graphics COMMENT= Off-Screen Mesa implementation of the OpenGL API USES= xorg USE_XORG= xorgproto .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" # Disable some options MESON_ARGS+= -Ddri-drivers="" \ -Dgallium-drivers=swrast \ -Dvulkan-drivers="" \ -Dplatforms="" \ -Dgallium-vdpau=false \ -Dgallium-omx=disabled \ -Dgallium-va=false \ -Dgallium-opencl=disabled \ -Dgallium-xa=false \ -Dgallium-xvmc=false \ -Dgallium-nine=false \ -Dgles1=false \ -Dgles2=false \ -Dopengl=false \ -Dglx=disabled \ -Degl=false \ -Dgbm=false \ -Dtools="" LDFLAGS_i386= -Wl,-znotext .if ${ARCH} == sparc64 MESON_ARGS+= -Dosmesa=classic .else MESON_ARGS+= -Dosmesa=gallium .endif .include "${MASTERDIR}/Makefile.targets" post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/include/GL ${INSTALL_DATA} ${WRKSRC}/include/GL/osmesa.h \ ${STAGEDIR}${PREFIX}/include/GL .include Index: head/graphics/libxatracker/Makefile =================================================================== --- head/graphics/libxatracker/Makefile (revision 539357) +++ head/graphics/libxatracker/Makefile (revision 539358) @@ -1,43 +1,43 @@ # Created by: johalun # $FreeBSD$ PORTNAME= libxatracker PORTVERSION= ${MESAVERSION} -PORTREVISION= 3 +PORTREVISION= 4 CATEGORIES= graphics COMMENT= Mesa XA state tracker USES= xorg USE_XORG= xorgproto .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" ONLY_FOR_ARCHS= i386 amd64 ONLY_FOR_ARCHS_REASON= Used only by VMWare supported architectures MESON_ARGS+= -Ddri-drivers="" \ -Dgallium-drivers="svga" \ -Dvulkan-drivers="" \ -Dgallium-vdpau=false \ -Dgallium-omx=disabled \ -Dgallium-va=false \ -Dgallium-opencl=disabled \ -Dgallium-xvmc=false \ -Dgallium-nine=false \ -Degl=false \ -Dgbm=false \ -Dgles2=false \ -Dglx=disabled \ -Dopengl=false \ -Dshared-glapi=false \ -Dosmesa=none \ -Dplatforms= LDFLAGS_i386= -Wl,-znotext MESA_ARGS+= -Dgallium-xa=true .include "${MASTERDIR}/Makefile.targets" .include Index: head/graphics/mesa-dri/Makefile =================================================================== --- head/graphics/mesa-dri/Makefile (revision 539357) +++ head/graphics/mesa-dri/Makefile (revision 539358) @@ -1,134 +1,134 @@ # Created by: Eric Anholt # $FreeBSD$ PORTNAME= mesa-dri PORTVERSION= ${MESAVERSION} -PORTREVISION= 6 +PORTREVISION= 7 CATEGORIES= graphics COMMENT= OpenGL hardware acceleration drivers for DRI2+ USES= xorg USE_XORG= xorgproto x11 xdamage xext xfixes xshmfence 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 PLATFORM_X11 PLATFORM_WAYLAND PLATFORM_DRM PLATFORM_SURFACELESS OPTIONS_SUB= yes VAAPI_MESON_ON= -Dgallium-va=true VAAPI_LIB_DEPENDS= libva.so:multimedia/libva VAAPI_USE= XORG=xcb VDPAU_MESON_ON= -Dgallium-vdpau=true 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 .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" ALL_DRI_DRIVERS= I915 I965 R100 R200 SWRAST ALL_GALLIUM_DRIVERS= R300 R600 RADEONSI SVGA SWRAST ALL_VULKAN_DRIVERS= INTEL AMD .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH:Marm*} || ${ARCH} == i386 || ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} DRI_DRIVERS= SWRAST # llvmpipe .endif .if ${ARCH} == aarch64 || ${ARCH} == amd64 || ${ARCH} == i386 \ || ${ARCH} == powerpc || ${ARCH} == powerpc64 DRI_DRIVERS+= R100 R200 GALLIUM_DRIVERS+= R300 R600 RADEONSI VULKAN_DRIVERS+= AMD . if ${PORT_OPTIONS:MPLATFORM_X11} USE_XORG+= xv xvmc MESON_ARGS+= -Dgallium-xvmc=true . endif .endif .if ${ARCH} == amd64 || ${ARCH} == i386 DRI_DRIVERS+= I915 I965 GALLIUM_DRIVERS+= SVGA . if ${OPSYS} == FreeBSD EXTRA_PATCHES+= ${PATCHDIR}/extra-src_mesa_drivers_dri_i965_intel__screen.c . endif VULKAN_DRIVERS+= INTEL .endif .if defined(VULKAN_DRIVERS) USE_XORG+= xcb xrandr .endif LDFLAGS_i386= -Wl,-znotext .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} MESA_PLATFORMS+= wayland .endif MESON_ARGS+= -Ddri-drivers="${DRI_DRIVERS:ts,:tl}" \ -Dgallium-drivers="${GALLIUM_DRIVERS:ts,:tl}" \ -Dvulkan-drivers="${VULKAN_DRIVERS:ts,:tl}" \ -Dplatforms="${MESA_PLATFORMS:ts,:tl}" # Disable some options MESON_ARGS+= -Dgallium-xa=false \ -Dgles1=false \ -Dgles2=false \ -Dglx=disabled \ -Degl=false \ -Dosmesa=none \ -Dtools="" .for _d in ${ALL_DRI_DRIVERS} . if defined(DRI_DRIVERS) && ${DRI_DRIVERS:M${_d}} PLIST_SUB+= ${_d}_DRIVER="" . else PLIST_SUB+= ${_d}_DRIVER="@comment " . endif .endfor .for _gd in ${ALL_GALLIUM_DRIVERS} . if defined(GALLIUM_DRIVERS) && ${GALLIUM_DRIVERS:M${_gd}} PLIST_SUB+= ${_gd}_GDRIVER="" . else PLIST_SUB+= ${_gd}_GDRIVER="@comment " . endif .endfor PLIST_SUB += ARCH=${ARCH:S/amd/x86_/} .for _vd in ${ALL_VULKAN_DRIVERS} . if defined(VULKAN_DRIVERS) && ${VULKAN_DRIVERS:M${_vd}} PLIST_SUB+= ${_vd}_VDRIVER="" . else PLIST_SUB+= ${_vd}_VDRIVER="@comment " . endif .endfor .include "${MASTERDIR}/Makefile.targets" post-install: @${RM} -r ${STAGEDIR}/etc/OpenCL .include Index: head/graphics/mesa-dri/Makefile.targets =================================================================== --- head/graphics/mesa-dri/Makefile.targets (revision 539357) +++ head/graphics/mesa-dri/Makefile.targets (revision 539358) @@ -1,12 +1,13 @@ # $FreeBSD$ # # this file holds common targets pre-configure: ${PRINTF} "[binaries]\nllvm-config = '${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT}'" \ > ${WRKSRC}/llvm.ini post-patch: - @${REINPLACE_CMD} -e 's|/etc/|${PREFIX}/etc/|g' \ + ${REINPLACE_CMD} -e '/SYSCONFDIR/ s|/etc|${PREFIX}/etc|g' \ + -e '/DATADIR/ s|/usr/share|${PREFIX}/share|g' \ ${WRKSRC}/src/util/xmlconfig.c Index: head/graphics/mesa-dri/files/patch-meson.build =================================================================== --- head/graphics/mesa-dri/files/patch-meson.build (revision 539357) +++ head/graphics/mesa-dri/files/patch-meson.build (revision 539358) @@ -1,35 +1,64 @@ - Do not define GLX_USE_TLS, this doesn't work on all FreeBSD version Later mesa version rename this to USE_ELF_TLS and make it conditional on some platform, but for now simply comment it here. See https://github.com/dumbbell/test-tls-initial-exec for more info - Add dependency on libxv for xvmc, this is fixed in later mesa version. ---- meson.build.orig 2020-06-05 18:23:59 UTC +- Define _GNU_SOURCE on FreeBSD, adapted from + https://gitlab.freedesktop.org/mesa/mesa/commit/b4f508ab5990 +- sys/sysctl.h needs sys/types.h to be properly detected, adapted from + https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5462/diffs +--- meson.build.orig 2020-06-14 07:52:34 UTC +++ meson.build @@ -25,7 +25,7 @@ project( [find_program('python', 'python2', 'python3'), 'bin/meson_get_version.py'] ).stdout(), license : 'MIT', - meson_version : '>= 0.45', + meson_version : '>= 0.46', default_options : ['buildtype=debugoptimized', 'b_ndebug=if-release', 'c_std=c99', 'cpp_std=c++11'] ) @@ -336,7 +336,7 @@ if with_egl and not (with_platform_drm or with_platfor endif endif -pre_args += '-DGLX_USE_TLS' +#pre_args += '-DGLX_USE_TLS' if with_glx != 'disabled' if not (with_platform_x11 and with_any_opengl) error('Cannot build GLX support without X11 platform support and at least one OpenGL API') @@ -458,7 +458,8 @@ dep_xvmc = null_dep with_gallium_xvmc = false if _xvmc != 'false' dep_xvmc = dependency('xvmc', version : '>= 1.0.6', required : _xvmc == 'true') - with_gallium_xvmc = dep_xvmc.found() + dep_xv = dependency('xv', required: _xvmc == 'true') + with_gallium_xvmc = dep_xvmc.found() and dep_xv.found() endif xvmc_drivers_path = get_option('xvmc-libs-path') +@@ -792,7 +793,7 @@ if cc.compiles('int foo(void) __attribute__((__noretur + endif + + # TODO: this is very incomplete +-if ['linux', 'cygwin', 'gnu'].contains(host_machine.system()) ++if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd'].contains(host_machine.system()) + pre_args += '-D_GNU_SOURCE' + endif + +@@ -977,7 +978,14 @@ elif cc.has_header_symbol('sys/mkdev.h', 'major') + pre_args += '-DMAJOR_IN_MKDEV' + endif + +-foreach h : ['xlocale.h', 'sys/sysctl.h', 'linux/futex.h', 'endian.h', 'dlfcn.h'] ++if not ['linux'].contains(host_machine.system()) ++ # Deprecated on Linux and requires on FreeBSD and OpenBSD ++ if cc.check_header('sys/sysctl.h', prefix : '#include ') ++ pre_args += '-DHAVE_SYS_SYSCTL_H' ++ endif ++endif ++ ++foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h'] + if cc.compiles('#include <@0@>'.format(h), name : '@0@'.format(h)) + pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify()) + endif Index: head/graphics/mesa-libs/Makefile =================================================================== --- head/graphics/mesa-libs/Makefile (revision 539357) +++ head/graphics/mesa-libs/Makefile (revision 539358) @@ -1,80 +1,80 @@ # Created by: Eric Anholt # $FreeBSD$ PORTNAME= mesa-libs PORTVERSION= ${MESAVERSION} -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics COMMENT= OpenGL libraries that support GLX and EGL clients CONFLICTS_INSTALL= libglvnd # include/GL/gl.h 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 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 .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" MESON_ARGS+= -Dgallium-drivers="" \ -Dgallium-vdpau=false \ -Dgallium-xvmc=false \ -Dgallium-omx=disabled \ -Dgallium-va=false \ -Dgallium-xa=false \ -Dgallium-nine=false \ -Dgallium-clover=disabled \ -Dosmesa=none \ -Dtools="" \ -Degl=true \ -Dgbm=true \ -Dvulkan-drivers="" # Building EGL and GBM requires a dri driver so add swrast MESON_ARGS+= -Ddri-drivers="swrast" .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 .elif ${ARCH} == "powerpc" USE_GCC= yes .endif .include "${MASTERDIR}/Makefile.targets" .include Index: head/lang/clover/Makefile =================================================================== --- head/lang/clover/Makefile (revision 539357) +++ head/lang/clover/Makefile (revision 539358) @@ -1,52 +1,53 @@ # $FreeBSD$ PORTNAME= clover PORTVERSION= ${MESAVERSION} +PORTREVISION= 1 CATEGORIES= lang COMMENT= Mesa OpenCL implementation for AMD GPUs BUILD_DEPENDS= libclc>=0.3.0:devel/libclc \ opencl>=0:devel/opencl LIB_DEPENDS= libOpenCL.so:devel/ocl-icd RUN_DEPENDS= libclc>=0.3.0:devel/libclc \ opencl>=0:devel/opencl ONLY_FOR_ARCHS= i386 amd64 ONLY_FOR_ARCHS_REASON= Clover needs a GPU supported by the Radeon KMS driver .include .include "${.CURDIR:H:H}/graphics/mesa-dri/Makefile.common" MESON_ARGS+= -Ddri-drivers="" \ -Dgallium-drivers=r600,radeonsi \ -Dvulkan-drivers="" \ -Dplatforms="" \ -Dgallium-vdpau=false \ -Dgallium-omx=disabled \ -Dgallium-va=false \ -Dgallium-opencl=disabled \ -Dgallium-xa=false \ -Dgallium-xvmc=false \ -Dgallium-nine=false \ -Dgles1=false \ -Dgles2=false \ -Dopengl=false \ -Dglx=disabled \ -Degl=false \ -Dgbm=false \ -Dgallium-opencl=icd \ -Dtools="" LDFLAGS_i386= -Wl,-znotext .include "${MASTERDIR}/Makefile.targets" pre-patch: @if [ -e ${LOCALBASE}/bin/llvm-config${LLVM_DEFAULT} ] && \ ! [ -e ${LOCALBASE}/bin/clang${LLVM_DEFAULT} ]; then \ ${ECHO_MSG} "Your llvm${LLVM_DEFAULT} is not built with clang support, which is required."; \ ${FALSE}; \ fi .include