head	1.9;
access;
symbols;
locks; strict;
comment	@# @;


1.9
date	2026.11.30.09.08.27;	author wiz;	state Exp;
branches;
next	1.8;
commitid	uerpYkcG24mjRs5H;

1.8
date	2026.11.28.22.07.06;	author wiz;	state Exp;
branches;
next	1.7;
commitid	PnW0zbXbwcsPeh5H;

1.7
date	2026.11.28.09.09.02;	author wiz;	state Exp;
branches;
next	1.6;
commitid	Znm8P7u8NzCGVc5H;

1.6
date	2026.11.27.20.18.09;	author wiz;	state Exp;
branches;
next	1.5;
commitid	Spyb5fvj3hmjF85H;

1.5
date	2026.11.27.08.28.12;	author wiz;	state Exp;
branches;
next	1.4;
commitid	x5aGdlctq3ILJ45H;

1.4
date	2026.11.27.08.19.08;	author wiz;	state Exp;
branches;
next	1.3;
commitid	eLY3l116eVtKG45H;

1.3
date	2026.11.25.14.48.25;	author wiz;	state Exp;
branches;
next	1.2;
commitid	uA4cPQiXd5eiUQ4H;

1.2
date	2026.11.25.13.46.46;	author wiz;	state Exp;
branches;
next	1.1;
commitid	ZRAzfINTwaT9zQ4H;

1.1
date	2026.11.23.10.29.51;	author adam;	state Exp;
branches;
next	;
commitid	iRvtCaPzqXxxxz4H;


desc
@@


1.9
log
@mesa: carry over atexit() patches from MesaLib, simplified

Fixes coredumps on exit.

Reported upstream, let's see what happens.

XXX: there are a couple more atexit() locations remaining that might
need patching as well.

Bump PKGREVISION.
@
text
@# $NetBSD: Makefile,v 1.8 2026/11/28 22:07:06 wiz Exp $
#
# needs recursive bumps for _every_ update due to
# lib/libgallium-${PKGVERSION}.so

DISTNAME=	mesa-26.3.1
PKGREVISION=	1
CATEGORIES=	graphics
MASTER_SITES=	https://mesa.freedesktop.org/archive/
MASTER_SITES+=	https://mesa3d.org/archive/
EXTRACT_SUFX=	.tar.xz

MAINTAINER=	pkgsrc-users@@NetBSD.org
HOMEPAGE=	https://www.mesa3d.org/
COMMENT=	Open source OpenGL implementation
LICENSE=	mit

USE_FEATURES+=	strnlen
USE_LANGUAGES=	c c++
USE_TOOLS+=	bison flex pkg-config xgettext
FORCE_CXX_STD+=	gnu++17 # mixed designated initializers

USE_CC_FEATURES=	c23

CFLAGS.SunOS+=		-D_POSIX_PTHREAD_SEMANTICS
CXXFLAGS.SunOS+=	-Drestrict=__restrict__
LDFLAGS.SunOS+=		-lsocket -lnsl

# Some of these get appended in options.mk.
#DRI_DRIVERS=		#
GALLIUM_DRIVERS=	softpipe
VULKAN_DRIVERS=		#
MESA_PLATFORMS=		#

CONFLICTS+=	MesaLib-[0-9]*

.include "../../mk/compiler.mk"
.include "features.mk"
.include "options.mk"

PLIST_SUBST+=	GLVER="1.2.0"
PLIST_SUBST+=	MACHINE_ARCH=${MACHINE_ARCH}

# classic DRI drivers
#PLIST_VARS+=	i830 i915 i965 r100 r200 nouveau_dri

# Gallium drivers
PLIST_VARS+=	r300 svga nouveau

# other features
PLIST_VARS+=	arm kms vaapi

.if ${MESALIB_SUPPORTS_DRI} == "yes"
BUILDLINK_API_DEPENDS.libdrm+=	libdrm>=2.4.100
.include "../../x11/libdrm/buildlink3.mk"
.  if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
.    include "../../sysutils/libpciaccess/buildlink3.mk"
.  endif
MESON_ARGS+=		-Degl=enabled
MESON_ARGS+=		-Dgbm=enabled
.  if ${X11_TYPE} == "native" && !exists(${X11BASE}/include/xcb/dri3.h)
MESON_ARGS+=		-Ddri3=false
.  endif
PLIST.kms=		yes
.  if ${MACHINE_ARCH:M*arm*} || \
      ${MACHINE_CPU} == "aarch64"
