New commits:
commit 94f9fa07b7288b04415bb5c9d3943d86f47d2f2d
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
graphics-libs/mesa: fix and supplement build options
Correct and update build options and dependencies to match what is
in the upstream build system.
commit f45b9d72307182a96f5034162c4f48e8e2b9315c
Author: Justin Boffemmyer <flux AT sourcemage.org>
Commit: Justin Boffemmyer <flux AT sourcemage.org>
MESON_FUNCTIONS: add meson_opt() function
Implement a new meson_opt() function to automatically convert from
config_query* values to the required meson option values, coupled with
the meson option name. This function modifies the value of OPT and is
meant to only be called from BUILD.
diff --git a/ChangeLog b/ChangeLog
index e0e7376..70485f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2025-01-19 Justin Boffemmyer <flux AT sourcemage.org>
+ * MESON_FUNCTIONS: new function, meson_opt(), for converting
+ config_query* values into meson option values in BUILD
+
2025-01-19 Treeve Jelbert <treeve AT sourcemage.org>
* libs/upower-suspend: delete obsolete, unused spell
* gnome2-libs/devicekit-power: delete obsolete, unused spell
diff --git a/MESON_FUNCTIONS b/MESON_FUNCTIONS
index e9c0f35..57c6ee8 100755
--- a/MESON_FUNCTIONS
+++ b/MESON_FUNCTIONS
@@ -57,6 +57,52 @@ meson_install () {
DESTDIR="${INSTALL_ROOT}/" ${MESON_INSTALL} ${MESON_OPTS}
}
+#---------------------------------------------------------------------
+## Converts from y/n or list values to meson build options.
+##
+## @param setting_type (boolean, feature, list/array, or choice/combo,
+## defaults to feature)
+## @param setting_name
+## @param setting_value
+##
+## Note: this function automatically sets OPT. This function should
+## only be called from BUILD.
+#---------------------------------------------------------------------
+meson_opt() {
+ local name
+ local result
+ local type="$1"
+ case "$type" in
+ bool|boolean|feature|list|array|choice|combo)
+ name="$2"
+ shift 2
+ ;;
+ *)
+ type="feature"
+ name="$1"
+ shift 1
+ ;;
+ esac
+ case "$type" in
+ bool|boolean)
+ case "${1:-n}" in
+ y) result="true" ;;
+ n) result="false" ;;
+ esac
+ ;;
+ feature)
+ case "${1:-n}" in
+ y) result="enabled" ;;
+ n) result="disabled" ;;
+ esac
+ ;;
+ list|array|choice|combo)
+ result="${@// /,}"
+ ;;
+ esac
+ OPTS="$OPTS $name=$result"
+}
+
default_build() {
meson_build
}
diff --git a/graphics-libs/mesa/BUILD b/graphics-libs/mesa/BUILD
index 8c3e3fa..7aa93c1 100755
--- a/graphics-libs/mesa/BUILD
+++ b/graphics-libs/mesa/BUILD
@@ -5,36 +5,111 @@
# circumstances, and works with reduced performance where initial-exec
# prevents loading altogether. This is accompanied by a patch removing
the
# use of initial-exec and the related asm stubs.
-CFLAGS+=" -mtls-dialect=gnu2" &&
+CFLAGS="$CFLAGS -mtls-dialect=gnu2" &&
case "$HOST" in
-*-gnu) ;;
-*)
- local unportable=(intel intel-ui)
- message "${PROBLEM_COLOR}WARNING:$DEFAULT_COLOR" \
- "Disabling non-portable tools: ${unportable[*]}"
- MESA_TOOLS=" ${MESA_TOOLS} "
- for i in "${unportable[@]}"; do
- MESA_TOOLS="${MESA_TOOLS// $i / }"
- done
- MESA_TOOLS="${MESA_TOOLS# }"
- MESA_TOOLS="${MESA_TOOLS% }"
- ;;
+ *-gnu) ;;
+ *)
+ local unportable=(intel intel-ui)
+ message "${PROBLEM_COLOR}WARNING:$DEFAULT_COLOR" \
+ "Disabling non-portable tools: ${unportable[*]}"
+ MESA_TOOLS=" ${MESA_TOOLS} "
+ for i in "${unportable[@]}"; do
+ MESA_TOOLS="${MESA_TOOLS// $i / }"
+ done
+ MESA_TOOLS="${MESA_TOOLS## }"
+ MESA_TOOLS="${MESA_TOOLS%% }"
+ ;;
esac &&
-config_query_multi MESA_EGL "window systems to support,recommend x11" x11
wayland &&
+config_query_multi MESA_PLATFORMS "Which window systems to support?" \
+ auto \
+ wayland \
+ x11 \
+ &&
+
+config_query_multi MESA_DRM "Which libdrm hardware to use?" \
+ AMD \
+ INTEL \
+ NOUVEAU \
+ RADEON \
+ &&
-config_query_multi MESA_DRM "which libdrm hardware" AMD INTEL NOUVEAU RADEON
&&
# only suggest drivers for specified hardware
-local AVAILABLE_GALLIUM="svga swrast virgl zink" &&
-local AVAILABLE_VULKAN="swrast" &&
+local AVAILABLE_GALLIUM="d3d12 llvmpipe softpipe svga virgl zink" &&
+local AVAILABLE_VULKAN="swrast virtio" &&
if list_find "$MESA_DRM" AMD;then
- AVAILABLE_VULKAN="amd ${AVAILABLE_VULKAN}"
+ AVAILABLE_VULKAN="amd ${AVAILABLE_VULKAN}" &&
+ config_query MESA_AMD_LLVM "Use LLVM for the AMD drivers?" y
fi &&
if list_find "$MESA_DRM" RADEON;then
AVAILABLE_GALLIUM="r300 r600 radeonsi ${AVAILABLE_GALLIUM}"
fi &&
if list_find "$MESA_DRM" INTEL;then
AVAILABLE_GALLIUM="i915 iris crocus ${AVAILABLE_GALLIUM}" &&
- AVAILABLE_VULKAN="intel ${AVAILABLE_VULKAN}"
+ AVAILABLE_VULKAN="intel intel_hasvk ${AVAILABLE_VULKAN}"
fi &&
if list_find "$MESA_DRM" NOUVEAU;then
AVAILABLE_GALLIUM="nouveau ${AVAILABLE_GALLIUM}" &&
AVAILABLE_VULKAN="nouveau ${AVAILABLE_VULKAN}"
fi &&
-config_query_multi MESA_GLX "glx build types, recommend dri" disabled dri
xlib &&
+config_query_multi MESA_GALLIUM "Which gallium (accelerated) drivers to
build?" \
+ none \
+ all \
+ auto \
+ $(echo $AVAILABLE_GALLIUM | sort) \
+ &&
+
+if [ -n "$MESA_GALLIUM" ] && ! list_find "$MESA_GALLIUM" none ;then
+ config_query MESA_GALLIUM_HUD "Enable HUD block/NIC I/O HUD status
support?" n &&
+
+ local allow_xa
+ for driver in nouveau freedreno i915 svga ;do
+ if list_find "$MESA_GALLIUM" $driver ;then
+ allow_xa="y"
+ fi
+ done
+ if [[ "$allow_xa" == "y" ]] ;then
+ config_query MESA_GALLIUM_XA "Build gallium XA frontend?" n
+ fi &&
+
+ if list_find "$MESA_GALLIUM" llvmpipe || list_find "$MESA_GALLIUM"
softpipe ;then
+ config_query MESA_GALLIUM_D3D9 "Build gallium Direct3D9 (nine)
frontend?" n &&
+ config_query MESA_GALLIUM_D3D10 "Build gallium Direct3D10 (WDDM UMD)
frontend?" n
+ fi &&
+
+ if list_find "$MESA_GALLIUM" d3d12 ;then
+ config_query MESA_GALLIUM_D3D12_PIPELINE "Build gallium with Direct3D12
graphics pipeline support?" n &&
+ config_query MESA_GALLIUM_D3D12_VIDEO "Build gallium with Direct3D12
video support?" n
+ fi &&
+
+ config_query MESA_OPENCL "Build gallium OpenCL (clover) frontend?" n &&
+
+ if [[ "$MESA_OPENCL" == "y" ]] ;then
+ config_query MESA_OPENCL_SPIRV "Enable SPIR-V support in OpenCL (clover)
frontend?" n
+ fi &&
+
+ config_query MESA_RUSTICL "Build gallium rusticl frontend?" n &&
+
+ if [[ "$MESA_RUSTICL" == "y" ]] ;then
+ config_query_multi MESA_RUSTICL_DRIVERS "Which drivers to enable with
rusticl by default?" \
+ auto \
+ asahi
+ fi
+fi &&
+
+config_query_multi MESA_VULKAN "Which Vulkan drivers to build?" \
+ none \
+ all \
+ auto \
+ $(echo $AVAILABLE_VULKAN | sort) \
+ &&
+
+if [ -n "$MESA_VULKAN" ] && ! list_find "$MESA_VULKAN" none ;then
+ config_query_multi MESA_VULKAN_LAYERS "Which Vulkan layers to build?" \
+ none \
+ device-select \
+ intel-nullhw \
+ overlay \
+ screenshot \
+ &&
+
+ config_query MESA_XLIB_LEASE "Enable VK_EXT_acquire_xlib_display?" n
+fi &&
+
+config_query MESA_SHADER_CACHE "Support on-disk shader caching?" n &&
+
+# EGL requires DRI, which is only enabled if gallium is enabled
+if ! list_find "$MESA_GALLIUM" none ;then
+ config_query MESA_EGL "Enable EGL platform support?" n &&
+
+ if [[ "$MESA_EGL" == "y" ]] ;then
+ config_query_list MESA_EGL_DEFAULT "Which window system should EGL
assume for EGL_DEFAULT_DISPLAY" \
+ auto \
+ drm \
+ surfaceless \
+ wayland \
+ x11
+ fi
+fi &&
+
+config_query MESA_GLES1 "Support OpenGL ES 1.x?" n &&
+config_query MESA_GLES23 "Support OpenGL ES 2.x and 3.x?" n &&
+config_query MESA_OPENGL "Enable desktop OpenGL support?" y &&
+config_query MESA_GBM "Enable gbm platform support?" n &&
+config_query MESA_OSMESA "Build OSmesa to support off-screen rendering?" n &&
+
+config_query_list MESA_GLX "Which glx build type (auto or dri recommended)?"
\
+ auto \
+ disabled \
+ dri \
+ xlib \
+ &&
+
if list_find "${MESA_GLX}" "disabled"; then
MESA_GLX="disabled"
+else
+ config_query MESA_GLX_DIRECT "Enable direct rendering in GLX and EGL for
DRI?" y &&
+ config_query MESA_GLX_READONLY "Disable writable .text section on x86
(decreases performance)?" n
fi &&
-# Gallium support
-
-message "${MESSAGE_COLOR}If you want to enable VDPAU you have to select at
least one of the r300, r600,$DEFAULT_COLOR" &&
-message "${MESSAGE_COLOR}radeonsi or nouveau gallium
drivers:${DEFAULT_COLOR}" &&
-config_query_multi MESA_GALLIUM \
- "which gallium (accellerated) drivers to build" \
- none all $AVAILABLE_GALLIUM &&
-if list_find "$MESA_GALLIUM" all;then
- MESA_GALLIUM="$AVAILABLE_GALLIUM"
+if [[ "$MESA_EGL" == "y" ]] || ! list_find "$MESA_GLX" disabled ;then
+ config_query MESA_GLVND "Enable GLVND support?" n
fi &&
-# Vulkan support
-config_query_multi MESA_VULKAN \
- "which Vulkan drivers to build" \
- none all $AVAILABLE_VULKAN &&
-if list_find "$MESA_VULKAN" all; then
- MESA_VULKAN="$AVAILABLE_VULKAN"
+config_query MESA_SPIRV_DXIL "Build support for the SPIR-V to DXIL library?"
n &&
+
+config_query_multi MESA_TOOLS "Which tools to build?" \
+ none \
+ all \
+ dlclose-skip \
+ drm-shim \
+ etnaviv \
+ freedreno \
+ glsl \
+ intel \
+ intel-ui \
+ nir \
+ nouveau \
+ &&
+
+config_query MESA_PERFETTO "Enable performance analysis with Perfetto" n &&
+
+if [[ "${MESA_PERFETTO#perfetto=}" == "true" ]] ;then
+ config_query_multi MESA_PERFETTO_SOURCES "Perfetto datasources to build" \
+ auto \
+ intel
fi &&
-config_query_option MESA_GLES1 "support GLES1 - embedded systems" n
gles1=enabled gles1=disabled &&
-config_query_option MESA_GLES2 "support GLES2/3 - embedded systems" n
gles2=enabled gles2=disabled &&
+config_query MESA_TEFLON "Enable TensorFlow Lite delegate" n &&
+config_query MESA_GPUVIS "Enable tracing markers for gpuvis" n &&
+
+if list_find "$MESA_DRM" INTEL;then
+ config_query MESA_INTEL_RT "Build Intel raytracing support (on supported
hardware)?" n
+fi &&
-if list_find "$MESA_TOOLS" intel-ui;then
- depends gtk+3
+if [[ "$MESA_XMLCONFIG" == "y" ]] ;then
+ buildsys_depends expat &&
+ suggest_depends driconf "to create custom xmlconfig (driconf) files"
fi
diff --git a/graphics-libs/mesa/DETAILS b/graphics-libs/mesa/DETAILS
index 735d49a..31ab4da 100755
--- a/graphics-libs/mesa/DETAILS
+++ b/graphics-libs/mesa/DETAILS
@@ -1,40 +1,42 @@
-. "${GRIMOIRE}/FUNCTIONS"
-. "${GRIMOIRE}/MESON_FUNCTIONS"
- SPELL=mesa
+. "${GRIMOIRE}/FUNCTIONS" &&
+. "${GRIMOIRE}/MESON_FUNCTIONS" &&
+
+ SPELL=mesa
+SPELL_BUILD_SYSTEM=meson
if [[ "${MESA_BRANCH}" == "scm" ]]; then
- VERSION=$(get_scm_version)
- SOURCE="${SPELL}-git.tar.xz"
- FORCE_DOWNLOAD="on"
-
SOURCE_URL[0]="git_http://gitlab.freedesktop.org/${SPELL}/${SPELL}.git:${SPELL}-git:main"
- SOURCE_IGNORE="volatile"
-SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-git"
+ VERSION=$(get_scm_version)
+ SOURCE="${SPELL}-git.tar.xz"
+ FORCE_DOWNLOAD="on"
+
SOURCE_URL[0]="git_http://gitlab.freedesktop.org/${SPELL}/${SPELL}.git:${SPELL}-git:main"
+ SOURCE_IGNORE="volatile"
+ SOURCE_DIRECTORY="${BUILD_DIRECTORY}/${SPELL}-git"
else
- VERSION="24.3.3"
-
SOURCE_HASH="sha256:105afc00a4496fa4d29da74e227085544919ec7c86bd92b0b6e7fcc32c7125f4:UPSTREAM_HASH"
- SOURCE=mesa-$VERSION.tar.xz
+ VERSION="24.3.3"
+
SOURCE_HASH="sha256:105afc00a4496fa4d29da74e227085544919ec7c86bd92b0b6e7fcc32c7125f4:UPSTREAM_HASH"
+ SOURCE="mesa-$VERSION.tar.xz"
# Watch: https://archive.mesa3d.org/ mesa-([0-9.]+)[.]tar
- SOURCE_URL[0]="https://mesa.freedesktop.org/archive/${SOURCE}"
-SOURCE_DIRECTORY="${BUILD_DIRECTORY}/mesa-${VERSION}"
+ SOURCE_URL[0]="https://mesa.freedesktop.org/archive/${SOURCE}"
+ SOURCE_DIRECTORY="${BUILD_DIRECTORY}/mesa-${VERSION}"
fi
- LICENSE[0]=GPL
- WEB_SITE=https://www.mesa3d.org/
- KEYWORDS="graphics libs"
- ENTERED=20171020
- SHORT="Mesa implementation of the OpenGL(TM) API"
+ LICENSE[0]="GPL"
+ WEB_SITE="https://www.mesa3d.org/"
+ KEYWORDS="graphics libs"
+ ENTERED=20171020
+ SHORT="Mesa implementation of the OpenGL(TM) API"
cat << EOF
-this is a complete rewrite of the original mesalib spell, using the meson
+this is a complete rewrite of the original mesalib spell, using the meson
build system
-The Mesa project began as an open-source implementation of the OpenGL
specification - a
+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
+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
+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.
-Mesa ties into several other open-source projects: the Direct Rendering
Infrastructure
+Mesa ties into several other open-source projects: the Direct Rendering
Infrastructure
and X.org to provide OpenGL support on Linux, FreeBSD and other operating
systems.
EOF
diff --git a/graphics-libs/mesa/HISTORY b/graphics-libs/mesa/HISTORY
index cfc38ca..9dc0e02 100644
--- a/graphics-libs/mesa/HISTORY
+++ b/graphics-libs/mesa/HISTORY
@@ -1,3 +1,10 @@
+2025-01-19 Justin Boffemmyer <flux AT sourcemage.org>
+ * BUILD: update llvm target sub-dependency naming, use meson_opt to
+ * CONFIGURE: update and complete to match current upstream options
+ * DEPENDS: update and correct dependencies, switch to buildsys for
+ * DETAILS: specify spell build system as meson
+ specify build options
+
2025-01-05 Justin Boffemmyer <flux AT sourcemage.org>
* DEPENDS: update llvm target sub-dependency naming
[[SM-Commit] ] GIT changes to master grimoire by Justin Boffemmyer (94f9fa07b7288b04415bb5c9d3943d86f47d2f2d),
Justin Boffemmyer, 01/19/2025