chromium: add rpath to libGLESv2.so from libANGLE (#269345)

Chromium libANGLE-based GL loading was working by accident before, because the cairo lib pulled in libEGL previously (so dlopen didn't need to search rpath when called in libGLESv2) but no longer does and the rpath needs to be added on both the chromium binary and the libGLESv2.so (and yes both even expect to have pciutils available it seems)

Fixes #268490 #269104
This commit is contained in:
Lily Foster 2023-11-23 04:59:03 -05:00 committed by GitHub
parent 87f2a03d25
commit fa094c6dd4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -489,11 +489,11 @@ let
'';
postFixup = ''
# Make sure that libGLESv2 and libvulkan are found by dlopen.
# Make sure that libGLESv2 and libvulkan are found by dlopen in both chromium binary and ANGLE libGLESv2.so.
# libpci (from pciutils) is needed by dlopen in angle/src/gpu_info_util/SystemInfo_libpci.cpp
chromiumBinary="$libExecPath/$packageName"
origRpath="$(patchelf --print-rpath "$chromiumBinary")"
patchelf --set-rpath "${lib.makeLibraryPath [ libGL vulkan-loader pciutils ]}:$origRpath" "$chromiumBinary"
for chromiumBinary in "$libExecPath/$packageName" "$libExecPath/libGLESv2.so"; do
patchelf --set-rpath "${lib.makeLibraryPath [ libGL vulkan-loader pciutils ]}:$(patchelf --print-rpath "$chromiumBinary")" "$chromiumBinary"
done
'';
passthru = {