Skip to content

Instantly share code, notes, and snippets.

@gilligan
Last active March 17, 2017 20:59
Show Gist options
  • Save gilligan/63d4d4832fae996f3225cb59345c689e to your computer and use it in GitHub Desktop.
Save gilligan/63d4d4832fae996f3225cb59345c689e to your computer and use it in GitHub Desktop.
{ stdenv,
cmake,
freetype,
fontconfig,
xclip,
pkgconfig,
fetchFromGitHub,
libX11,
gperf,
libXcursor,
libXxf86vm,
libXi,
rustPlatform
}:
with rustPlatform;
buildRustPackage rec {
name = "ethabi-${version}";
version = "git";
src = fetchFromGitHub {
owner = "jwilm";
repo = "alacritty";
rev = "715d4f8be8b80604a0b6a8464e55a60660f810a0";
sha256 = "1asqqaz4n6flax0sw90ry1f9gp0kfs7bzpjpa652a8ja5xpl82a8";
};
depsSha256 = "1vag8dxz67qvrp5x5xccy88aibxy2ih1bz14bmjgi9zwrv17gz6v";
buildInputs = [ cmake xclip freetype fontconfig ];
nativeBuildInputs = [
pkgconfig
libX11
libXcursor
libXxf86vm
libXi
fontconfig
];
meta = {
description = "A cross-platform, GPU-accelerated terminal emulator";
homepage = https://github.com/jwilm/alacritty/;
};
}
@gilligan
Copy link
Author

$ ./result/bin/alacritty 
Alacritty encountered an unrecoverable error:

        Error creating glutin::Window; No backend is available

@jansol
Copy link

jansol commented Mar 17, 2017

This is caused by glutin relying on dlopen() to open the X11 libraries. Make sure those are in LD_LIBRARY_PATH.
AFAIK you'll have to wrap the binary to achieve that. Build a libpath with pkgs.stdenv.lib.makeLibraryPath and append that to the wrapper with --suffix LD_LIBRARY_PATH : ${yourlibrarypath}

Alternatively you could ensure they are present in the binary's rpath, but that requires deeper knowledge of the construction of ELF binaries than I posses.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment