alacritty: use patchelf instead of LD_LIBRARY_PATH

If we use LD_LIBRARY_PATH then anything typed into Alacritty inherits it. This
breaks a lot of applications if the versions are different. For me this breaks
everything from Git to every program which uses Gtk.
This commit is contained in:
Brian McKenna 2017-07-29 21:41:04 +10:00
parent 321438d786
commit 9aafecd28b

View file

@ -16,6 +16,18 @@
with rustPlatform;
let
rpathLibs = [
expat
freetype
fontconfig
libX11
libXcursor
libXxf86vm
libXi
];
in
buildRustPackage rec {
name = "alacritty-unstable-2017-07-25";
@ -31,25 +43,19 @@ buildRustPackage rec {
buildInputs = [
cmake
makeWrapper
freetype
fontconfig
xclip
pkgconfig
expat
libX11
libXcursor
libXxf86vm
libXi
];
] ++ rpathLibs;
installPhase = ''
mkdir -p $out/bin
for f in $(find target/release -maxdepth 1 -type f); do
cp $f $out/bin
done;
wrapProgram $out/bin/alacritty --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath buildInputs}"
patchelf --set-rpath "${stdenv.lib.makeLibraryPath rpathLibs}" $out/bin/alacritty
'';
dontPatchELF = true;
meta = with stdenv.lib; {
description = "GPU-accelerated terminal emulator";