2020-03-19 03:48:31 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2020-11-13 18:54:56 +00:00
|
|
|
, nixosTests
|
2020-03-19 03:48:31 +00:00
|
|
|
|
|
|
|
, cmake
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, ncurses
|
2021-01-19 06:50:56 +00:00
|
|
|
, pkg-config
|
2020-03-19 03:48:31 +00:00
|
|
|
, python3
|
2023-12-28 11:45:13 +00:00
|
|
|
, scdoc
|
2020-03-19 03:48:31 +00:00
|
|
|
|
|
|
|
, expat
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, libGL
|
2022-10-13 22:16:16 +00:00
|
|
|
, xorg
|
2020-03-19 03:48:31 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, wayland
|
2021-02-01 08:05:09 +00:00
|
|
|
, xdg-utils
|
2019-06-10 02:42:21 +00:00
|
|
|
|
2024-11-04 19:07:42 +00:00
|
|
|
, apple-sdk_11
|
2020-03-19 03:48:31 +00:00
|
|
|
}:
|
2017-07-29 11:41:04 +00:00
|
|
|
let
|
|
|
|
rpathLibs = [
|
|
|
|
expat
|
|
|
|
fontconfig
|
2019-06-10 02:42:21 +00:00
|
|
|
freetype
|
2023-06-05 08:09:19 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isLinux [
|
2019-06-10 02:42:21 +00:00
|
|
|
libGL
|
2022-10-13 22:16:16 +00:00
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXxf86vm
|
|
|
|
xorg.libxcb
|
2019-02-21 07:12:30 +00:00
|
|
|
libxkbcommon
|
2019-06-10 02:42:21 +00:00
|
|
|
wayland
|
2017-07-29 11:41:04 +00:00
|
|
|
];
|
2020-03-19 03:48:31 +00:00
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2019-04-08 22:30:18 +00:00
|
|
|
pname = "alacritty";
|
2024-10-23 01:29:32 +00:00
|
|
|
version = "0.14.0";
|
2017-04-01 15:06:19 +00:00
|
|
|
|
2018-10-11 09:45:42 +00:00
|
|
|
src = fetchFromGitHub {
|
2020-03-19 03:48:31 +00:00
|
|
|
owner = "alacritty";
|
2019-04-08 22:30:18 +00:00
|
|
|
repo = pname;
|
2022-03-01 02:01:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-10-23 01:29:32 +00:00
|
|
|
hash = "sha256-ZhkuuxTx2y8vOfxfpDpJAyNyDdRWab0pqyDdbOCQ2XE=";
|
2017-04-01 15:06:19 +00:00
|
|
|
};
|
|
|
|
|
2024-10-23 01:29:32 +00:00
|
|
|
cargoHash = "sha256-T+/G2z7H/egJ/IlP3KA31jydg1CmFdLW8bLYSf/yWck=";
|
2017-04-01 15:06:19 +00:00
|
|
|
|
2017-11-13 16:26:44 +00:00
|
|
|
nativeBuildInputs = [
|
2017-04-01 15:06:19 +00:00
|
|
|
cmake
|
2020-01-09 16:18:13 +00:00
|
|
|
installShellFiles
|
2017-04-01 15:06:19 +00:00
|
|
|
makeWrapper
|
2018-07-19 14:59:43 +00:00
|
|
|
ncurses
|
2021-01-19 06:50:56 +00:00
|
|
|
pkg-config
|
2019-06-10 02:42:21 +00:00
|
|
|
python3
|
2023-12-28 11:45:13 +00:00
|
|
|
scdoc
|
2017-11-13 16:26:44 +00:00
|
|
|
];
|
|
|
|
|
2018-05-19 06:53:23 +00:00
|
|
|
buildInputs = rpathLibs
|
2020-11-25 01:16:54 +00:00
|
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
2024-11-04 19:07:42 +00:00
|
|
|
apple-sdk_11
|
2020-03-19 03:48:31 +00:00
|
|
|
];
|
2017-04-01 15:06:19 +00:00
|
|
|
|
2018-11-03 15:39:14 +00:00
|
|
|
outputs = [ "out" "terminfo" ];
|
2020-03-19 03:48:31 +00:00
|
|
|
|
2024-02-13 07:45:01 +00:00
|
|
|
postPatch = lib.optionalString stdenv.hostPlatform.isLinux ''
|
2021-05-19 18:55:47 +00:00
|
|
|
substituteInPlace alacritty/src/config/ui_config.rs \
|
2021-02-01 08:05:09 +00:00
|
|
|
--replace xdg-open ${xdg-utils}/bin/xdg-open
|
2020-02-20 13:12:47 +00:00
|
|
|
'';
|
2018-11-03 15:39:14 +00:00
|
|
|
|
2022-01-23 12:31:54 +00:00
|
|
|
checkFlags = [ "--skip=term::test::mock_term" ]; # broken on aarch64
|
|
|
|
|
2021-02-26 20:59:45 +00:00
|
|
|
postInstall = (
|
2020-03-19 03:48:31 +00:00
|
|
|
if stdenv.hostPlatform.isDarwin then ''
|
|
|
|
mkdir $out/Applications
|
2020-06-20 09:20:00 +00:00
|
|
|
cp -r extra/osx/Alacritty.app $out/Applications
|
|
|
|
ln -s $out/bin $out/Applications/Alacritty.app/Contents/MacOS
|
2020-03-19 03:48:31 +00:00
|
|
|
'' else ''
|
|
|
|
install -D extra/linux/Alacritty.desktop -t $out/share/applications/
|
2022-09-24 15:18:53 +00:00
|
|
|
install -D extra/linux/org.alacritty.Alacritty.appdata.xml -t $out/share/appdata/
|
2020-05-06 19:13:41 +00:00
|
|
|
install -D extra/logo/compat/alacritty-term.svg $out/share/icons/hicolor/scalable/apps/Alacritty.svg
|
2020-04-20 03:48:04 +00:00
|
|
|
|
|
|
|
# patchelf generates an ELF that binutils' "strip" doesn't like:
|
|
|
|
# strip: not enough room for program headers, try linking with -N
|
|
|
|
# As a workaround, strip manually before running patchelf.
|
2023-04-07 07:27:17 +00:00
|
|
|
$STRIP -S $out/bin/alacritty
|
2020-04-20 03:48:04 +00:00
|
|
|
|
2023-06-30 18:16:28 +00:00
|
|
|
patchelf --add-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/alacritty
|
2020-03-19 03:48:31 +00:00
|
|
|
''
|
|
|
|
) + ''
|
2020-01-09 16:18:13 +00:00
|
|
|
installShellCompletion --zsh extra/completions/_alacritty
|
|
|
|
installShellCompletion --bash extra/completions/alacritty.bash
|
|
|
|
installShellCompletion --fish extra/completions/alacritty.fish
|
2018-07-07 15:19:23 +00:00
|
|
|
|
2018-07-19 14:59:43 +00:00
|
|
|
install -dm 755 "$out/share/man/man1"
|
2023-12-28 11:45:13 +00:00
|
|
|
install -dm 755 "$out/share/man/man5"
|
2018-07-19 14:59:43 +00:00
|
|
|
|
2023-12-28 11:45:13 +00:00
|
|
|
scdoc < extra/man/alacritty.1.scd | gzip -c > $out/share/man/man1/alacritty.1.gz
|
|
|
|
scdoc < extra/man/alacritty-msg.1.scd | gzip -c > $out/share/man/man1/alacritty-msg.1.gz
|
|
|
|
scdoc < extra/man/alacritty.5.scd | gzip -c > $out/share/man/man5/alacritty.5.gz
|
|
|
|
scdoc < extra/man/alacritty-bindings.5.scd | gzip -c > $out/share/man/man5/alacritty-bindings.5.gz
|
2020-06-14 02:53:56 +00:00
|
|
|
|
2018-07-19 14:59:43 +00:00
|
|
|
install -dm 755 "$terminfo/share/terminfo/a/"
|
2019-03-12 14:12:40 +00:00
|
|
|
tic -xe alacritty,alacritty-direct -o "$terminfo/share/terminfo" extra/alacritty.info
|
2018-07-19 14:59:43 +00:00
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
|
2017-04-01 15:06:19 +00:00
|
|
|
'';
|
|
|
|
|
2017-07-29 11:41:04 +00:00
|
|
|
dontPatchELF = true;
|
2017-04-01 15:06:19 +00:00
|
|
|
|
2020-11-13 18:54:56 +00:00
|
|
|
passthru.tests.test = nixosTests.terminal-emulators.alacritty;
|
|
|
|
|
2020-03-19 03:48:31 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Cross-platform, GPU-accelerated terminal emulator";
|
|
|
|
homepage = "https://github.com/alacritty/alacritty";
|
2020-01-09 16:18:13 +00:00
|
|
|
license = licenses.asl20;
|
2023-08-26 12:03:52 +00:00
|
|
|
mainProgram = "alacritty";
|
2023-03-03 20:17:25 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne mic92 ];
|
2020-01-09 16:18:13 +00:00
|
|
|
platforms = platforms.unix;
|
2021-02-10 22:19:11 +00:00
|
|
|
changelog = "https://github.com/alacritty/alacritty/blob/v${version}/CHANGELOG.md";
|
2017-04-01 15:06:19 +00:00
|
|
|
};
|
|
|
|
}
|