internal/rosa/azalea: add mesa test
This commit is contained in:
@@ -405,12 +405,6 @@ func insertSemicolons(r io.Reader) (io.Reader, error) {
|
|||||||
nlsemi = true
|
nlsemi = true
|
||||||
}
|
}
|
||||||
buf.WriteRune(tok)
|
buf.WriteRune(tok)
|
||||||
if b.Peek() == '}' && nlsemi {
|
|
||||||
buf.WriteRune(';')
|
|
||||||
}
|
|
||||||
if b.Peek() == ']' && nlcomma {
|
|
||||||
buf.WriteRune(',')
|
|
||||||
}
|
|
||||||
case '+', ':', '=':
|
case '+', ':', '=':
|
||||||
buf.WriteRune(tok)
|
buf.WriteRune(tok)
|
||||||
nlsemi = false
|
nlsemi = false
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//go:embed testdata/gcc.az
|
//go:embed testdata/gcc.az
|
||||||
var sample string
|
var gccSample string
|
||||||
|
|
||||||
|
//go:embed testdata/mesa.az
|
||||||
|
var mesaSample string
|
||||||
|
|
||||||
func TestParse(t *testing.T) {
|
func TestParse(t *testing.T) {
|
||||||
t.Parallel()
|
t.Parallel()
|
||||||
@@ -62,7 +65,7 @@ func TestParse(t *testing.T) {
|
|||||||
{"truncated array", `[ "\x00"`, nil,
|
{"truncated array", `[ "\x00"`, nil,
|
||||||
ExprError(scanner.EOF)},
|
ExprError(scanner.EOF)},
|
||||||
|
|
||||||
{"gcc", sample, []any{Func{
|
{"gcc", gccSample, []any{Func{
|
||||||
Ident: Ident("gcc"),
|
Ident: Ident("gcc"),
|
||||||
Package: true,
|
Package: true,
|
||||||
|
|
||||||
@@ -139,6 +142,144 @@ func TestParse(t *testing.T) {
|
|||||||
}}},
|
}}},
|
||||||
},
|
},
|
||||||
}}, nil},
|
}}, nil},
|
||||||
|
{"mesa", mesaSample, []any{Func{
|
||||||
|
Ident: Ident("mesa"),
|
||||||
|
Package: true,
|
||||||
|
Args: []Arg{
|
||||||
|
{K: []Ident{Ident("description")}, V: Val{String("open source implementations of OpenGL, OpenGL ES, Vulkan, OpenCL, and more")}},
|
||||||
|
{K: []Ident{Ident("website")}, V: Val{String("https://mesa3d.org")}},
|
||||||
|
{K: []Ident{Ident("anitya")}, V: Val{Int(1970)}},
|
||||||
|
{K: []Ident{Ident("latest")}, V: Val{Ident("anityaFallback")}},
|
||||||
|
{K: []Ident{Ident("version")}, V: Val{String("26.2.0")}, R: true},
|
||||||
|
|
||||||
|
{K: []Ident{Ident("source")}, V: Val{Func{
|
||||||
|
Ident: Ident("remoteGitLab"),
|
||||||
|
Package: false,
|
||||||
|
Args: []Arg{
|
||||||
|
{K: []Ident{Ident("domain")}, V: Val{String("gitlab.freedesktop.org")}},
|
||||||
|
{K: []Ident{Ident("suffix")}, V: Val{String("mesa/mesa")}},
|
||||||
|
{K: []Ident{Ident("ref")}, V: Val{String("mesa-"), Ident("version")}},
|
||||||
|
{K: []Ident{Ident("checksum")}, V: Val{String("UPnIdpo5wUsE938GXY-YyYDzfF62enRoEzCYRyLLPvzBhBbP4wZ8nDiKsjivcs5v")}},
|
||||||
|
},
|
||||||
|
}}},
|
||||||
|
{K: []Ident{Ident("exec")}, V: Val{Func{Ident: Ident("meson"), Package: false, Args: []Arg{
|
||||||
|
{K: []Ident{Ident("setup")}, V: Val{[]KV{
|
||||||
|
{K: String("platforms"), V: Val{String("x11,wayland")}},
|
||||||
|
{K: String("video-codecs"), V: Val{String("all")}},
|
||||||
|
{K: String("glvnd"), V: Val{String("enabled")}},
|
||||||
|
{K: String("gbm"), V: Val{String("enabled")}},
|
||||||
|
{K: String("egl"), V: Val{String("enabled")}},
|
||||||
|
{K: String("gallium-drivers"), V: Val{Func{
|
||||||
|
Ident: Ident("join"),
|
||||||
|
Package: false,
|
||||||
|
Args: []Arg{
|
||||||
|
{K: []Ident{Ident("elems")}, V: Val{Array{
|
||||||
|
Val{String("asahi")},
|
||||||
|
Val{String("crocus")},
|
||||||
|
Val{String("etnaviv")},
|
||||||
|
Val{String("freedreno")},
|
||||||
|
Val{String("i915")},
|
||||||
|
Val{String("iris")},
|
||||||
|
Val{String("lima")},
|
||||||
|
Val{String("llvmpipe")},
|
||||||
|
Val{String("nouveau")},
|
||||||
|
Val{String("panfrost")},
|
||||||
|
Val{String("r300")},
|
||||||
|
Val{String("r600")},
|
||||||
|
Val{String("radeonsi")},
|
||||||
|
Val{String("softpipe")},
|
||||||
|
Val{String("svga")},
|
||||||
|
Val{String("tegra")},
|
||||||
|
Val{String("v3d")},
|
||||||
|
Val{String("vc4")},
|
||||||
|
Val{String("virgl")},
|
||||||
|
Val{String("zink")}}}},
|
||||||
|
{K: []Ident{Ident("sep")}, V: Val{String(",")}},
|
||||||
|
},
|
||||||
|
}}},
|
||||||
|
{K: String("vulkan-drivers"), V: Val{Func{
|
||||||
|
Ident: Ident("join"),
|
||||||
|
Package: false,
|
||||||
|
Args: []Arg{
|
||||||
|
{K: []Ident{Ident("elems")}, V: Val{Array{
|
||||||
|
Val{String("amd")},
|
||||||
|
Val{String("broadcom")},
|
||||||
|
Val{String("freedreno")},
|
||||||
|
Val{String("intel")},
|
||||||
|
Val{String("intel_hasvk")},
|
||||||
|
Val{String("panfrost")},
|
||||||
|
Val{String("swrast")},
|
||||||
|
Val{String("virtio")},
|
||||||
|
Val{String("imagination")},
|
||||||
|
Val{String("asahi")},
|
||||||
|
Val{String("gfxstream")},
|
||||||
|
}}},
|
||||||
|
{K: []Ident{Ident("sep")}, V: Val{String(",")}}},
|
||||||
|
}}},
|
||||||
|
{K: String("vulkan-layers"), V: Val{Func{
|
||||||
|
Ident: Ident("join"),
|
||||||
|
Package: false,
|
||||||
|
Args: []Arg{
|
||||||
|
{K: []Ident{Ident("elems")}, V: Val{Array{
|
||||||
|
Val{String("device-select")},
|
||||||
|
Val{String("intel-nullhw")},
|
||||||
|
Val{String("overlay")},
|
||||||
|
Val{String("screenshot")},
|
||||||
|
Val{String("anti-lag")},
|
||||||
|
Val{String("vram-report-limit")},
|
||||||
|
}}},
|
||||||
|
{K: []Ident{Ident("sep")}, V: Val{String(",")}}},
|
||||||
|
}}},
|
||||||
|
{K: String("freedreno-kmds"), V: Val{String("msm,virtio")}},
|
||||||
|
{K: String("amdgpu-virtio"), V: Val{String("true")}}},
|
||||||
|
}},
|
||||||
|
}}}},
|
||||||
|
{K: []Ident{Ident("inputs")}, V: Val{Array{
|
||||||
|
Val{Ident("m4")},
|
||||||
|
Val{Ident("python-packaging")},
|
||||||
|
Val{Ident("python-mako")},
|
||||||
|
Val{Ident("python-pyyaml")},
|
||||||
|
Val{Ident("python-pycparser")},
|
||||||
|
Val{Ident("glslang")},
|
||||||
|
Val{Ident("spirv-llvm-translator")},
|
||||||
|
Val{Ident("zlib")},
|
||||||
|
Val{Ident("zstd")},
|
||||||
|
Val{Ident("gzip")},
|
||||||
|
Val{Ident("ncurses")},
|
||||||
|
Val{Ident("libglvnd")},
|
||||||
|
Val{Ident("libexpat")},
|
||||||
|
Val{Ident("libva")},
|
||||||
|
Val{Ident("libdrm")},
|
||||||
|
Val{Ident("elfutils")},
|
||||||
|
Val{Ident("bison")},
|
||||||
|
Val{Ident("flex")},
|
||||||
|
Val{Ident("lm_sensors")},
|
||||||
|
Val{Ident("libconfig")},
|
||||||
|
Val{Ident("libdisplay-info")},
|
||||||
|
Val{Ident("wayland")},
|
||||||
|
Val{Ident("wayland-protocols")},
|
||||||
|
Val{Ident("libxshmfence")},
|
||||||
|
Val{Ident("libXxf86vm")},
|
||||||
|
Val{Ident("libXrandr")},
|
||||||
|
Val{Ident("libxcb-keysyms")},
|
||||||
|
Val{Ident("libpng")},
|
||||||
|
Val{Ident("libarchive")},
|
||||||
|
Val{Ident("kernel-headers")},
|
||||||
|
}}},
|
||||||
|
{K: []Ident{Ident("runtime")}, V: Val{Array{
|
||||||
|
Val{Ident("llvm")},
|
||||||
|
Val{Ident("libdrm")},
|
||||||
|
Val{Ident("elfutils")},
|
||||||
|
Val{Ident("lm_sensors")},
|
||||||
|
Val{Ident("libdisplay-info")},
|
||||||
|
Val{Ident("wayland")},
|
||||||
|
Val{Ident("libxshmfence")},
|
||||||
|
Val{Ident("libXxf86vm")},
|
||||||
|
Val{Ident("libXrandr")},
|
||||||
|
Val{Ident("libxcb-keysyms")},
|
||||||
|
Val{Ident("libpng")}}}},
|
||||||
|
},
|
||||||
|
}}, nil},
|
||||||
}
|
}
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
@@ -156,14 +297,14 @@ func TestParse(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func BenchmarkParse(b *testing.B) {
|
func BenchmarkParse(b *testing.B) {
|
||||||
r := strings.NewReader(sample)
|
r := strings.NewReader(gccSample)
|
||||||
for b.Loop() {
|
for b.Loop() {
|
||||||
if _, err := Parse(r); err != nil {
|
if _, err := Parse(r); err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
b.StopTimer()
|
b.StopTimer()
|
||||||
r.Reset(sample)
|
r.Reset(gccSample)
|
||||||
b.StartTimer()
|
b.StartTimer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ func TestEvaluateGCC(t *testing.T) {
|
|||||||
t.Parallel()
|
t.Parallel()
|
||||||
|
|
||||||
var gcc Func
|
var gcc Func
|
||||||
if e, err := Parse(strings.NewReader(sample)); err != nil {
|
if e, err := Parse(strings.NewReader(gccSample)); err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
} else {
|
} else {
|
||||||
gcc = e[0].(Func)
|
gcc = e[0].(Func)
|
||||||
@@ -357,7 +357,7 @@ func TestEvaluateGCC(t *testing.T) {
|
|||||||
|
|
||||||
func BenchmarkEvaluate(b *testing.B) {
|
func BenchmarkEvaluate(b *testing.B) {
|
||||||
var gcc Func
|
var gcc Func
|
||||||
if e, err := Parse(strings.NewReader(sample)); err != nil {
|
if e, err := Parse(strings.NewReader(gccSample)); err != nil {
|
||||||
b.Fatal(err)
|
b.Fatal(err)
|
||||||
} else {
|
} else {
|
||||||
gcc = e[0].(Func)
|
gcc = e[0].(Func)
|
||||||
|
|||||||
+139
@@ -0,0 +1,139 @@
|
|||||||
|
package mesa {
|
||||||
|
description = "open source implementations of OpenGL, OpenGL ES, Vulkan, OpenCL, and more"
|
||||||
|
website = "https://mesa3d.org"
|
||||||
|
anitya = 1970
|
||||||
|
latest = anityaFallback
|
||||||
|
|
||||||
|
version# = "26.2.0"
|
||||||
|
source = remoteGitLab {
|
||||||
|
domain = "gitlab.freedesktop.org"
|
||||||
|
suffix = "mesa/mesa"
|
||||||
|
ref = "mesa-"+version
|
||||||
|
checksum = "UPnIdpo5wUsE938GXY-YyYDzfF62enRoEzCYRyLLPvzBhBbP4wZ8nDiKsjivcs5v"
|
||||||
|
}
|
||||||
|
|
||||||
|
exec = meson {
|
||||||
|
setup = {
|
||||||
|
"platforms": "x11,wayland"
|
||||||
|
"video-codecs": "all"
|
||||||
|
|
||||||
|
"glvnd": "enabled"
|
||||||
|
"gbm": "enabled"
|
||||||
|
"egl": "enabled"
|
||||||
|
|
||||||
|
"gallium-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 = ","
|
||||||
|
}
|
||||||
|
|
||||||
|
"vulkan-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 = ","
|
||||||
|
}
|
||||||
|
|
||||||
|
"vulkan-layers": join {
|
||||||
|
elems = [
|
||||||
|
"device-select"
|
||||||
|
"intel-nullhw"
|
||||||
|
"overlay"
|
||||||
|
"screenshot"
|
||||||
|
"anti-lag"
|
||||||
|
"vram-report-limit"
|
||||||
|
]
|
||||||
|
sep = ","
|
||||||
|
}
|
||||||
|
|
||||||
|
"freedreno-kmds": "msm,virtio"
|
||||||
|
"amdgpu-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-keysyms
|
||||||
|
libpng
|
||||||
|
libarchive
|
||||||
|
kernel-headers
|
||||||
|
]
|
||||||
|
|
||||||
|
runtime = [
|
||||||
|
llvm
|
||||||
|
libdrm
|
||||||
|
elfutils
|
||||||
|
lm_sensors
|
||||||
|
libdisplay-info
|
||||||
|
wayland
|
||||||
|
libxshmfence
|
||||||
|
libXxf86vm
|
||||||
|
libXrandr
|
||||||
|
libxcb-keysyms
|
||||||
|
libpng
|
||||||
|
]
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user