From 698b92d7fb26680ebb0328c5c6c985071ff79a0a Mon Sep 17 00:00:00 2001 From: Brian Picciano Date: Mon, 17 Jun 2024 12:43:47 +0200 Subject: Fix X server not picking up system library files --- alacritty/default.nix | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'alacritty') diff --git a/alacritty/default.nix b/alacritty/default.nix index e9a955d..9350884 100644 --- a/alacritty/default.nix +++ b/alacritty/default.nix @@ -57,27 +57,20 @@ alacritty = pkgs.writeShellScriptBin "alacritty" '' set -e -x - host_ld_lib_path="$( - ldconfig -v 2>/dev/null \ - | grep -v ^$'\t' \ - | tr -s ':\n' ':' \ - | head -c-1 \ - )" + source "${pkgs.ldUtils}" - bin_ld_lib_path="$( - objdump -x ${pkgs.alacritty}/bin/alacritty \ - | grep "RUNPATH" \ - | awk '{print $2}' \ - )" + host_ld_lib_path="$(host_ld_lib_path)" host_dri_path="$( - echo "$host_ld_lib_path" \ + echo "$host_lib_path" \ | tr -s ':' '\n' \ | while read d; do if [ -d "$d/dri" ]; then echo "$d"/dri; fi; done \ | tr '\n' ':' \ | head -c-1 )" + bin_ld_lib_path="$(bin_ld_lib_path "${pkgs.alacritty}/bin/alacritty")" + # overwrite LD_LIBRARY_PATH such that the binary's ld search path is still # searched first, but afterwards the host's ld search path is looked # through. Similarly, the dri paths are set to be the hosts. This allows us -- cgit v1.2.3