Skip to content

Commit

Permalink
chromium: add rpath to libGLESv2.so from libANGLE (#269345)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lilyinstarlight authored Nov 23, 2023
1 parent 87f2a03 commit fa094c6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkgs/applications/networking/browsers/chromium/common.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down

0 comments on commit fa094c6

Please sign in to comment.