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
1 changed files with 15 additions and 9 deletions

View File

@ -16,6 +16,18 @@
with rustPlatform; with rustPlatform;
let
rpathLibs = [
expat
freetype
fontconfig
libX11
libXcursor
libXxf86vm
libXi
];
in
buildRustPackage rec { buildRustPackage rec {
name = "alacritty-unstable-2017-07-25"; name = "alacritty-unstable-2017-07-25";
@ -31,25 +43,19 @@ buildRustPackage rec {
buildInputs = [ buildInputs = [
cmake cmake
makeWrapper makeWrapper
freetype
fontconfig
xclip xclip
pkgconfig pkgconfig
expat ] ++ rpathLibs;
libX11
libXcursor
libXxf86vm
libXi
];
installPhase = '' installPhase = ''
mkdir -p $out/bin mkdir -p $out/bin
for f in $(find target/release -maxdepth 1 -type f); do for f in $(find target/release -maxdepth 1 -type f); do
cp $f $out/bin cp $f $out/bin
done; 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; { meta = with stdenv.lib; {
description = "GPU-accelerated terminal emulator"; description = "GPU-accelerated terminal emulator";