From 2e7b52d70184e301dbf7a43670c28facbb0206cd Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 20 May 2026 04:02:02 +0900 Subject: [PATCH] internal/rosa/package: migrate mesa This has many dependencies. Signed-off-by: Ophestra --- internal/rosa/mesa.go | 140 ----------------------- internal/rosa/package/mesa.az | 137 ++++++++++++++++++++++ internal/rosa/state_native.go | 207 ++++++++++++++++------------------ 3 files changed, 232 insertions(+), 252 deletions(-) delete mode 100644 internal/rosa/mesa.go create mode 100644 internal/rosa/package/mesa.az diff --git a/internal/rosa/mesa.go b/internal/rosa/mesa.go deleted file mode 100644 index a2bd91fa..00000000 --- a/internal/rosa/mesa.go +++ /dev/null @@ -1,140 +0,0 @@ -package rosa - -import ( - "strings" - - "hakurei.app/internal/pkg" -) - -func (t Toolchain) newMesa() (pkg.Artifact, string) { - const ( - version = "26.1.0" - checksum = "zU0fjqevySBaoi_5SLW3e2UffmGeBdxOuHmAHTH68n2hV-sjYoqg30koLqFXuk5y" - ) - return t.NewPackage("mesa", version, newFromGitLab( - "gitlab.freedesktop.org", - "mesa/mesa", - "mesa-"+version, - checksum, - ), nil, &MesonHelper{ - Setup: []KV{ - {"Dplatforms", "x11,wayland"}, - {"Dvideo-codecs", "all"}, - - {"Dglvnd", "enabled"}, - {"Dgbm", "enabled"}, - - {"Dgallium-drivers", strings.Join([]string{ - "asahi", // Apple AGX - "crocus", // Intel legacy - "etnaviv", // Vivante GPU designs (mostly NXP/Marvell SoCs) - "freedreno", // Qualcomm Adreno (all Qualcomm SoCs) - "i915", // Intel extra legacy - "iris", // new Intel (Broadwell+) - "lima", // ARM Mali 4xx - "llvmpipe", // software renderer - "nouveau", // Nvidia - "panfrost", // ARM Mali Midgard and up (T/G series) - "r300", // very old AMD - "r600", // less old AMD - "radeonsi", // new AMD (GCN+) - "softpipe", // older software renderer - "svga", // VMWare virtualized GPU - "tegra", // Nvidia Tegra SoCs - "v3d", // Broadcom VC5 (Raspberry Pi 4) - "vc4", // Broadcom VC4 (Raspberry Pi 0-3) - "virgl", // QEMU virtualized GPU (aka VirGL) - "zink", // generic OpenGL over Vulkan, experimental - - // d3d12: WSL emulated GPU (aka Dozen) - // ethosu: accelerator - // rocket: accelerator - }, ",")}, - - {"Dvulkan-drivers", strings.Join([]string{ - "amd", // AMD (aka RADV) - "broadcom", // Broadcom VC5 (Raspberry Pi 4, aka V3D) - "freedreno", // Qualcomm Adreno (all Qualcomm SoCs) - "intel", // new Intel (aka ANV) - "intel_hasvk", // Intel Haswell/Broadwell, "legacy" Vulkan driver (https://www.phoronix.com/news/Intel-HasVK-Drop-Dead-Code) - "panfrost", // ARM Mali Midgard and up (T/G series) - "swrast", // software renderer (aka Lavapipe) - "virtio", // QEMU virtualized GPU (aka VirGL) - "imagination", // PowerVR Rogue - "asahi", // Apple AGX - "gfxstream", // Android virtualized GPU - - // nouveau: Nouveau (aka NVK), requires rust - // microsoft-experimental: WSL virtualized GPU (aka DZN/Dozen) - // kosmickrisp: macOS-specific - }, ",")}, - {"Dvulkan-layers", strings.Join([]string{ - "device-select", - "intel-nullhw", - "overlay", - "screenshot", - "anti-lag", - "vram-report-limit", - }, ",")}, - - {"Dfreedreno-kmds", "msm,virtio"}, - {"Damdgpu-virtio", "true"}, - }, - }, - M4, - PythonPackaging, - PythonMako, - PythonPyYAML, - PythonPycparser, - Glslang, - SPIRVLLVMTranslator, - - Zlib, - Zstd, - Gzip, - Ncurses, - Libglvnd, - Libexpat, - Libva, - Libdrm, - Elfutils, - Bison, - Flex, - LMSensors, - Libconfig, - LibdisplayInfo, - Wayland, - WaylandProtocols, - Libxshmfence, - LibXxf86vm, - LibXrandr, - LibxcbUtilKeysyms, - Libpng, - Libarchive, - KernelHeaders, - ), version -} -func init() { - native.mustRegister(Toolchain.newMesa, &Metadata{ - Name: "mesa", - Description: "open source implementations of OpenGL, OpenGL ES, Vulkan, OpenCL, and more", - Website: "https://mesa3d.org", - - Dependencies: P{ - Libdrm, - Elfutils, - LMSensors, - LibdisplayInfo, - Wayland, - Libxshmfence, - LibXxf86vm, - LibXrandr, - LibxcbUtilKeysyms, - Libpng, - }, - - ID: 1970, - - latest: (*Versions).getStable, - }) -} diff --git a/internal/rosa/package/mesa.az b/internal/rosa/package/mesa.az new file mode 100644 index 00000000..806ac6a1 --- /dev/null +++ b/internal/rosa/package/mesa.az @@ -0,0 +1,137 @@ +package mesa { + description = "open source implementations of OpenGL, OpenGL ES, Vulkan, OpenCL, and more"; + website = "https://mesa3d.org"; + anitya = 1970; + latest = anityaFallback; + + version* = "26.1.0"; + source = remoteGitLab { + domain = "gitlab.freedesktop.org"; + suffix = "mesa/mesa"; + ref = "mesa-"+version; + checksum = "zU0fjqevySBaoi_5SLW3e2UffmGeBdxOuHmAHTH68n2hV-sjYoqg30koLqFXuk5y"; + }; + + exec = meson { + setup = { + "Dplatforms": "x11,wayland"; + "Dvideo-codecs": "all"; + + "Dglvnd": "enabled"; + "Dgbm": "enabled"; + + "Dgallium-drivers": join { + elems = [ + "asahi", // Apple AGX + "crocus", // Intel legacy + "etnaviv", // Vivante GPU designs (mostly NXP/Marvell SoCs) + "freedreno", // Qualcomm Adreno (all Qualcomm SoCs) + "i915", // Intel extra legacy + "iris", // new Intel (Broadwell+) + "lima", // ARM Mali 4xx + "llvmpipe", // software renderer + "nouveau", // Nvidia + "panfrost", // ARM Mali Midgard and up (T/G series) + "r300", // very old AMD + "r600", // less old AMD + "radeonsi", // new AMD (GCN+) + "softpipe", // older software renderer + "svga", // VMWare virtualized GPU + "tegra", // Nvidia Tegra SoCs + "v3d", // Broadcom VC5 (Raspberry Pi 4) + "vc4", // Broadcom VC4 (Raspberry Pi 0-3) + "virgl", // QEMU virtualized GPU (aka VirGL) + "zink", // generic OpenGL over Vulkan, experimental + + // d3d12: WSL emulated GPU (aka Dozen) + // ethosu: accelerator + // rocket: accelerator + ]; + sep = ","; + }; + + "Dvulkan-drivers": join { + elems = [ + "amd", // AMD (aka RADV) + "broadcom", // Broadcom VC5 (Raspberry Pi 4, aka V3D) + "freedreno", // Qualcomm Adreno (all Qualcomm SoCs) + "intel", // new Intel (aka ANV) + "intel_hasvk", // Intel Haswell/Broadwell, "legacy" Vulkan driver (https://www.phoronix.com/news/Intel-HasVK-Drop-Dead-Code) + "panfrost", // ARM Mali Midgard and up (T/G series) + "swrast", // software renderer (aka Lavapipe) + "virtio", // QEMU virtualized GPU (aka VirGL) + "imagination", // PowerVR Rogue + "asahi", // Apple AGX + "gfxstream", // Android virtualized GPU + + // nouveau: Nouveau (aka NVK), requires rust + // microsoft-experimental: WSL virtualized GPU (aka DZN/Dozen) + // kosmickrisp: macOS-specific + ]; + sep = ","; + }; + + "Dvulkan-layers": join { + elems = [ + "device-select", + "intel-nullhw", + "overlay", + "screenshot", + "anti-lag", + "vram-report-limit", + ]; + sep = ","; + }; + + "Dfreedreno-kmds": "msm,virtio"; + "Damdgpu-virtio": "true"; + }; + }; + + inputs = [ + m4, + python-packaging, + python-mako, + python-pyyaml, + python-pycparser, + glslang, + spirv-llvm-translator, + + zlib, + zstd, + gzip, + ncurses, + libglvnd, + libexpat, + libva, + libdrm, + elfutils, + bison, + flex, + lm_sensors, + libconfig, + libdisplay-info, + wayland, + wayland-protocols, + libxshmfence, + libXxf86vm, + libXrandr, + libxcb-util-keysyms, + libpng, + libarchive, + kernel-headers, + ]; + + runtime = [ + libdrm, + elfutils, + lm_sensors, + libdisplayInfo, + wayland, + libxshmfence, + libXxf86vm, + libXrandr, + libxcb-util-keysyms, + libpng, + ]; +} diff --git a/internal/rosa/state_native.go b/internal/rosa/state_native.go index 8b8d2b1b..49ede789 100644 --- a/internal/rosa/state_native.go +++ b/internal/rosa/state_native.go @@ -1,116 +1,99 @@ package rosa var ( - LLVM = H("llvm") - EarlyInit = H("earlyinit") - Kernel = H("kernel") - KernelHeaders = H("kernel-headers") - Firmware = H("firmware") - ACL = H("acl") - Automake = H("automake") - Bash = H("bash") - Bison = H("bison") - Bzip2 = H("bzip2") - Coreutils = H("coreutils") - DBus = H("dbus") - DTC = H("dtc") - Diffutils = H("diffutils") - Elfutils = H("elfutils") - Findutils = H("findutils") - Flex = H("flex") - FontUtil = H("font-util") - Freetype = H("freetype") - Fuse = H("fuse") - GMP = H("gmp") - GLib = H("glib") - Gawk = H("gawk") - GenInitCPIO = H("gen_init_cpio") - Gettext = H("gettext") - Glslang = H("glslang") - Go = H("go") - Gzip = H("gzip") - Hakurei = H("hakurei") - HakureiDist = H("hakurei-dist") - Kmod = H("kmod") - LibX11 = H("libX11") - LibXau = H("libXau") - LibXdmcp = H("libXdmcp") - LibXext = H("libXext") - LibXfont2 = H("libXfont2") - LibXrandr = H("libXrandr") - LibXrender = H("libXrender") - LibXxf86vm = H("libXxf86vm") - Libarchive = H("libarchive") - Libbsd = H("libbsd") - Libconfig = H("libconfig") - LibdisplayInfo = H("libdisplay-info") - Libdrm = H("libdrm") - Libepoxy = H("libepoxy") - Libexpat = H("libexpat") - Libffi = H("libffi") - Libfontenc = H("libfontenc") - Libglvnd = H("libglvnd") - Libmd = H("libmd") - Libmnl = H("libmnl") - Libnftnl = H("libnftnl") - Libpciaccess = H("libpciaccess") - Libpng = H("libpng") - Libseccomp = H("libseccomp") - Libtasn1 = H("libtasn1") - Libtirpc = H("libtirpc") - Libtool = H("libtool") - Libva = H("libva") - LibxcbRenderUtil = H("libxcb-render-util") - LibxcbUtil = H("libxcb-util") - LibxcbUtilImage = H("libxcb-util-image") - LibxcbUtilKeysyms = H("libxcb-util-keysyms") - LibxcbUtilWM = H("libxcb-util-wm") - Libxcvt = H("libxcvt") - Libxkbfile = H("libxkbfile") - Libxml2 = H("libxml2") - Libxshmfence = H("libxshmfence") - Libxtrans = H("libxtrans") - LMSensors = H("lm_sensors") - M4 = H("m4") - NSS = H("nss") - NSSCACert = H("nss-cacert") - Ncurses = H("ncurses") - Nettle = H("nettle") - OpenSSL = H("openssl") - Patch = H("patch") - Pixman = H("pixman") - PkgConfig = H("pkg-config") - PythonMako = H("python-mako") - PythonPackaging = H("python-packaging") - PythonPyTest = H("python-pytest") - PythonPyYAML = H("python-pyyaml") - PythonPycparser = H("python-pycparser") - PythonSetuptools = H("python-setuptools") - PythonWheel = H("python-wheel") - QEMU = H("qemu") - Sed = H("sed") - SPIRVLLVMTranslator = H("spirv-llvm-translator") - SquashfsTools = H("squashfs-tools") - Toybox = H("toybox") - toyboxEarly = H("toybox-early") - Unzip = H("unzip") - Wayland = H("wayland") - WaylandProtocols = H("wayland-protocols") - XCB = H("xcb") - XCBProto = H("xcb-proto") - XZ = H("xz") - Xkbcomp = H("xkbcomp") - XkeyboardConfig = H("xkeyboard-config") - XorgProto = H("xorgproto") - Zlib = H("zlib") - Zstd = H("zstd") - stage0Dist = H("stage0-dist") - llvmSource = H("llvm-project") - earlyCompilerRT = H("early-compiler-rt") - earlyRuntimes = H("early-runtimes") - utilMacros = H("util-macros") - Musl = H("musl") - muslHeaders = H("musl-headers") - gcc = H("gcc") - Stage0 = H("rosa-stage0") + LLVM = H("llvm") + EarlyInit = H("earlyinit") + Kernel = H("kernel") + KernelHeaders = H("kernel-headers") + Firmware = H("firmware") + ACL = H("acl") + Automake = H("automake") + Bash = H("bash") + Bison = H("bison") + Bzip2 = H("bzip2") + Coreutils = H("coreutils") + DBus = H("dbus") + DTC = H("dtc") + Diffutils = H("diffutils") + Findutils = H("findutils") + Flex = H("flex") + FontUtil = H("font-util") + Freetype = H("freetype") + Fuse = H("fuse") + GMP = H("gmp") + GLib = H("glib") + Gawk = H("gawk") + GenInitCPIO = H("gen_init_cpio") + Gettext = H("gettext") + Go = H("go") + Gzip = H("gzip") + Hakurei = H("hakurei") + HakureiDist = H("hakurei-dist") + Kmod = H("kmod") + LibX11 = H("libX11") + LibXau = H("libXau") + LibXdmcp = H("libXdmcp") + LibXext = H("libXext") + LibXfont2 = H("libXfont2") + LibXrender = H("libXrender") + Libbsd = H("libbsd") + Libepoxy = H("libepoxy") + Libexpat = H("libexpat") + Libffi = H("libffi") + Libfontenc = H("libfontenc") + Libmd = H("libmd") + Libmnl = H("libmnl") + Libnftnl = H("libnftnl") + Libpciaccess = H("libpciaccess") + Libseccomp = H("libseccomp") + Libtasn1 = H("libtasn1") + Libtirpc = H("libtirpc") + Libtool = H("libtool") + LibxcbRenderUtil = H("libxcb-render-util") + LibxcbUtil = H("libxcb-util") + LibxcbUtilImage = H("libxcb-util-image") + LibxcbUtilKeysyms = H("libxcb-util-keysyms") + LibxcbUtilWM = H("libxcb-util-wm") + Libxcvt = H("libxcvt") + Libxkbfile = H("libxkbfile") + Libxml2 = H("libxml2") + Libxshmfence = H("libxshmfence") + Libxtrans = H("libxtrans") + M4 = H("m4") + NSS = H("nss") + NSSCACert = H("nss-cacert") + Ncurses = H("ncurses") + Nettle = H("nettle") + OpenSSL = H("openssl") + Patch = H("patch") + Pixman = H("pixman") + PkgConfig = H("pkg-config") + PythonPyTest = H("python-pytest") + PythonSetuptools = H("python-setuptools") + PythonWheel = H("python-wheel") + QEMU = H("qemu") + Sed = H("sed") + SquashfsTools = H("squashfs-tools") + Toybox = H("toybox") + toyboxEarly = H("toybox-early") + Unzip = H("unzip") + Wayland = H("wayland") + WaylandProtocols = H("wayland-protocols") + XCB = H("xcb") + XCBProto = H("xcb-proto") + XZ = H("xz") + Xkbcomp = H("xkbcomp") + XkeyboardConfig = H("xkeyboard-config") + XorgProto = H("xorgproto") + Zlib = H("zlib") + Zstd = H("zstd") + stage0Dist = H("stage0-dist") + llvmSource = H("llvm-project") + earlyCompilerRT = H("early-compiler-rt") + earlyRuntimes = H("early-runtimes") + utilMacros = H("util-macros") + Musl = H("musl") + muslHeaders = H("musl-headers") + gcc = H("gcc") + Stage0 = H("rosa-stage0") )