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


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.52;	author adam;	state Exp;
branches;
next	;
commitid	iRvtCaPzqXxxxz4H;


desc
@@


1.2
log
@mesa: comment out some unused variables, fix some pkglint
@
text
@# $NetBSD: options.mk,v 1.1 2026/11/23 10:29:52 adam Exp $

PKG_OPTIONS_VAR=		PKG_OPTIONS.mesa

.include "features.mk"

PKG_SUPPORTED_OPTIONS+=		llvm vulkan x11
.if ${OPSYS} == "NetBSD" && ${OPSYS_VERSION} < 109904
# Thread local storage dispatch not supported here due to ld.elf_so too old.
.else
PKG_SUPPORTED_OPTIONS+=		elf-tls
.endif

.if ${MESALIB_SUPPORTS_DRI} == "yes"
PKG_SUPPORTED_OPTIONS+=		wayland
.  include "../../devel/wayland/platform.mk"
.  if ${PLATFORM_SUPPORTS_WAYLAND} == "yes"
PKG_SUGGESTED_OPTIONS+=		wayland
.  endif
.endif

PKG_SUGGESTED_OPTIONS+=		x11

.include "../../mk/bsd.fast.prefs.mk"

# The LLVM option enables JIT accelerated software rendering and is also
# required to support the latest RADEON GPUs.
#
# Enable it by default on platforms where such GPUs might be encountered or
# LLVM-accelerated software rendering might be useful.
.if ${MESALIB_SUPPORTS_DRI} == "yes" && \
    ${OPSYS} != "SunOS" && \
      (${MACHINE_ARCH} == "i386" || \
       ${MACHINE_ARCH} == "x86_64" || \
       ${MACHINE_ARCH} == "aarch64")
PKG_SUGGESTED_OPTIONS+=		llvm
.endif

# ELF TLS is broken in at least the following cases:
# - NetBSD with SDL2 without X11
# - FreeBSD - https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3559
# - Linux with musl libc
#
# https://gitlab.freedesktop.org/mesa/mesa/issues/966
.if ${OPSYS} == "Linux" && !empty(GLIBC_VERSION)
PKG_SUGGESTED_OPTIONS+=		elf-tls
.endif

.include "../../mk/bsd.options.mk"

# Gallium drivers requiring LLVM
PLIST_VARS+=	r600 radeonsi

# Windowing systems
PLIST_VARS+=	glx

#
# ELF TLS support
#
.if empty(PKG_OPTIONS:Melf-tls)
BUILDLINK_TRANSFORM+=	rm:-DUSE_ELF_TLS
.endif

PLIST_VARS+=	iris
#
# LLVM support
#
.if !empty(PKG_OPTIONS:Mllvm)
MESON_ARGS+=		-Dllvm=enabled
.  include "../../devel/libelf/buildlink3.mk"
.  include "../../lang/clang/buildlink3.mk"
.  include "../../lang/libclc/buildlink3.mk"
.  include "../../lang/libunwind/buildlink3.mk"
.  include "../../lang/llvm/buildlink3.mk"
.  include "../../parallel/spirv-tools/buildlink3.mk"

GALLIUM_DRIVERS+=		llvmpipe
.  if ${OPSYS} != "Darwin" && ${OPSYS} != "Cygwin"
# This is the latest libdrm requirement for amdgpu.
BUILDLINK_API_DEPENDS.libdrm+=	libdrm>=2.4.107

PLIST.r600=		yes
GALLIUM_DRIVERS+=	r600 iris
PLIST.radeonsi=		yes
PLIST.iris=		yes
GALLIUM_DRIVERS+=	radeonsi
.  endif
.else
MESON_ARGS+=		-Dllvm=disabled
.endif

#
# Vulkan support - experimental
#
PLIST_VARS+=		 vulkan vulkan_intel
.if !empty(PKG_OPTIONS:Mvulkan)
.include "../../graphics/glslang/buildlink3.mk"
VULKAN_DRIVERS+=	amd
VULKAN_DRIVERS+=	swrast
PLIST.vulkan=		yes
.  if ${MACHINE_ARCH} == "x86_64"
VULKAN_DRIVERS+=	intel
PLIST.vulkan_intel=	yes
.  endif
.  if ${MACHINE_ARCH} == "aarch64"
VULKAN_DRIVERS+=	broadcom
VULKAN_DRIVERS+=	freedreno
.  endif
.endif

#
# X11 support
#
.if !empty(PKG_OPTIONS:Mx11)
MESA_PLATFORMS+=	x11
PLIST.glx=		yes
.  if ${MESALIB_SUPPORTS_DRI} == "yes"
MESON_ARGS+=		-Dglx=dri
.  endif
.  include "../../x11/libX11/buildlink3.mk"
.  include "../../x11/libXdamage/buildlink3.mk"
.  include "../../x11/libXext/buildlink3.mk"
.  include "../../x11/libXfixes/buildlink3.mk"
.  include "../../x11/libXrandr/buildlink3.mk"
.  include "../../x11/libXxf86vm/buildlink3.mk"
.  include "../../x11/libxcb/buildlink3.mk"
.  include "../../x11/libxshmfence/buildlink3.mk"
.  include "../../x11/xcb-proto/buildlink3.mk"
.  include "../../x11/xorgproto/buildlink3.mk"
.else
MESON_ARGS+=		-Dglx=disabled
.endif

#
# Wayland support
#
.if !empty(PKG_OPTIONS:Mwayland)
MESA_PLATFORMS+=	wayland
.  include "../../devel/wayland/buildlink3.mk"
.  include "../../devel/wayland-protocols/buildlink3.mk"
.endif
@


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: options.mk,v 1.85 2023/07/19 18:32:49 tnn Exp $
d77 1
a77 1
GALLIUM_DRIVERS+=	llvmpipe
@

