Created
April 30, 2019 20:49
-
-
Save yorickvP/aa5b1af2a7a18513b7324443b758fc76 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { stdenv, | |
| lib, | |
| fetchFromGitHub, | |
| rustPlatform, | |
| cmake, | |
| makeWrapper, | |
| ncurses, | |
| expat, | |
| pkgconfig, | |
| freetype, | |
| fontconfig, | |
| libX11, | |
| gzip, | |
| libXcursor, | |
| libXxf86vm, | |
| libXi, | |
| libXrandr, | |
| libGL, | |
| wayland, | |
| libxkbcommon, | |
| python3, | |
| libxcb | |
| # Darwin Frameworks | |
| }: | |
| with rustPlatform; | |
| let | |
| rpathLibs = [ | |
| expat | |
| freetype | |
| fontconfig | |
| libX11 | |
| libXcursor | |
| libXxf86vm | |
| libXrandr | |
| libGL | |
| libXi | |
| python3 | |
| libxcb | |
| ] ++ lib.optionals stdenv.isLinux [ | |
| wayland | |
| libxkbcommon | |
| ]; | |
| in buildRustPackage rec { | |
| pname = "alacritty"; | |
| version = "0.3.3-20190430"; | |
| src = fetchFromGitHub { | |
| owner = "jwilm"; | |
| repo = pname; | |
| rev = "bc038f8295830cbd66851d308fd2963f2e0eb60c"; | |
| sha256 = "14kjlilbkh589vb2xq2agw54blwn3vk0lxs0plkhnf3jrib3k6nd"; | |
| }; | |
| cargoSha256 = "04mfdm0b7jj0mkchrzzq9bm99m5y9h4ajj848kkf679k5wfiqc12"; | |
| nativeBuildInputs = [ | |
| cmake | |
| makeWrapper | |
| pkgconfig | |
| ncurses | |
| gzip | |
| ]; | |
| buildInputs = rpathLibs; | |
| outputs = [ "out" "terminfo" ]; | |
| installPhase = '' | |
| runHook preInstall | |
| install -D target/release/alacritty $out/bin/alacritty | |
| '' + (if stdenv.isDarwin then '' | |
| mkdir $out/Applications | |
| cp -r target/release/osx/Alacritty.app $out/Applications/Alacritty.app | |
| '' else '' | |
| install -D extra/linux/alacritty.desktop -t $out/share/applications/ | |
| install -D extra/logo/alacritty-term.svg $out/share/icons/hicolor/scalable/apps/Alacritty.svg | |
| patchelf --set-rpath "${stdenv.lib.makeLibraryPath rpathLibs}" $out/bin/alacritty | |
| '') + '' | |
| install -D extra/completions/_alacritty -t "$out/share/zsh/site-functions/" | |
| install -D extra/completions/alacritty.bash -t "$out/etc/bash_completion.d/" | |
| install -D extra/completions/alacritty.fish -t "$out/share/fish/vendor_completions.d/" | |
| install -dm 755 "$out/share/man/man1" | |
| gzip -c extra/alacritty.man > "$out/share/man/man1/alacritty.1.gz" | |
| install -dm 755 "$terminfo/share/terminfo/a/" | |
| tic -x -o "$terminfo/share/terminfo" extra/alacritty.info | |
| mkdir -p $out/nix-support | |
| echo "$terminfo" >> $out/nix-support/propagated-user-env-packages | |
| runHook postInstall | |
| ''; | |
| dontPatchELF = true; | |
| meta = with stdenv.lib; { | |
| description = "GPU-accelerated terminal emulator"; | |
| homepage = https://github.com/jwilm/alacritty; | |
| license = with licenses; [ asl20 ]; | |
| maintainers = with maintainers; [ mic92 ]; | |
| platforms = [ "x86_64-linux" "x86_64-darwin" ]; | |
| }; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment