Files
chromebrew/packages/mesa.rb
SupeChicken666 3ee0c82139 glibc-standalone: Rename to glibc, add a LD_PRELOAD library with useful features (#11911)
* crew: Add a LD_PRELOAD library for hijacking linker/library path

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Add `glibc_{build,dev.lib}` to deprecated package list

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Bump version

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Minor changes

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Move static libraries to CREW_LIB_PREFIX

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Remove glibc_build from const.rb

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Make rubocop happy

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Fix arm build and add binaries.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* cleanup

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust x86_64 unit tests to use the Nocturne M90 container image and armv7l unit tests to use the fievel M91 container image since we are using the same glibc for everything now.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust build containers to use the oldest glibc based containers.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add i686 builds.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add x86_64 build.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Set LD_PRELOAD before running any command

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Use File.join

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* Use File.join

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

* adjust unit tests.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Fix arm CREW_GLIBC_INTERPRETER

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update Rhythmbox

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Update Rhythmbox

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Do not install crew_sudo in container.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Bump version

Signed-off-by: SupeChicken666 <me@supechicken666.dev>

---------

Signed-off-by: SupeChicken666 <me@supechicken666.dev>
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
Co-authored-by: Satadru Pramanik <satadru@gmail.com>
2025-05-20 10:21:15 +00:00

98 lines
3.4 KiB
Ruby

require 'buildsystems/meson'
class Mesa < Meson
description 'Open-source implementation of the OpenGL specification'
homepage 'https://www.mesa3d.org'
version "25.0.4-#{CREW_LLVM_VER}"
license 'MIT'
compatibility 'aarch64 armv7l x86_64'
source_url 'https://gitlab.freedesktop.org/mesa/mesa.git'
git_hashtag "mesa-#{version.split('-')[0..-2].join('-')}"
binary_compression 'tar.zst'
binary_sha256({
aarch64: 'a9513916029c5debb5cbfe47950c4c22691fbe8361281885f55ced83f58a2a34',
armv7l: 'a9513916029c5debb5cbfe47950c4c22691fbe8361281885f55ced83f58a2a34',
x86_64: '346f52e4923501693398a103e8a0f5201fccb21dc2e6d3eac04ed5e16d841c63'
})
depends_on 'elfutils' # R
depends_on 'eudev' # R
depends_on 'expat' # R
depends_on 'gcc_dev' => :build
depends_on 'gcc_lib' # R
depends_on 'glibc' # R
depends_on 'glslang' => :build
depends_on 'libclc' => :build
depends_on 'libdrm' # R
depends_on 'libomxil_bellagio' => :build
depends_on 'libunwind' # R
depends_on 'libva' => :build
depends_on 'libvdpau' => :build
depends_on 'libx11' # R
depends_on 'libxcb' # R
depends_on 'libxdamage' => :build
depends_on 'libxdmcp' => :build
depends_on 'libxext' # R
depends_on 'libxfixes' # R
depends_on 'libxrandr' # R
depends_on 'libxshmfence' # R
depends_on 'libxv' => :build
depends_on 'libxxf86vm' # R
depends_on 'llvm_dev' => :build
depends_on 'llvm_lib' # R
depends_on 'lm_sensors' # R
depends_on 'py3_mako' => :build
depends_on 'py3_ply' => :build
depends_on 'py3_pycparser' => :build
depends_on 'spirv_llvm_translator' => :build
depends_on 'spirv_tools' # R
depends_on 'valgrind' => :build
depends_on 'vulkan_headers' => :build
depends_on 'wayland_protocols' => :build
depends_on 'wayland' # R
depends_on 'xcb_util_keysyms' # R
depends_on 'zlib' # R
depends_on 'zstd' # R
meson_options "#{CREW_MESON_OPTIONS.gsub('-mfpu=vfpv3-d16', '-mfpu=neon-fp16')} \
-Db_asneeded=false \
-Degl=enabled \
-Dgbm=enabled \
-Dgles1=disabled \
-Dgles2=enabled \
-Dglvnd=enabled \
-Dglx=dri \
-Dintel-clc=enabled \
-Dllvm=enabled \
-Dgallium-drivers='#{ARCH == 'x86_64' ? 'i915,r300,r600,radeonsi,nouveau,virgl,svga,softpipe,llvmpipe,iris,crocus,zink' : 'v3d,freedreno,etnaviv,nouveau,svga,tegra,virgl,lima,panfrost,softpipe,llvmpipe,iris,zink'}' \
-Dvulkan-drivers='#{ARCH == 'x86_64' ? 'amd, intel, intel_hasvk, swrast' : 'auto'}' \
-Dvideo-codecs='all'"
meson_install_extras do
# The following are hacks to keep sommelier from complaining.
Dir.chdir("#{CREW_DEST_LIB_PREFIX}/dri") do
FileUtils.ln_s '.', 'tls' unless File.exist?('tls')
end
FileUtils.mkdir_p "#{CREW_DEST_LIB_PREFIX}/gbm/tls"
case ARCH
when 'x86_64'
Dir.chdir("#{CREW_DEST_LIB_PREFIX}/gbm/tls") do
# For Intel GPUs
FileUtils.ln_s '../../libgbm.so', 'i915_gbm.so'
# For AMD GPUs
FileUtils.ln_s '../../libgbm.so', 'amdgpu_gbm.so'
end
when 'armv7l', 'aarch64'
Dir.chdir("#{CREW_DEST_LIB_PREFIX}/gbm/tls") do
FileUtils.ln_s '../../libgbm.so', 'pvr_gbm.so'
end
end
end
def self.patch
# Currently build is locked to use the older version of the spirv_llvm_translator.
system "sed -i \"s#'< @0@.@1@'.format(chosen_llvm_version_major, chosen_llvm_version_minor + 1) ]#'< @0@.@1@'.format(chosen_llvm_version_major + 1, chosen_llvm_version_minor + 1) ]#\" meson.build"
end
end