-
-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flake: add
apps
entry and fix runtime error (#412)
* flake: add `apps` entry and fix runtime error flake: fix package creation * flake: update program path for default app Co-authored-by: Steve Mathew Joy <[email protected]> * flake: move rio package creation to external file --------- Co-authored-by: Steve Mathew Joy <[email protected]>
- Loading branch information
Showing
2 changed files
with
125 additions
and
87 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ rustPlatform | ||
, 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); | ||
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.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"; | ||
}; | ||
} |