-
Notifications
You must be signed in to change notification settings - Fork 570
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
simeonschaub
wants to merge
22
commits into
JuliaPackaging:master
Choose a base branch
from
simeonschaub:sds/EGL
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+501
−0
Open
add recipe for EGL #3192
Changes from 21 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
1886057
add recipe for EGL
simeonschaub 8c20534
try to fix arm builds
simeonschaub 3dbc914
remove experimental platforms for now
simeonschaub f9d29f1
address review comments
simeonschaub fa44db1
expand cxxstring ABIs, only build amd64 for now
simeonschaub 1ea3398
bundle license
simeonschaub 7e9a48a
fix syntax
simeonschaub ec7d651
only use cxx11 string abi
simeonschaub 20f8129
Merge remote-tracking branch 'upstream/master' into sds/EGL
simeonschaub 75f15ba
rename to Mesa_EGL
simeonschaub 20eea78
Update E/EGL/build_tarballs.jl
simeonschaub c455a81
update version and use Mesa version number
simeonschaub 7db25cf
Update M/Mesa_EGL/build_tarballs.jl
giordano 9648b2b
use Wayland_jll for the headers
simeonschaub 40f2f7d
Fix library search
jpsamaroo af25704
Fix llvm-config with cross-file
jpsamaroo 229d0f2
fix build on glibc by disabling `static_assert`
simeonschaub 8b57cc7
Apply suggestions from code review
simeonschaub 19aa3bf
Remove wayland-scanner no-native patching
jpsamaroo 39c08e9
Fixup pkg-config paths to Wayland_jll
jpsamaroo ce6ee08
Update M/Mesa_EGL/build_tarballs.jl
giordano 6027ae4
Update M/Mesa_EGL/build_tarballs.jl
giordano File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,120 @@ | ||
# 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/ | ||
|
||
# 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 | ||
|
||
# Ensure pkg-config sees our Wayland configs | ||
export PKG_CONFIG_PATH=${host_libdir}/pkgconfig:$PKG_CONFIG_PATH | ||
|
||
# Fixup paths in Wayland pkg-config files | ||
sed -i "s?prefix=.*?prefix=${host_prefix}?" "${host_prefix}/lib/pkgconfig/wayland-scanner.pc" | ||
sed -i "s?prefix=.*?prefix=${host_prefix}?" "${host_prefix}/lib/pkgconfig/wayland-client.pc" | ||
sed -i "s?prefix=.*?prefix=${host_prefix}?" "${host_prefix}/lib/pkgconfig/wayland-server.pc" | ||
|
||
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 = [ | ||
HostBuildDependency("Wayland_jll"), | ||
Dependency("libLLVM_jll"; compat="11.0.0"), | ||
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_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) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
So this will work only in julia v1.6?
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
@vchuravy what's the kosher way of dealing with this? Use
libLLVM_jll
as dependency but not specify a compat? UselibLLVM_jll
as aBuildDependency
(libllvm will be anyway available at runtime)? Or perhaps followLLVMExtra
now that we have that mechanism in place?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.
Ok, seeing that this links directly to
libLLVM-11jl.so
I think the the LLVMExtra's approach is the way to go. I'm actually surprised it worked for you with other Julia versions with different LLVM 🤔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.
Oh, no, it didn't 😄 I had to switch which libLLVM I imported.