#GALLIUM_DRIVERS+=	freedreno vc4 v3d etnaviv tegra panfrost lima
GALLIUM_DRIVERS+=	panfrost lima
PLIST.arm=		yes
.  endif
.  if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
GALLIUM_DRIVERS+=	svga
#DRI_DRIVERS+=		i915 i965
PLIST.svga=		yes
#PLIST.i830=		yes
#PLIST.i915=		yes
#PLIST.i965=		yes
.  endif
# FreeBSD lacks nouveau support (there are official binaries from Nvidia)
.  if ${OPSYS} != "FreeBSD"
.    if !${MACHINE_PLATFORM:MNetBSD-*-powerpc}
# nouveau not available on this platform
PLIST.nouveau=		yes
#PLIST.nouveau_dri=	yes
GALLIUM_DRIVERS+=	nouveau
#DRI_DRIVERS+=		nouveau
.    endif
.  endif
.  if ${MACHINE_PLATFORM:MLinux-*-x86_64}
# qemu Linux guest driver
# XXX test this
#GALLIUM_DRIVERS+=	virgl
#PLIST.virgl=		yes
.  endif
# theoretically cross platform PCI drivers
.  if !${MACHINE_PLATFORM:MNetBSD-*-*arm*} && \
      !${MACHINE_PLATFORM:MNetBSD-*-mipsel}
#DRI_DRIVERS+=		r100 r200
GALLIUM_DRIVERS+=	r300
#PLIST.r100=		yes
#PLIST.r200=		yes
PLIST.r300=		yes
.  endif
.  include "../../multimedia/libva/available.mk"
.  if ${VAAPI_AVAILABLE} == "yes" && \
      !(empty(GALLIUM_DRIVERS:Mr600) && empty(GALLIUM_DRIVERS:Mradeonsi) && \
        empty(GALLIUM_DRIVERS:Mnouveau))
MESON_ARGS+=		-Dgallium-va=enabled
PLIST.vaapi=		yes
BUILDLINK_API_DEPENDS.libva+=	libva>=2.13.0
.    include "../../multimedia/libva/buildlink3.mk"
.  else
MESON_ARGS+=		-Dgallium-va=disabled
.  endif
.else
MESON_ARGS+=		-Degl=false
MESON_ARGS+=		-Dgbm=false
.endif # ${MESALIB_SUPPORTS_DRI} == "yes"

MESON_ARGS+=	-Dgallium-drivers=${GALLIUM_DRIVERS:ts,}
#MESON_ARGS+=	-Ddri-drivers=${DRI_DRIVERS:ts,}
MESON_ARGS+=	-Dvulkan-drivers=${VULKAN_DRIVERS:ts,}
MESON_ARGS+=	-Dplatforms=${MESA_PLATFORMS:ts,}

.if ${MACHINE_ARCH} == "i386"
MESON_ARGS+=	-Dglx-read-only-text=true
CXXFLAGS+=	-march=i586
.endif

MESON_ARGS+=	-Dgles1=enabled
MESON_ARGS+=	-Dgles2=enabled
MESON_ARGS+=	-Dopengl=true

CPPFLAGS+=	-DHAVE_NOATEXIT
CPPFLAGS+=	-DSYSCONFDIR=${PKG_SYSCONFDIR}

TOOL_DEPENDS+=	${PYPKGPREFIX}-mako-[0-9]*:../../devel/py-mako
TOOL_DEPENDS+=	${PYPKGPREFIX}-packaging-[0-9]*:../../devel/py-packaging
TOOL_DEPENDS+=	${PYPKGPREFIX}-yaml>=3.0.0:../../textproc/py-yaml

BUILDLINK_TRANSFORM+=		rm:-Werror=incompatible-pointer-types

# https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1854
BUILDLINK_TRANSFORM+=		rm:-Werror=return-type

# ../src/intel/perf/gen_perf.c:426:7: error: %m is only allowed in syslog(3) like functions
BUILDLINK_TRANSFORM+=		rm:-Werror=format
BUILDLINK_TRANSFORM+=		rm:-Wformat-security

# https://gitlab.freedesktop.org/mesa/mesa/merge_requests/1853
BUILDLINK_TRANSFORM.SunOS+=	rm:-Wl,--build-id=sha1

# Work around Xorg segfaulting in radeon driver due to wrong alloca being used
CFLAGS.NetBSD+=		-Dalloca=__builtin_alloca
CXXFLAGS.NetBSD+=	-Dalloca=__builtin_alloca

EGDIR=		${PREFIX}/share/examples/mesa

CONF_FILES+=	${EGDIR}/00-mesa-defaults.conf ${PKG_SYSCONFDIR}/drirc

