Files
oryxis-nix/package.nix
T

74 lines
1.4 KiB
Nix

{ lib
, rustPlatform
, fetchFromGitHub
, pkg-config
, makeWrapper
, openssl
, gtk3
, wayland
, libxkbcommon
, libGL
, vulkan-loader
, libx11
, libxcursor
, libxrandr
, libxi
}:
let
runtimeLibs = [
wayland
libxkbcommon
libGL
vulkan-loader
libx11
libxcursor
libxrandr
libxi
];
in
rustPlatform.buildRustPackage rec {
pname = "oryxis";
version = "0.9.0";
src = fetchFromGitHub {
owner = "wilsonglasser";
repo = "oryxis";
rev = "v${version}";
hash = "sha256-iIqCH7jrWRI9nwS1XemaEa3Cfb5YtslP2o23tZ2/JM8=";
};
cargoHash = "sha256-BUSm/EGc7hrB48xXMUXtvmtYSZraFdQ8VBCBIfCfFCY=";
nativeBuildInputs = [
pkg-config
makeWrapper
];
buildInputs = [
openssl
gtk3
wayland
libxkbcommon
];
# Use the system openssl (from buildInputs) rather than vendoring it.
OPENSSL_NO_VENDOR = 1;
postInstall = ''
install -Dm644 resources/oryxis.desktop $out/share/applications/oryxis.desktop
install -Dm644 resources/logo.svg $out/share/icons/hicolor/scalable/apps/oryxis.svg
for size in 64 128 256; do
install -Dm644 resources/logo_$size.png \
$out/share/icons/hicolor/''${size}x''${size}/apps/oryxis.png
done
'';
postFixup = ''
for bin in $out/bin/*; do
wrapProgram "$bin" \
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeLibs}"
done
'';
}