Skip to content

Commit

Permalink
Merge pull request #85908 from paumr/release-20.03-alacritty
Browse files Browse the repository at this point in the history
[20.03] alacritty: backport 0.4.2
  • Loading branch information
worldofpeace committed Apr 25, 2020
2 parents 6c2e7b2 + aa9ea94 commit 4b6bfec
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 53 deletions.
10 changes: 10 additions & 0 deletions maintainers/maintainer-list.nix
Expand Up @@ -1427,6 +1427,16 @@
githubId = 5684605;
name = "Cole Scott";
};
cole-h = {
name = "Cole Helbling";
email = "cole.e.helbling@outlook.com";
github = "cole-h";
githubId = 28582702;
keys = [{
longkeyid = "rsa4096/0xB37E0F2371016A4C";
fingerprint = "68B8 0D57 B2E5 4AC3 EC1F 49B0 B37E 0F23 7101 6A4C";
}];
};
copumpkin = {
email = "pumpkingod@gmail.com";
github = "copumpkin";
Expand Down
115 changes: 62 additions & 53 deletions pkgs/applications/misc/alacritty/default.nix
@@ -1,40 +1,38 @@
{ stdenv,
lib,
fetchFromGitHub,
rustPlatform,

cmake,
gzip,
installShellFiles,
makeWrapper,
ncurses,
pkgconfig,
python3,

expat,
fontconfig,
freetype,
libGL,
libX11,
libXcursor,
libXi,
libXrandr,
libXxf86vm,
libxcb,
libxkbcommon,
wayland,
xdg_utils,
{ stdenv
, lib
, fetchFromGitHub
, rustPlatform

, cmake
, gzip
, installShellFiles
, makeWrapper
, ncurses
, pkgconfig
, python3

, expat
, fontconfig
, freetype
, libGL
, libX11
, libXcursor
, libXi
, libXrandr
, libXxf86vm
, libxcb
, libxkbcommon
, wayland
, xdg_utils

# Darwin Frameworks
AppKit,
CoreGraphics,
CoreServices,
CoreText,
Foundation,
OpenGL }:

with rustPlatform;

, AppKit
, CoreGraphics
, CoreServices
, CoreText
, Foundation
, OpenGL
}:
let
rpathLibs = [
expat
Expand All @@ -51,18 +49,19 @@ let
libxkbcommon
wayland
];
in buildRustPackage rec {
in
rustPlatform.buildRustPackage rec {
pname = "alacritty";
version = "0.4.1";
version = "0.4.2";

src = fetchFromGitHub {
owner = "jwilm";
owner = "alacritty";
repo = pname;
rev = "v${version}";
sha256 = "05jcg33ifngpzw2hdhgb614j87ihhhlqgar0kky183rywg0dxikg";
sha256 = "133d8vm7ihlvgw8n1jghhh35h664h0f52h6gci54f11vl6c1spws";
};

cargoSha256 = "1kc9n10kb4j87x337pzl6wpi0qj5ib2mqmrjag2yld3138dag71n";
cargoSha256 = "0y7yzbl6hyb89f2lcn3s65jbrzibr8b8x7l84iriw6ifsqnvcyg5";

nativeBuildInputs = [
cmake
Expand All @@ -75,9 +74,17 @@ in buildRustPackage rec {
];

buildInputs = rpathLibs
++ lib.optionals stdenv.isDarwin [ AppKit CoreGraphics CoreServices CoreText Foundation OpenGL ];
++ lib.optionals stdenv.isDarwin [
AppKit
CoreGraphics
CoreServices
CoreText
Foundation
OpenGL
];

outputs = [ "out" "terminfo" ];

postPatch = ''
substituteInPlace alacritty/src/config/mouse.rs \
--replace xdg-open ${xdg_utils}/bin/xdg-open
Expand All @@ -90,14 +97,16 @@ in buildRustPackage rec {
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
'') + ''
'' + (
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 "${lib.makeLibraryPath rpathLibs}" $out/bin/alacritty
''
) + ''
installShellCompletion --zsh extra/completions/_alacritty
installShellCompletion --bash extra/completions/alacritty.bash
Expand All @@ -116,11 +125,11 @@ in buildRustPackage rec {

dontPatchELF = true;

meta = with stdenv.lib; {
description = "GPU-accelerated terminal emulator";
homepage = "https://github.com/jwilm/alacritty";
meta = with lib; {
description = "A cross-platform, GPU-accelerated terminal emulator";
homepage = "https://github.com/alacritty/alacritty";
license = licenses.asl20;
maintainers = with maintainers; [ filalex77 mic92 ];
maintainers = with maintainers; [ filalex77 mic92 cole-h ];
platforms = platforms.unix;
};
}

0 comments on commit 4b6bfec

Please sign in to comment.