INSTALLATION_DIRS+=	${EGDIR}

PYTHON_FOR_BUILD_ONLY=		tool

PKGCONFIG_OVERRIDE_STAGE=	pre-install
PKGCONFIG_OVERRIDE+=		output/meson-private/glesv1_cm.pc
PKGCONFIG_OVERRIDE+=		output/meson-private/glesv2.pc
PKGCONFIG_OVERRIDE+=		output/meson-private/dri.pc
PKGCONFIG_OVERRIDE+=		output/meson-private/gbm.pc
PKGCONFIG_OVERRIDE+=		output/meson-private/egl.pc
PKGCONFIG_OVERRIDE+=		output/meson-private/gl.pc
PKGCONFIG_OVERRIDE+=		output/meson-private/glx.pc

post-install:
	${MV} ${DESTDIR}${PREFIX}/share/drirc.d/00-mesa-defaults.conf ${DESTDIR}${EGDIR}
.if ${OPSYS} == "Darwin"
#	install_name_tool -id ${PREFIX}/lib/dri/swrast_dri.so \
#	    ${DESTDIR}${PREFIX}/lib/dri/swrast_dri.so
	install_name_tool -change @@rpath/libgallium-${PKGVERSION_NOREV}.dylib ${PREFIX}/lib/libgallium-${PKGVERSION_NOREV}.dylib ${DESTDIR}${PREFIX}/lib/libGL.1.dylib
.endif

.include "../../devel/meson/build.mk"
.include "../../devel/zlib/buildlink3.mk"
.include "../../lang/python/batteries-included.mk"
.include "../../lang/python/tool.mk"
.include "../../textproc/expat/buildlink3.mk"
.include "../../mk/atomic64.mk"
.include "../../mk/bsd.pkg.mk"
@


1.8
log
@mesa: update to 26.3.1.

Mesa 26.3.1 Release Notes / 2026-11-18
======================================

Mesa 26.3.1 is a bug fix release which fixes bugs found since the 26.3.0 release.

Mesa 26.3.1 implements the OpenGL 4.6 API, but the version reported by
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
Some drivers don't support all the features required in OpenGL 4.6. OpenGL
4.6 is **only** available if requested at context creation.
Compatibility contexts may report a lower version depending on each driver.

Mesa 26.3.1 implements the OpenCL 3.1 API, but the version reported by
the CL_DEVICE_VERSION, CL_DEVICE_NUMERIC_VERSION and CL_DEVICE_OPENCL_C_ALL_VERSIONS
clGetDeviceInfo queries depends on the particular driver being used.

Mesa 26.3.1 implements the Vulkan 1.4 API, but the version reported by
the apiVersion property of the VkPhysicalDeviceProperties struct
depends on the particular driver being used.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.7 2026/11/28 09:09:02 wiz Exp $
d7 1
@


1.7
log
@mesa: fix black windows in vnc servers on NetBSD

The XSHM detection logic didn't match what the server did, so it
believed to have SHM support when it didn't.

Bump PKGREVISION.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.6 2026/11/27 20:18:09 wiz Exp $
d6 1
a6 2
DISTNAME=	mesa-26.2.8
PKGREVISION=	2
@


1.6
log
@mesa: turn on vulkan option by default

Add note that this will need recursive bumps for every update due to
lib/libgallium-${PKGVERSION}.so

Bump PKGREVISION.
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.5 2026/11/27 08:28:12 wiz Exp $
d7 1
a7 1
PKGREVISION=	1
@


1.5
log
@mesa: update to 26.2.8.

Bug fixes
---------

