2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, rustPlatform
|
2023-08-04 22:07:22 +00:00
|
|
|
, nixosTests
|
|
|
|
, nix-update-script
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
, autoPatchelfHook
|
2023-08-04 22:07:22 +00:00
|
|
|
, ncurses
|
2023-07-15 17:15:38 +00:00
|
|
|
, pkg-config
|
|
|
|
|
|
|
|
, gcc-unwrapped
|
|
|
|
, fontconfig
|
|
|
|
, libGL
|
|
|
|
, vulkan-loader
|
|
|
|
, libxkbcommon
|
|
|
|
|
|
|
|
, withX11 ? true
|
|
|
|
, libX11
|
|
|
|
, libXcursor
|
|
|
|
, libXi
|
|
|
|
, libXrandr
|
|
|
|
, libxcb
|
|
|
|
|
|
|
|
, withWayland ? true
|
|
|
|
, wayland
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
rlinkLibs = [
|
|
|
|
(lib.getLib gcc-unwrapped)
|
|
|
|
fontconfig
|
|
|
|
libGL
|
|
|
|
libxkbcommon
|
|
|
|
vulkan-loader
|
|
|
|
] ++ lib.optionals withX11 [
|
|
|
|
libX11
|
|
|
|
libXcursor
|
|
|
|
libXi
|
|
|
|
libXrandr
|
|
|
|
libxcb
|
|
|
|
] ++ lib.optionals withWayland [
|
|
|
|
wayland
|
|
|
|
];
|
|
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "rio";
|
2023-08-04 22:07:22 +00:00
|
|
|
version = "0.0.16";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "raphamorim";
|
|
|
|
repo = "rio";
|
|
|
|
rev = "v${version}";
|
2023-08-04 22:07:22 +00:00
|
|
|
hash = "sha256-jyfobmwDCsvhpKcAD0ivxfRENaTVjjauRBMDNPgvjVY=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
cargoHash = "sha256-efMw07KH8Nic76MWTyf16Gg/8PyM9gZKSNs5cuIKBJQ=";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
autoPatchelfHook
|
2023-08-04 22:07:22 +00:00
|
|
|
ncurses
|
2023-07-15 17:15:38 +00:00
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
|
|
|
runtimeDependencies = rlinkLibs;
|
|
|
|
|
|
|
|
buildInputs = rlinkLibs;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
outputs = [ "out" "terminfo" ];
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildNoDefaultFeatures = true;
|
|
|
|
buildFeatures = [
|
|
|
|
(lib.optionalString withX11 "x11")
|
|
|
|
(lib.optionalString withWayland "wayland")
|
|
|
|
];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
checkFlags = [
|
|
|
|
# Fail to run in sandbox environment.
|
|
|
|
"--skip=screen::context::test"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -dm 755 "$terminfo/share/terminfo/r/"
|
|
|
|
tic -xe rio,rio-direct -o "$terminfo/share/terminfo" misc/rio.terminfo
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
|
|
|
|
'';
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
passthru = {
|
2023-08-04 22:07:22 +00:00
|
|
|
updateScript = nix-update-script {
|
|
|
|
extraArgs = [ "--version-regex" "v([0-9.]+)" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
tests.test = nixosTests.terminal-emulators.rio;
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "A hardware-accelerated GPU terminal emulator powered by WebGPU";
|
|
|
|
homepage = "https://raphamorim.io/rio";
|
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ otavio oluceps ];
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
changelog = "https://github.com/raphamorim/rio/blob/v${version}/CHANGELOG.md";
|
|
|
|
};
|
|
|
|
}
|