Merge branch 'testing'

This commit is contained in:
Mateusz Słodkowicz 2023-10-24 21:29:05 +02:00
commit 5518d2e80a
Signed by: materus
GPG Key ID: 28D140BCA60B4FD1
3 changed files with 35 additions and 19 deletions

View File

@ -0,0 +1,13 @@
[Desktop Entry]
Version=1.0
Type=Application
Name=ALVR
GenericName=Game
Comment=ALVR is an open source remote VR display which allows playing SteamVR games on a standalone headset such as Gear VR or Oculus Go/Quest.
Exec=alvr_dashboard
Icon=alvr
Categories=Game;
StartupNotify=true
PrefersNonDefaultGPU=true
X-KDE-RunOnDiscreteGpu=true
StartupWMClass=ALVR

Binary file not shown.

After

Width:  |  Height:  |  Size: 73 KiB

View File

@ -1,4 +1,4 @@
{ stdenv, fetchzip, lib, alsa-lib, gtk3, libunwind, x264, vulkan-loader, xorg, libva, libdrm, libvdpau, libbsd, libmd, xz }: { stdenv, fetchzip, fetchurl, lib, alsa-lib, gtk3, libunwind, x264, vulkan-loader, xorg, libva, libdrm, libvdpau, libbsd, libmd, xz }:
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "alvr"; pname = "alvr";
version = "v20.4.3"; version = "v20.4.3";
@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
}; };
sourceRoot = "."; sourceRoot = ".";
outputs = [ "out" "driver" ];
rpath = lib.makeLibraryPath [ rpath = lib.makeLibraryPath [
stdenv.cc.cc.lib stdenv.cc.cc.lib
alsa-lib alsa-lib
@ -29,32 +29,35 @@ stdenv.mkDerivation rec {
libmd libmd
xz xz
]; ];
preferLocalBuild = true; preferLocalBuild = true;
dontBuild = true;
installPhase = '' installPhase = ''
mkdir -p $out/bin $out/share/alvr runHook preInstall
mkdir -p $driver/share/vulkan/explicit_layer.d
mv ${src.name}/* $out/share/alvr
ln -s $out/share/alvr/bin/alvr_dashboard $out/bin mkdir -p $out/bin $out/opt/ALVR $out/share/vulkan/explicit_layer.d $out/share/applications/ $out/share/icons/hicolor/256x256/apps/
mv ${src.name}/* $out/opt/ALVR
# Driver
ln -s $out/share/alvr/share/vulkan/explicit_layer.d/alvr_x86_64.json $driver/share/vulkan/explicit_layer.d/alvr_x86_64.json
ln -s $out/share/alvr/lib64 $driver/lib
cp ${./alvr.png} $out/share/icons/hicolor/256x256/apps/alvr.png
ls -la $out/share/alvr cp ${./alvr.desktop} $out/share/applications/alvr.desktop
ln -s $out/opt/ALVR/bin/alvr_dashboard $out/bin
ln -s $out/opt/ALVR/share/vulkan/explicit_layer.d/alvr_x86_64.json $out/share/vulkan/explicit_layer.d
runHook postInstall
''; '';
fixupPhase = '' fixupPhase = ''
patchelf --set-rpath "${rpath}" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/alvr/bin/alvr_dashboard runHook preFixup
patchelf --set-rpath "${rpath}" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/share/alvr/libexec/alvr/vrcompositor-wrapper
patchelf --set-rpath "${rpath}" $out/share/alvr/libexec/alvr/alvr_drm_lease_shim.so
patchelf --set-rpath "${rpath}" $out/share/alvr/lib64/libalvr_vulkan_layer.so
patchelf --set-rpath "${rpath}" $out/share/alvr/lib64/alvr/bin/linux64/driver_alvr_server.so
patchelf --set-rpath "${rpath}" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/ALVR/bin/alvr_dashboard
patchelf --set-rpath "${rpath}" --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/ALVR/libexec/alvr/vrcompositor-wrapper
patchelf --set-rpath "${rpath}" $out/opt/ALVR/libexec/alvr/alvr_drm_lease_shim.so
patchelf --set-rpath "${rpath}" $out/opt/ALVR/lib64/libalvr_vulkan_layer.so
patchelf --set-rpath "${rpath}" $out/opt/ALVR/lib64/alvr/bin/linux64/driver_alvr_server.so
sed -i "s#../../../lib64/libalvr_vulkan_layer.so#$out/opt/ALVR/lib64/libalvr_vulkan_layer.so#" $out/opt/ALVR/share/vulkan/explicit_layer.d/alvr_x86_64.json
sed -i "s#../../../lib64/libalvr_vulkan_layer.so#$out/share/alvr/lib64/libalvr_vulkan_layer.so#" $out/share/alvr/share/vulkan/explicit_layer.d/alvr_x86_64.json runHook postFixup
''; '';
meta = with lib; { meta = with lib; {