From 74d5e01bb44dafff14217280a4538c4bf436f7c3 Mon Sep 17 00:00:00 2001 From: vasilito Date: Fri, 24 Jul 2026 13:18:20 +0900 Subject: [PATCH] mesa: persist Redox EGL/DRI gate as a tracked patch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The meson gate that enables EGL on Redox — adding "redox" to system_has_kms_drm (meson.build:159, so with_dri→with_egl/gbm) and to the _GNU_SOURCE platform list (:1208) — existed only as an in-place edit in the untracked extracted source/ tree. Any clean re-extract lost it and reverted to "Feature egl cannot be enabled". Capture it as local/patches/mesa/08-*.patch and wire it into recipe.toml so EGL/GBM/llvmpipe build reproducibly. Source tree reverted to pristine so the patch is the sole, tracked change. --- .../patches/mesa/08-meson-redox-kms-drm.patch | 20 +++++++++++++++++++ local/recipes/libs/mesa/recipe.toml | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 local/patches/mesa/08-meson-redox-kms-drm.patch diff --git a/local/patches/mesa/08-meson-redox-kms-drm.patch b/local/patches/mesa/08-meson-redox-kms-drm.patch new file mode 100644 index 0000000000..dad944b2f1 --- /dev/null +++ b/local/patches/mesa/08-meson-redox-kms-drm.patch @@ -0,0 +1,20 @@ +--- a/meson.build ++++ b/meson.build +@@ -156,7 +156,7 @@ + + with_any_opengl = with_opengl or with_gles1 or with_gles2 + +-system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system()) ++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm', 'redox'].contains(host_machine.system()) + + gallium_drivers = get_option('gallium-drivers') + if gallium_drivers.contains('auto') +@@ -1205,7 +1205,7 @@ + endif + + # TODO: this is very incomplete +-if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android', 'managarm'].contains(host_machine.system()) ++if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android', 'managarm', 'redox'].contains(host_machine.system()) + pre_args += '-D_GNU_SOURCE' + elif host_machine.system() == 'sunos' + pre_args += '-D__EXTENSIONS__' diff --git a/local/recipes/libs/mesa/recipe.toml b/local/recipes/libs/mesa/recipe.toml index 5113010e9e..c6ad50f37b 100644 --- a/local/recipes/libs/mesa/recipe.toml +++ b/local/recipes/libs/mesa/recipe.toml @@ -15,6 +15,10 @@ patches = [ "mesa/02-gbm-dumb-prime-export.patch", "mesa/04-sys-ioccom-stub-header.patch", "mesa/05-vk-sync-wchar-include.patch", + # Persist the Redox EGL/DRI gate: add 'redox' to meson's system_has_kms_drm + # (enables with_dri → with_egl/gbm) and to the _GNU_SOURCE platform list. + # Was an untracked in-place edit lost on every clean re-extract. + "mesa/08-meson-redox-kms-drm.patch", ] [build] template = "custom"