Files
nixpkgs/pkgs/by-name/al/alvr/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

157 lines
2.8 KiB
Nix

{
lib,
rustPlatform,
fetchFromGitHub,
replaceVars,
nix-update-script,
pkg-config,
autoAddDriverRunpath,
alsa-lib,
brotli,
bzip2,
celt,
ffmpeg,
gmp,
jack2,
lame,
libX11,
libXi,
libXrandr,
libXcursor,
libdrm,
libglvnd,
libogg,
libpng,
libtheora,
libunwind,
libva,
libvdpau,
libxkbcommon,
openssl,
openvr,
pipewire,
rust-cbindgen,
soxr,
vulkan-headers,
vulkan-loader,
wayland,
x264,
xvidcore,
}:
rustPlatform.buildRustPackage rec {
pname = "alvr";
version = "20.14.1";
src = fetchFromGitHub {
owner = "alvr-org";
repo = "ALVR";
tag = "v${version}";
fetchSubmodules = true; # TODO devendor openvr
hash = "sha256-9fckUhUPAbcmbqOdUO8RlwuK8/nf1fc7XQBrAu5YaR4=";
};
cargoHash = "sha256-OTCMWrlwnfpUhm6ssOE133e/3DaQFnOU+NunN2c1N+g=";
patches = [
(replaceVars ./fix-finding-libs.patch {
ffmpeg = lib.getDev ffmpeg;
x264 = lib.getDev x264;
})
];
env = {
NIX_CFLAGS_COMPILE = toString [
"-lbrotlicommon"
"-lbrotlidec"
"-lcrypto"
"-lpng"
"-lssl"
];
};
RUSTFLAGS = map (a: "-C link-arg=${a}") [
"-Wl,--push-state,--no-as-needed"
"-lEGL"
"-lwayland-client"
"-lxkbcommon"
"-Wl,--pop-state"
];
cargoBuildFlags = [
"--exclude alvr_xtask"
"--workspace"
];
nativeBuildInputs = [
rust-cbindgen
pkg-config
rustPlatform.bindgenHook
autoAddDriverRunpath
];
buildInputs = [
alsa-lib
brotli
bzip2
celt
ffmpeg
gmp
jack2
lame
libX11
libXcursor
libXi
libXrandr
libdrm
libglvnd
libogg
libpng
libtheora
libunwind
libva
libvdpau
libxkbcommon
openssl
openvr
pipewire
soxr
vulkan-headers
vulkan-loader
wayland
x264
xvidcore
];
postBuild = ''
# Build SteamVR driver ("streamer")
cargo xtask build-streamer --release
'';
postInstall = ''
install -Dm755 ${src}/alvr/xtask/resources/alvr.desktop $out/share/applications/alvr.desktop
install -Dm644 ${src}/resources/ALVR-Icon.svg $out/share/icons/hicolor/scalable/apps/alvr.svg
# Install SteamVR driver
mkdir -p $out/{libexec,lib/alvr,share}
cp -r ./build/alvr_streamer_linux/lib64/. $out/lib
cp -r ./build/alvr_streamer_linux/libexec/. $out/libexec
cp -r ./build/alvr_streamer_linux/share/. $out/share
ln -s $out/lib $out/lib64
'';
passthru.updateScript = nix-update-script { };
meta = {
description = "Stream VR games from your PC to your headset via Wi-Fi";
homepage = "https://github.com/alvr-org/ALVR/";
changelog = "https://github.com/alvr-org/ALVR/releases/tag/v${version}";
license = lib.licenses.mit;
mainProgram = "alvr_dashboard";
maintainers = with lib.maintainers; [
luNeder
jopejoe1
];
platforms = lib.platforms.linux;
};
}