Skip to content

Commit 800fbf7

Browse files
ViralBShahclaude
andcommitted
Update Mesa to v26.0.3 with softpipe for all non-macOS platforms
- Update Mesa from v20.1.5 to v26.0.3 (latest stable) - Add all Linux, FreeBSD, and Windows platforms (exclude macOS which provides OpenGL natively) - Use softpipe software renderer (no LLVM dependency to avoid conflicts with Julia's LLVM) - Require GCC 10+ for C++17 support (Mesa 26 requirement) - Add X11 dependencies for Linux/FreeBSD Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 74181a6 commit 800fbf7

File tree

1 file changed

+63
-18
lines changed

1 file changed

+63
-18
lines changed

M/Mesa/build_tarballs.jl

Lines changed: 63 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,86 @@
33
using BinaryBuilder, Pkg
44

55
name = "Mesa"
6-
version = v"20.1.5"
6+
version = v"26.0.3"
77

88
# Collection of sources required to complete build
99
sources = [
10-
ArchiveSource("https://archive.mesa3d.org/mesa-$version.tar.xz", "fac1861e6e0bf1aec893f8d86dbfb9d8a0f426ff06b05256df10e3ad7e02c69b"),
10+
ArchiveSource("https://archive.mesa3d.org/mesa-$version.tar.xz",
11+
"ddb7443d328e89aa45b4b6b80f077bf937f099daeca8ba48cabe32aab769e134"),
1112
]
1213

1314
# Bash recipe for building across all platforms
1415
script = raw"""
15-
mkdir build
16-
cd build
17-
apk add py3-mako
18-
meson -D b_ndebug=true -D buildtype=release -D strip=true -D llvm=false ../mesa* --cross-file="${MESON_TARGET_TOOLCHAIN}"
19-
ninja -j${nproc}
20-
ninja install
21-
mv $prefix/bin/opengl32.dll $prefix/bin/opengl32sw.dll
22-
install_license ../mesa*/docs/license.html
16+
cd $WORKSPACE/srcdir/mesa-*
17+
18+
apk add py3-mako py3-yaml py3-packaging
19+
20+
MESA_FLAGS=(
21+
-D b_ndebug=true
22+
-D buildtype=release
23+
-D strip=true
24+
-D llvm=disabled
25+
-D gallium-drivers=softpipe
26+
-D vulkan-drivers=[]
27+
-D gles1=disabled
28+
-D gles2=disabled
29+
-D shader-cache=disabled
30+
)
31+
32+
if [[ "${target}" == *-mingw* ]]; then
33+
MESA_FLAGS+=(
34+
-D platforms=windows
35+
-D glx=disabled
36+
-D egl=disabled
37+
-D gbm=disabled
38+
)
39+
elif [[ "${target}" == *-linux* ]] || [[ "${target}" == *-freebsd* ]]; then
40+
MESA_FLAGS+=(
41+
-D platforms=x11
42+
-D glx=xlib
43+
-D egl=disabled
44+
-D gbm=disabled
45+
)
46+
fi
47+
48+
meson setup build "${MESA_FLAGS[@]}" --cross-file="${MESON_TARGET_TOOLCHAIN}"
49+
ninja -C build -j${nproc}
50+
ninja -C build install
51+
52+
if [[ "${target}" == *-mingw* ]]; then
53+
mv ${prefix}/bin/opengl32.dll ${prefix}/bin/opengl32sw.dll
54+
fi
55+
56+
install_license docs/license.rst
2357
"""
2458

2559
# These are the platforms we will build for by default, unless further
2660
# platforms are passed in on the command line
27-
platforms = [
28-
Platform("x86_64", "windows"),
29-
Platform("i686", "windows")
30-
]
61+
platforms = supported_platforms()
62+
# macOS provides OpenGL natively; Mesa doesn't produce a GL library without X11/GLX
63+
filter!(p -> !Sys.isapple(p), platforms)
64+
platforms = expand_cxxstring_abis(platforms)
3165

3266
# The products that we will ensure are always built
3367
products = [
34-
LibraryProduct("opengl32sw", :opengl32sw; dont_dlopen=true)
68+
LibraryProduct(["opengl32sw", "libGL"], :libmesaGL),
3569
]
3670

3771
# Dependencies that must be installed before this package can be built
72+
x11_platforms = filter(p -> Sys.islinux(p) || Sys.isfreebsd(p), platforms)
3873
dependencies = [
39-
Dependency("Zlib_jll")
74+
Dependency("CompilerSupportLibraries_jll"),
75+
Dependency("Zlib_jll"; compat="1.2.12"),
76+
Dependency("Expat_jll"; platforms=x11_platforms),
77+
Dependency("Xorg_libX11_jll"; platforms=x11_platforms),
78+
Dependency("Xorg_libXext_jll"; platforms=x11_platforms),
79+
Dependency("Xorg_libxcb_jll"; platforms=x11_platforms),
80+
Dependency("Xorg_xorgproto_jll"; platforms=x11_platforms),
81+
Dependency("Xorg_libxshmfence_jll"; platforms=x11_platforms),
82+
Dependency("Xorg_libXrandr_jll"; platforms=x11_platforms),
83+
Dependency("Xorg_libXxf86vm_jll"; platforms=x11_platforms),
4084
]
4185

42-
# Build the tarballs, and possibly a `build.jl` as well.
43-
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)
86+
# Build the tarballs.
87+
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;
88+
julia_compat="1.6", preferred_gcc_version=v"10", clang_use_lld=false)

0 commit comments

Comments
 (0)