|
3 | 3 | using BinaryBuilder, Pkg |
4 | 4 |
|
5 | 5 | name = "Mesa" |
6 | | -version = v"20.1.5" |
| 6 | +version = v"26.0.3" |
7 | 7 |
|
8 | 8 | # Collection of sources required to complete build |
9 | 9 | sources = [ |
10 | | - ArchiveSource("https://archive.mesa3d.org/mesa-$version.tar.xz", "fac1861e6e0bf1aec893f8d86dbfb9d8a0f426ff06b05256df10e3ad7e02c69b"), |
| 10 | + ArchiveSource("https://archive.mesa3d.org/mesa-$version.tar.xz", |
| 11 | + "ddb7443d328e89aa45b4b6b80f077bf937f099daeca8ba48cabe32aab769e134"), |
11 | 12 | ] |
12 | 13 |
|
13 | 14 | # Bash recipe for building across all platforms |
14 | 15 | 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 |
23 | 57 | """ |
24 | 58 |
|
25 | 59 | # These are the platforms we will build for by default, unless further |
26 | 60 | # 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) |
31 | 65 |
|
32 | 66 | # The products that we will ensure are always built |
33 | 67 | products = [ |
34 | | - LibraryProduct("opengl32sw", :opengl32sw; dont_dlopen=true) |
| 68 | + LibraryProduct(["opengl32sw", "libGL"], :libmesaGL), |
35 | 69 | ] |
36 | 70 |
|
37 | 71 | # Dependencies that must be installed before this package can be built |
| 72 | +x11_platforms = filter(p -> Sys.islinux(p) || Sys.isfreebsd(p), platforms) |
38 | 73 | 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), |
40 | 84 | ] |
41 | 85 |
|
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