-
-
Notifications
You must be signed in to change notification settings - Fork 119
/
pkgRio.nix
90 lines (86 loc) · 1.9 KB
/
pkgRio.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
{
rust-toolchain,
makeRustPlatform,
stdenv,
lib,
fontconfig,
darwin,
gcc-unwrapped,
libGL,
libxkbcommon,
vulkan-loader,
libX11,
libXcursor,
libXi,
libXrandr,
libxcb,
wayland,
ncurses,
pkg-config,
cmake,
autoPatchelfHook,
withX11 ? !stdenv.isDarwin,
withWayland ? !stdenv.isDarwin,
...
}: let
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);
rustPlatform = makeRustPlatform {
cargo = rust-toolchain;
rustc = rust-toolchain;
};
rlinkLibs =
if stdenv.isDarwin
then [
darwin.libobjc
darwin.apple_sdk_11_0.frameworks.AppKit
darwin.apple_sdk_11_0.frameworks.AVFoundation
darwin.apple_sdk_11_0.frameworks.MetalKit
darwin.apple_sdk_11_0.frameworks.Vision
]
else
[
(lib.getLib gcc-unwrapped)
fontconfig
libGL
libxkbcommon
vulkan-loader
]
++ lib.optionals withX11 [
libX11
libXcursor
libXi
libXrandr
libxcb
]
++ lib.optionals withWayland [
wayland
];
in
rustPlatform.buildRustPackage {
inherit (cargoToml.workspace.package) version;
name = "rio";
src = ./.;
cargoLock.lockFile = ./Cargo.lock;
cargoBuildFlags = "-p rioterm";
buildInputs = rlinkLibs;
runtimeDependencies = rlinkLibs;
nativeBuildInputs =
[
ncurses
]
++ lib.optionals stdenv.isLinux [
pkg-config
cmake
autoPatchelfHook
];
buildNoDefaultFeatures = true;
buildFeatures = ["x11" "wayland"];
meta = {
description = "A hardware-accelerated GPU terminal emulator focusing to run in desktops and browsers";
homepage = "https://raphamorim.io/rio";
license = lib.licenses.mit;
platforms = lib.platforms.unix;
changelog = "https://github.com/raphamorim/rio/blob/master/CHANGELOG.md";
mainProgram = "rio";
};
}