20 , withX11 ? !stdenv.hostPlatform.isDarwin
27 , withWayland ? !stdenv.hostPlatform.isDarwin
34 rlinkLibs = if stdenv.hostPlatform.isDarwin then [
36 darwin.apple_sdk_11_0.frameworks.AppKit
37 darwin.apple_sdk_11_0.frameworks.AVFoundation
38 darwin.apple_sdk_11_0.frameworks.MetalKit
39 darwin.apple_sdk_11_0.frameworks.Vision
41 (lib.getLib gcc-unwrapped)
46 ] ++ lib.optionals withX11 [
52 ] ++ lib.optionals withWayland [
56 rustPlatform.buildRustPackage rec {
60 src = fetchFromGitHub {
64 hash = "sha256-10E7tIuix0BGKFbADLhcReRC01FXV/dBivJjfSe/X/c=";
67 cargoHash = "sha256-yGOvY5+ThSey/k8ilTTC0CzaOIJtc4hDYmdrHJC3HyE=";
71 ] ++ lib.optionals stdenv.hostPlatform.isLinux [
77 runtimeDependencies = rlinkLibs;
79 buildInputs = rlinkLibs;
81 outputs = [ "out" "terminfo" ];
83 buildNoDefaultFeatures = true;
85 ++ lib.optional withX11 "x11"
86 ++ lib.optional withWayland "wayland";
89 # Fail to run in sandbox environment.
90 "--skip=sys::unix::eventedfd::EventedFd"
94 install -D -m 644 misc/rio.desktop -t $out/share/applications
95 install -D -m 644 misc/logo.svg \
96 $out/share/icons/hicolor/scalable/apps/rio.svg
98 install -dm 755 "$terminfo/share/terminfo/r/"
99 tic -xe rio,rio-direct -o "$terminfo/share/terminfo" misc/rio.terminfo
100 mkdir -p $out/nix-support
101 echo "$terminfo" >> $out/nix-support/propagated-user-env-packages
102 '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
103 mkdir $out/Applications/
104 mv misc/osx/Rio.app/ $out/Applications/
105 mkdir $out/Applications/Rio.app/Contents/MacOS/
106 ln -s $out/bin/rio $out/Applications/Rio.app/Contents/MacOS/
110 updateScript = nix-update-script {
111 extraArgs = [ "--version-regex" "v([0-9.]+)" ];
115 version = testers.testVersion { package = rio; };
116 } // lib.optionalAttrs stdenv.buildPlatform.isLinux {
117 # FIXME: Restrict test execution inside nixosTests for Linux devices as ofborg
118 # 'passthru.tests' nixosTests are failing on Darwin architectures.
120 # Ref: https://github.com/NixOS/nixpkgs/issues/345825
121 test = nixosTests.terminal-emulators.rio;
126 description = "Hardware-accelerated GPU terminal emulator powered by WebGPU";
127 homepage = "https://raphamorim.io/rio";
128 license = lib.licenses.mit;
129 maintainers = with lib.maintainers; [ tornax otavio oluceps ];
130 platforms = lib.platforms.unix;
131 changelog = "https://github.com/raphamorim/rio/blob/v${version}/docs/docs/releases.md";