-
Notifications
You must be signed in to change notification settings - Fork 558
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add recipe for EGL #3192
base: master
Are you sure you want to change the base?
add recipe for EGL #3192
Changes from 18 commits
1886057
8c20534
3dbc914
f9d29f1
fa44db1
1ea3398
7e9a48a
ec7d651
20f8129
75f15ba
20eea78
c455a81
7db25cf
9648b2b
40f2f7d
af25704
229d0f2
8b57cc7
19aa3bf
39c08e9
ce6ee08
6027ae4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
# Note that this script can accept some limited command-line arguments, run | ||
# `julia build_tarballs.jl --help` to see a usage message. | ||
using BinaryBuilder, Pkg | ||
|
||
name = "Mesa_EGL" | ||
version = v"22.0.0" | ||
|
||
# Collection of sources required to complete build | ||
sources = [ | ||
GitSource("https://gitlab.freedesktop.org/mesa/mesa.git", "716fc5280adcb1912c817298353c0edc731e76a8"), | ||
DirectorySource("./bundled"), | ||
] | ||
|
||
# Bash recipe for building across all platforms | ||
script = raw""" | ||
cd $WORKSPACE/srcdir/mesa/ | ||
|
||
atomic_patch -p1 ${WORKSPACE}/srcdir/patches/wl_scanner-no-native.patch | ||
# Note: Currently unused, until `LIBPATH` becomes updated with search path of products with `dont_dlopen=true` | ||
atomic_patch -p1 ${WORKSPACE}/srcdir/patches/relative-dlopen.patch | ||
atomic_patch -p1 ${WORKSPACE}/srcdir/patches/static_assert.patch | ||
|
||
apk add py3-mako | ||
|
||
mkdir build | ||
cd build | ||
|
||
# Make a cross-file for llvm-config | ||
echo "[binaries]" >llvm-cross.ini | ||
echo "llvm-config = '${host_prefix}/tools/llvm-config'" >>llvm-cross.ini | ||
|
||
meson -D egl=enabled \ | ||
-D gles1=enabled \ | ||
-D gles2=enabled \ | ||
-D opengl=true \ | ||
-D platforms=x11,wayland \ | ||
-D glx=dri \ | ||
-D c_args="-Wno-implicit-function-declaration" \ | ||
-D cpp_rtti=false \ | ||
../ \ | ||
--cross-file="${MESON_TARGET_TOOLCHAIN}" \ | ||
--cross-file=llvm-cross.ini | ||
ninja -j${nproc} | ||
ninja install | ||
|
||
# taken from https://metadata.ftp-master.debian.org/changelogs//main/m/mesa/mesa_20.3.5-1_copyright | ||
install_license ../../copyright | ||
""" | ||
|
||
# TODO: Hack to ensure we load the right drivers | ||
init_block = """ | ||
ENV["LIBGL_DRIVERS_PATH"] = joinpath(artifact_dir, "lib", "dri") | ||
""" | ||
|
||
# These are the platforms we will build for by default, unless further | ||
# platforms are passed in on the command line | ||
platforms = [ | ||
Platform("x86_64", "linux"; libc="glibc", cxxstring_abi="cxx11"), | ||
Platform("x86_64", "linux"; libc="musl", cxxstring_abi="cxx11"), | ||
] | ||
|
||
# The products that we will ensure are always built | ||
products = Product[ | ||
LibraryProduct("libEGL", :libEGL), | ||
LibraryProduct("libGLESv1_CM", :libGLESv1_CM), | ||
LibraryProduct("libGLESv2", :libGLESv2), | ||
LibraryProduct("libGL", :libGL), | ||
LibraryProduct("libvulkan_intel", :libvulkan_intel), | ||
LibraryProduct("libvulkan_lvp", :libvulkan_lvp), | ||
LibraryProduct("libvulkan_radeon", :libvulkan_radeon), | ||
LibraryProduct("libxatracker", :libxatracker), | ||
LibraryProduct("libgbm", :libgbm), | ||
LibraryProduct("libglapi", :libglapi), | ||
|
||
# Drivers | ||
LibraryProduct("crocus_dri", :crocus_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("iris_dri", :iris_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("libgallium_dri", :libgallium_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("r300_dri", :r300_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("radeonsi_dri", :radeonsi_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("virtio_gpu_dri", :virtio_gpu_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("i915_dri", :i915_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("kms_swrast_dri", :kms_swrast_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("nouveau_dri", :nouveau_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("r600_dri", :r600_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("swrast_dri", :swrast_dri, ["lib/dri"]; dont_dlopen=true), | ||
LibraryProduct("vmwgfx_dri", :vmwgfx_dri, ["lib/dri"]; dont_dlopen=true), | ||
] | ||
|
||
# Dependencies that must be installed before this package can be built | ||
dependencies = [ | ||
BuildDependency("Wayland_jll"), # FIXME: HostBuildDependency | ||
Dependency("libLLVM_jll"; compat="11.0.0"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this will work only in julia v1.6? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It requires LLVM >= 11 (and I tested successfully on LLVM 12). What's the compat notation for that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, seeing that this links directly to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, no, it didn't 😄 I had to switch which libLLVM I imported. |
||
HostBuildDependency(PackageSpec(;name="LLVM_jll", version=v"11.0.1")), | ||
Dependency("Zlib_jll"), | ||
Dependency("libdrm_jll"; compat="2.4.110"), | ||
Dependency("Elfutils_jll"), | ||
Dependency("Expat_jll"; compat="2.2.10"), | ||
Dependency("Zstd_jll"), | ||
BuildDependency("Xorg_xorgproto_jll"), | ||
Dependency("Xorg_libX11_jll"), | ||
Dependency("Xorg_libXext_jll"), | ||
Dependency("Xorg_libXfixes_jll"), | ||
Dependency("Xorg_libxshmfence_jll"), | ||
Dependency("Xorg_libXxf86vm_jll"), | ||
Dependency("Xorg_xf86vidmodeproto_jll"), | ||
giordano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Dependency("Xorg_libXrandr_jll"), | ||
Dependency("Wayland_protocols_jll"; compat="1.24"), | ||
giordano marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
|
||
# Build the tarballs, and possibly a `build.jl` as well. | ||
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version=v"8", julia_compat="1.6", init_block) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the FIXME refer to?