2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2022-03-30 09:31:56 +00:00
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, cmake
|
|
|
|
, installShellFiles
|
|
|
|
, makeWrapper
|
|
|
|
, ncurses
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, python3
|
2024-01-13 08:15:51 +00:00
|
|
|
, scdoc
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
, expat
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, libGL
|
2022-10-21 18:38:19 +00:00
|
|
|
, xorg
|
2020-04-24 23:36:52 +00:00
|
|
|
, libxkbcommon
|
|
|
|
, wayland
|
2021-02-05 17:12:51 +00:00
|
|
|
, xdg-utils
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Darwin Frameworks
|
|
|
|
, AppKit
|
|
|
|
, CoreGraphics
|
|
|
|
, CoreServices
|
|
|
|
, CoreText
|
|
|
|
, Foundation
|
2021-05-28 09:39:13 +00:00
|
|
|
, libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
, OpenGL
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
rpathLibs = [
|
|
|
|
expat
|
|
|
|
fontconfig
|
|
|
|
freetype
|
2023-07-15 17:15:38 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2020-04-24 23:36:52 +00:00
|
|
|
libGL
|
2022-10-21 18:38:19 +00:00
|
|
|
xorg.libX11
|
|
|
|
xorg.libXcursor
|
|
|
|
xorg.libXi
|
|
|
|
xorg.libXrandr
|
|
|
|
xorg.libXxf86vm
|
|
|
|
xorg.libxcb
|
2020-04-24 23:36:52 +00:00
|
|
|
libxkbcommon
|
|
|
|
wayland
|
|
|
|
];
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "alacritty";
|
2024-01-13 08:15:51 +00:00
|
|
|
version = "0.13.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "alacritty";
|
|
|
|
repo = pname;
|
2022-03-05 16:20:37 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-01-13 08:15:51 +00:00
|
|
|
hash = "sha256-Nn/G7SkRuHXRSRgNjlmdX1G07sp7FPx8UyAn63Nivfg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
cargoHash = "sha256-vCoKaDd0mQRF6NNfK679FhEXuAdn/1o3F1gTfT8NK+0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
installShellFiles
|
|
|
|
makeWrapper
|
|
|
|
ncurses
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
python3
|
2024-01-13 08:15:51 +00:00
|
|
|
scdoc
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = rpathLibs
|
2020-11-30 08:33:03 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [
|
2020-04-24 23:36:52 +00:00
|
|
|
AppKit
|
|
|
|
CoreGraphics
|
|
|
|
CoreServices
|
|
|
|
CoreText
|
|
|
|
Foundation
|
2021-05-28 09:39:13 +00:00
|
|
|
libiconv
|
2020-04-24 23:36:52 +00:00
|
|
|
OpenGL
|
|
|
|
];
|
|
|
|
|
|
|
|
outputs = [ "out" "terminfo" ];
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
postPatch = lib.optionalString (!xdg-utils.meta.broken) ''
|
2021-05-20 23:08:51 +00:00
|
|
|
substituteInPlace alacritty/src/config/ui_config.rs \
|
2021-02-05 17:12:51 +00:00
|
|
|
--replace xdg-open ${xdg-utils}/bin/xdg-open
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
checkFlags = [ "--skip=term::test::mock_term" ]; # broken on aarch64
|
|
|
|
|
2021-03-09 03:18:52 +00:00
|
|
|
postInstall = (
|
2020-04-24 23:36:52 +00:00
|
|
|
if stdenv.isDarwin then ''
|
|
|
|
mkdir $out/Applications
|
2020-06-15 15:56:04 +00:00
|
|
|
cp -r extra/osx/Alacritty.app $out/Applications
|
|
|
|
ln -s $out/bin $out/Applications/Alacritty.app/Contents/MacOS
|
2020-04-24 23:36:52 +00:00
|
|
|
'' else ''
|
|
|
|
install -D extra/linux/Alacritty.desktop -t $out/share/applications/
|
2022-09-30 11:47:45 +00:00
|
|
|
install -D extra/linux/org.alacritty.Alacritty.appdata.xml -t $out/share/appdata/
|
2020-05-15 21:57:56 +00:00
|
|
|
install -D extra/logo/compat/alacritty-term.svg $out/share/icons/hicolor/scalable/apps/Alacritty.svg
|
2020-04-24 23:36:52 +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-12 12:48:02 +00:00
|
|
|
$STRIP -S $out/bin/alacritty
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
patchelf --add-rpath "${lib.makeLibraryPath rpathLibs}" $out/bin/alacritty
|
2020-04-24 23:36:52 +00:00
|
|
|
''
|
|
|
|
) + ''
|
|
|
|
installShellCompletion --zsh extra/completions/_alacritty
|
|
|
|
installShellCompletion --bash extra/completions/alacritty.bash
|
|
|
|
installShellCompletion --fish extra/completions/alacritty.fish
|
|
|
|
|
|
|
|
install -dm 755 "$out/share/man/man1"
|
2024-01-13 08:15:51 +00:00
|
|
|
install -dm 755 "$out/share/man/man5"
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-13 08:15:51 +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-18 07:06:33 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
install -dm 755 "$terminfo/share/terminfo/a/"
|
|
|
|
tic -xe alacritty,alacritty-direct -o "$terminfo/share/terminfo" extra/alacritty.info
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
|
|
|
|
'';
|
|
|
|
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
passthru.tests.test = nixosTests.terminal-emulators.alacritty;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A cross-platform, GPU-accelerated terminal emulator";
|
|
|
|
homepage = "https://github.com/alacritty/alacritty";
|
|
|
|
license = licenses.asl20;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "alacritty";
|
2023-03-04 12:14:45 +00:00
|
|
|
maintainers = with maintainers; [ Br1ght0ne mic92 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
2021-04-05 15:23:46 +00:00
|
|
|
changelog = "https://github.com/alacritty/alacritty/blob/v${version}/CHANGELOG.md";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|