91 lines
2.2 KiB
Nix
91 lines
2.2 KiB
Nix
{ lib
|
|
, stdenv
|
|
, fetchurl
|
|
, autoPatchelfHook
|
|
, makeWrapper
|
|
, wayland
|
|
, libxkbcommon
|
|
, libGL
|
|
, vulkan-loader
|
|
, libx11
|
|
, libxcursor
|
|
, libxrandr
|
|
, libxi
|
|
}:
|
|
|
|
let
|
|
version = "0.14.0";
|
|
|
|
# Upstream publishes prebuilt release tarballs per platform. Each contains
|
|
# the `oryxis` binary, its .desktop file, and a 64px icon.
|
|
sources = {
|
|
x86_64-linux = {
|
|
url = "https://github.com/wilsonglasser/oryxis/releases/download/v${version}/oryxis-linux-x86_64.tar.gz";
|
|
hash = "sha256-U/8gEXcz3wJ0zk2GJqYnG0XdkU5+J53RloEyX4O2dcE=";
|
|
};
|
|
aarch64-linux = {
|
|
url = "https://github.com/wilsonglasser/oryxis/releases/download/v${version}/oryxis-linux-aarch64.tar.gz";
|
|
hash = "sha256-G3kTzci/GZVXVwF52eu/Yg7HERn7m/V3tJigkTA1SUM=";
|
|
};
|
|
};
|
|
|
|
source = sources.${stdenv.hostPlatform.system}
|
|
or (throw "oryxis: unsupported platform ${stdenv.hostPlatform.system}");
|
|
|
|
# Graphics/windowing libraries the binary dlopens at runtime (it only links
|
|
# libc/libm/libgcc directly), so they must be on LD_LIBRARY_PATH.
|
|
runtimeLibs = [
|
|
wayland
|
|
libxkbcommon
|
|
libGL
|
|
vulkan-loader
|
|
libx11
|
|
libxcursor
|
|
libxrandr
|
|
libxi
|
|
];
|
|
in
|
|
stdenv.mkDerivation {
|
|
pname = "oryxis";
|
|
inherit version;
|
|
|
|
src = fetchurl source;
|
|
|
|
sourceRoot = ".";
|
|
|
|
nativeBuildInputs = [
|
|
autoPatchelfHook # fixes the ELF interpreter and rpath of the prebuilt binary
|
|
makeWrapper
|
|
];
|
|
|
|
# Needed by autoPatchelfHook to resolve the binary's direct NEEDED entries
|
|
# (libgcc_s.so.1, libm, libc).
|
|
buildInputs = [
|
|
stdenv.cc.cc.lib
|
|
];
|
|
|
|
installPhase = ''
|
|
runHook preInstall
|
|
|
|
install -Dm755 oryxis $out/bin/oryxis
|
|
install -Dm644 oryxis.desktop $out/share/applications/oryxis.desktop
|
|
install -Dm644 logo_64.png $out/share/icons/hicolor/64x64/apps/oryxis.png
|
|
|
|
runHook postInstall
|
|
'';
|
|
|
|
postFixup = ''
|
|
wrapProgram $out/bin/oryxis \
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
|
|
'';
|
|
|
|
meta = {
|
|
description = "Modern SSH client built entirely in Rust. Fast, encrypted, native";
|
|
homepage = "https://github.com/wilsonglasser/oryxis";
|
|
license = lib.licenses.agpl3Only;
|
|
mainProgram = "oryxis";
|
|
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
|
|
platforms = builtins.attrNames sources;
|
|
};
|
|
}
|