- Alien Isolation hitting assert during launch
- Confidential issue #16796
- Confidential issue #16947
- Crash accessing ignored array in Vulkan PSO create with dynamic state
- OpenGL glitch and low performance in Tux racer(2000)
- RADV:  GPU hang when mixing compute shader_object with ray tracing pipeline
- Windows: u_memstream leaks MEM*.tmp files on SPIR-V shader compilation, stalling Lavapipe
- [ANV]Payday 2 crashes on Intel B580
- [NIR/RADV] nir_opt_offsets: try_fold_shared2 assertion \`st64 || normal` for a wrapping constant shared address (pipeline creation abort since 25.3)
- [d3d12] broken graphics in Space Station 14
- [d3d12][WSLg] d3d12_fence_finish() null pointer dereference
- aco/gfx12: VOPD pairs RAW-dependent v_lshlrev_b32 + v_fmac_f32 after pack_32_2x16_split(0, a) rewrite (RADV, R9700, llama.cpp bf16 flash attention wrong results)
- anv: CTS failures with dynamic rendering suspend/resume
- anv: GPU hangs on Gfx9 (Comet Lake) with ffmpeg Vulkan filters since 25.3
- anv: fast-linked graphics pipeline libraries read per-primitive fragment inputs one location late after an odd number of unread mesh per-primitive outputs
- d3d12: NULL dereference in select_shader_variant() when compile_nir() fails
- d3d12: glClearTexImage through a texture view of another format flushes float32-denormal bit patterns to zero
- dozen: Driver should fail to enumate anything if requirements are not met
- dzn: Invalid minImageTransferGranularity specified on graphics/compute queue families
- dzn: Unaligned block-compressed textures are silently unsupported
- dzn: WSL2 Civ7 instability: OODM in descriptor heap growth and downstream crash behavior
- dzn: external memory buffers cannot be host mapped
- dzn: maxStorageBufferRange reports 128 MiB, but raw storage buffer views allow 512 MiB
- dzn: minImportedHostPointerAlignment is stricter than minimum host page size
- dzn: use different bit pattern in device addresses
- dzn: vkBindBufferMemory fails on memory imported from a host pointer
- hasvk: vkCmdWaitEvents2 is broken
- iris: WebGPU video pipeline flickers (intermittent black frames) on Intel GPUs - missed GPU synchronization
- iris: ext_external_objects-vk-ping-pong -multi-sem fails
- llvmpipe fails on null instances in an acceleration structure
- nir_to_dxil has store_def and store_ssa_def and they're subtly different
- nouveau: pushbuf_dump() segfaults after ENODEV with one push and zero buffer references
- pipe-loader: pipe_loader_drm_probe_internal() closes probed render-node fd twice, clobbering other threads' fds via Rusticl ICD start-up (radeonsi, RX 9070 XT)
- radeonsi/EGL Wayland: presenting a window surface taller than the GPU's max surface dimension intermittently SIGSEGVs in \`dri2_query_image` (via \`create_wl_buffer` / \`dri2_wl_swap_buffers_with_damage`) instead of failing — RX 9070 XT (gfx1201)
- radeonsi: NULL pipe_memory_object dereference in si_resource_from_memobj()
- radv/aco: fast-linked GPL pipeline breaks fragment shader interlock on GFX11 (no s_waitcnt_vscnt before the jump to the PSepilog)
- radv: SIGSEGV in the hang-dump path with RADV_DEBUG=hang (null deref at 0x1a8) — no radv_dumps written
- vkCmdDrawIndexed read access violation in Dozen (in dzn_descriptor_heap_copy)
@
text
@d1 4
a4 1
# $NetBSD: Makefile,v 1.4 2026/11/27 08:19:08 wiz Exp $
d7 1
@


1.4
log
@mesa: uses c23 features

See also https://gitlab.freedesktop.org/mesa/mesa/-/work_items/15873
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.3 2026/11/25 14:48:25 wiz Exp $
d3 1
a3 1
DISTNAME=	mesa-26.2.7
@


1.3
log
@mesa, MesaLib: add CONFLICTS with each other
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.2 2026/11/25 13:46:46 wiz Exp $
d19 2
@


1.2
log
@mesa: comment out some unused variables, fix some pkglint
@
text
@d1 1
a1 1
# $NetBSD: Makefile,v 1.1 2026/11/23 10:29:51 adam Exp $
d29 2
@


1.1
log
@mesa: added version 26.2.7

The Mesa project began as an open-source implementation of the OpenGL
specification - a system for rendering interactive 3D graphics.

Over the years the project has grown to implement more graphics APIs,
including OpenGL ES (versions 1, 2, 3), OpenCL, OpenMAX, VDPAU, VA API,
XvMC and Vulkan.

A variety of device drivers allows the Mesa libraries to be used in many
different environments ranging from software emulation to complete hardware
acceleration for modern GPUs.
@
text
@d1 1
a1 1
# $NetBSD$
d24 1
a24 1
DRI_DRIVERS=		#
d37 1
a37 1
PLIST_VARS+=	i830 i915 i965 r100 r200 nouveau_dri
d65 1
a65 1
DRI_DRIVERS+=		i915 i965
d67 3
a69 3
PLIST.i830=		yes
PLIST.i915=		yes
PLIST.i965=		yes
d76 1
a76 1
PLIST.nouveau_dri=	yes
d78 1
a78 1
DRI_DRIVERS+=		nouveau
d90 1
a90 1
DRI_DRIVERS+=		r100 r200
d92 2
a93 2
PLIST.r100=		yes
PLIST.r200=		yes
@

