From ecc79631935e2a4ea3c64461d48bcb093b7a0585 Mon Sep 17 00:00:00 2001 From: Asahi Lina Date: Nov 08 2024 12:10:48 +0000 Subject: Work around libcapsule bug & missing ldconfig for overlays See: https://github.com/ValveSoftware/steam-runtime/issues/704 --- diff --git a/mesa.spec b/mesa.spec index e464a46..a2d7c07 100644 --- a/mesa.spec +++ b/mesa.spec @@ -119,7 +119,7 @@ Name: mesa Summary: Mesa graphics libraries Version: %{lua:ver = string.gsub(rpm.expand("%{ver}"), "-", "~"); print(ver)} -Release: %autorelease +Release: %autorelease -b 2 License: MIT AND BSD-3-Clause AND SGI-B-2.0 URL: http://www.mesa3d.org @@ -226,6 +226,7 @@ BuildRequires: glslang %if 0%{?with_vulkan_hw} BuildRequires: pkgconfig(vulkan) %endif +BuildRequires: patchelf %description %{summary}. @@ -588,6 +589,18 @@ install -Dpm0644 -t "fexov/%{_datadir}/vulkan/implicit_layer.d/" \ %{buildroot}%{_datadir}/vulkan/implicit_layer.d/VkLayer_MESA_device_select.json %endif +# Hack to work around libcapsule bug: +# https://github.com/ValveSoftware/steam-runtime/issues/704 +# +# The FEX overlays do not update ld.so.cache, so ld.so falls back +# to the system library paths. This works fine for ld.so since +# the dependencies are indeed in /usr/lib[64], but libcapsule +# has the fallback harcoded to /lib:/usr/lib, which fails on +# x86_64 systems. +patchelf --add-rpath %{_libdir} "fexov/%{_libdir}/gbm/dri_gbm.so" +patchelf --add-rpath %{_libdir} "fexov/%{_libdir}/libGLX_mesa.so" +patchelf --add-rpath %{_libdir} "fexov/%{_libdir}/libEGL_mesa.so.0.0.0" + #dnl erofs ---------------------------- mkfs.erofs -z lz4 mesa-%{_arch}.erofs fexov