Skip to content
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

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions E/EGL/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# 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 = "EGL"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this called EGL and not Mesa, which we have already, but only for Windows?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was a bit confused about this as well TBH. I think the current MESA jll should definitely have a different name. I named this EGL, because that is what my goal of building was initially, but I will need GBM and GLESv2 as well, so I wasn't unhappy that they were built alongside as well. MESA does have additional components like OpenCL and some stuff relating to Xorg as well, which I don't build here, but naming this jll MESA probably makes a lot more sense than the package we currently call MESA.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason we can't fold this into the existing Mesa_jll? You should be able to enable multiple APIs in one build, and make the Unix-only options conditional on the OS.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that sounds like a good plan. I plan to pick this up eventually, but I am just a bit busy ATM. Feel free to take this over if you are interested in this though.

version = v"1.4.0"

# Collection of sources required to complete build
sources = [
GitSource("https://gitlab.freedesktop.org/mesa/mesa.git", "1b74a12ea0ae900d49d1921ed8931eb6131e1f18"),
DirectorySource("./bundled"),
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/mesa/
mkdir build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The automatic installation of the license looks for files with reasonable names in the only directory inside /workspace/srcdir. If there are more than one directory here, this will fail. So it's better to enter the mesa directory and create the build folder inside it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will change that

cd build
apk add py3-mako meson wayland-dev

# pkgconfig returns the wrong path here. It's an ugly hack, but it works
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll have a look about what is going on there, but in any case you must delete this link at the end, otherwise it'll end up inside the tarball

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, right! I forgot.

mkdir -p /workspace/destdir/usr/bin/
ln -s $(which wayland-scanner) /workspace/destdir/usr/bin/

meson -D egl=enabled -D gles1=enabled -D gles2=enabled -D platforms=wayland -D glx=disabled -D c_args="-Wno-implicit-function-declaration" ../ --cross-file="${MESON_TARGET_TOOLCHAIN}"
ninja -j${nproc}
ninja install

rm /workspace/destdir/usr/bin/wayland-scanner
# taken from https://metadata.ftp-master.debian.org/changelogs//main/m/mesa/mesa_20.3.5-1_copyright
install_license ../../copyright
"""

# 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("libvulkan_intel", :libvulkan_intel),
LibraryProduct("libvulkan_lvp", :libvulkan_lvp),
LibraryProduct("libvulkan_radeon", :libvulkan_radeon),
LibraryProduct("libxatracker", :libxatracker),
LibraryProduct("libgbm", :libgbm),
LibraryProduct("libglapi", :libglapi),
]

# Dependencies that must be installed before this package can be built
dependencies = Dependency[
Dependency("Zlib_jll"),
Dependency("libdrm_jll"),
Dependency("LLVM_jll"),
Dependency("Elfutils_jll"),
Dependency("Expat_jll"; compat="~2.2.10"),
simeonschaub marked this conversation as resolved.
Show resolved Hide resolved
Dependency("Zstd_jll"),
Dependency("Wayland_protocols_jll"),
]

# 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")
Loading