Created
December 24, 2021 04:30
-
-
Save cidkidnix/569986f4ccf95503991b5237d3fac887 to your computer and use it in GitHub Desktop.
ALVR package nixos
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
{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, alsaLib, openssl, glib, ffmpeg-full | |
, cairo, pango, atk, gdk-pixbuf, gtk3, vulkan-headers-update, vulkan-loader | |
, clangStdenv, llvmPackages, clang, clang-tools, libunwind, clang_12, makeWrapper, chromium, vulkan-validation-layers, | |
xorg, libxkbcommon, python3Full }: | |
with rustPlatform; | |
buildRustPackage rec { | |
pname = "alvr"; | |
version = "16.0.0"; | |
src = fetchFromGitHub { | |
owner = "alvr-org"; | |
repo = "ALVR"; | |
rev = "v${version}"; | |
sha256 = "sha256-9q7NPWZZuwtDfZzJJFyJQLwfWV1k6e+4tQhnbBzr87E="; | |
}; | |
patches = [ ]; | |
cargoSha256 = "sha256-klAtBgWW3BENeJRo33WgAGiunG2PRuJwPOwQb8ic4zk="; | |
buildInputs = [ | |
alsaLib | |
openssl | |
glib | |
ffmpeg-full | |
cairo | |
pango | |
atk | |
gdk-pixbuf | |
gtk3 | |
vulkan-headers-update | |
vulkan-loader | |
vulkan-validation-layers | |
clang | |
libunwind | |
makeWrapper | |
xorg.libX11 | |
xorg.libXrandr | |
libxkbcommon | |
]; | |
nativeBuildInputs = [ pkg-config clang-tools clang_12 python3Full ]; | |
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib"; | |
doCheck = false; | |
buildPhase = '' | |
cargo xtask build-server --release | |
''; | |
postPatch = '' | |
substituteInPlace alvr/vrcompositor-wrapper/src/main.rs --replace "../../share/vulkan/explicit_layer.d" "$out/share/vulkan/explicit_layer.d" | |
''; | |
installPhase = '' | |
installPhaseTarget=target/release | |
mkdir -p $out/bin | |
mkdir -p $out/share/vulkan/explicit_layer.d | |
mkdir -p $out/share/alvr/presets | |
mkdir -p $out/lib/alvr | |
mkdir -p $out/lib/steamvr/alvr/bin/linux64 | |
# Replace lib64 stuffs | |
substituteInPlace alvr/vulkan-layer/layer/alvr_x86_64.json --replace "../../../lib64/" "$out/lib/" | |
# ALVR stuffs | |
cp $installPhaseTarget/alvr_launcher $out/bin | |
cp $installPhaseTarget/vrcompositor-wrapper $out/lib/alvr/ | |
# alvr driver | |
cp $installPhaseTarget/libalvr_server.so $out/lib/steamvr/alvr/bin/linux64/driver_alvr_server.so | |
cp alvr/xtask/resources/driver.vrdrivermanifest $out/lib/steamvr/alvr/ | |
# Vulkan Layer | |
cp $installPhaseTarget/libalvr_vulkan_layer.so $out/lib/ | |
cp alvr/vulkan-layer/layer/alvr_x86_64.json $out/share/vulkan/explicit_layer.d/ | |
# Dashboard | |
cp -r alvr/dashboard $out/share/alvr/ | |
cp -r alvr/xtask/resources/presets/* $out/share/alvr/presets/ | |
# Include chromium | |
wrapProgram $out/bin/alvr_launcher --set ALCRO_BROWSER_PATH=${chromium}/bin/chromium | |
''; | |
meta = with lib; { | |
description = "Stream VR games from your PC to your headset over the network"; | |
homepage = "https://alvr-org.github.io"; | |
platforms = [ "x86_64-linux" ]; | |
license = licenses.mit; | |
maintainers = [ maintainers.ronthecookie ]; | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment