## START: Set by rpmautospec ## (rpmautospec version 0.7.2) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond_without check %bcond_with x264 %bcond_with cuda %define alvr_ver 20.11.1 %define alvr_dist 0 %define alvr_commit fc03219b1c5cfcd7d41c5334efcea5a9b1639d30 %define alvr_short fc03219 %if 0%{alvr_dist} > 0 %define alvr_suffix ^%{alvr_dist}.git%{alvr_short} %endif %if %{with x264} %if %{with cuda} Name: alvr_x264_cuda %else Name: alvr_x264 %endif %else %if %{with cuda} Name: alvr_cuda %else Name: alvr %endif %endif Version: %{alvr_ver}%{?alvr_suffix:} Release: %autorelease Summary: Stream VR games from your PC to your headset via Wi-Fi # Bundled lib licenses # Static dependencies licenses # I imagine there are more licenses attached to this %if %{with x264} License: MIT and GPL %else License: MIT and LGPL %endif URL: https://github.com/alvr-org/ALVR Source0: https://github.com/alvr-org/ALVR/archive/refs/tags/v%{alvr_ver}/ALVR-%{alvr_ver}.tar.gz Source1: https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n6.0.zip Source2: https://github.com/FFmpeg/nv-codec-headers/archive/refs/tags/n12.1.14.0.zip Patch0: 0001-server_only.patch Patch1: 0002-system_openvr.patch Patch2: 0003-ffmpeg_fix.patch Patch3: 0004-fix_x264.patch Patch4: 0005-x264_fix_cuda.patch Patch5: 0005-x264_no_cuda.patch Patch6: 0004-no_x264.patch Patch7: 0005-fix_cuda.patch Patch8: 0005-no_cuda.patch BuildRequires: desktop-file-utils BuildRequires: yasm BuildRequires: libdrm-devel BuildRequires: vulkan-headers BuildRequires: pipewire-jack-audio-connection-kit-devel BuildRequires: atk-devel BuildRequires: gdk-pixbuf2-devel BuildRequires: cairo-devel BuildRequires: cargo BuildRequires: vulkan-devel BuildRequires: libunwind-devel BuildRequires: openssl-devel BuildRequires: alsa-lib-devel BuildRequires: clang BuildRequires: libva-devel BuildRequires: bzip2 BuildRequires: nasm BuildRequires: pkgconfig(libpipewire-0.3) BuildRequires: libXrandr-devel BuildRequires: openvr-devel %if %{with cuda} BuildRequires: cuda-toolkit BuildRequires: cuda-gcc-11-c++ %endif %if %{with x264} BuildRequires: x264-devel %endif Requires: hicolor-icon-theme %if %{with cuda} Conflicts: alvr_x264 %endif %if %{with x264} Conflicts: alvr_cuda %endif %if %{with x264} || %{with cuda} Conflicts: alvr %endif %description ALVR is a VR Streaming software that allows you to stream SteamVR games to your standalone VR headset. %prep %setup -n ALVR-%{alvr_ver} %patch -P 0 -p1 -b .server_only-patch %patch -P 1 -p1 -b .system_openvr-patch %patch -P 2 -p1 -b .ffmpeg_fix-patch %if %{with x264} %patch -P 3 -p1 -b .x264-patch %if %{with cuda} %patch -P 4 -p1 -b .cuda-patch %else %patch -P 5 -p1 -b .no_cuda-patch %endif %else %patch -P 6 -p1 -b .no_x264-patch %if %{with cuda} %patch -P 7 -p1 -b .cuda-patch %else %patch -P 8 -p1 -b .no_cuda-patch %endif %endif mv %{SOURCE1} ffmpeg.zip mv %{SOURCE2} nv-codec-headers.zip #FIX: package dependencies so we don't depend on cargo cargo fetch --target "$(arch)-unknown-linux-gnu" %build %if %{with cuda} export PATH="/usr/local/cuda-12.6/bin:${PATH}" %endif cargo run \ --frozen \ --release \ -p alvr_xtask \ -- \ prepare-deps \ --platform linux cargo xtask build-streamer --release %install install -d ${RPM_BUILD_ROOT}%{_bindir} install -p ./build/alvr_streamer_linux/bin/alvr_dashboard ${RPM_BUILD_ROOT}%{_bindir}/alvr_dashboard install -d $RPM_BUILD_ROOT/%{_libdir}/alvr/ install -Dm644 ./build/alvr_streamer_linux/lib64/alvr/bin/linux64/driver_alvr_server.so $RPM_BUILD_ROOT/%{_libdir}/alvr/bin/linux64/driver_alvr_server.so install -Dm644 ./build/alvr_streamer_linux/lib64/alvr/driver.vrdrivermanifest -t $RPM_BUILD_ROOT/%{_libdir}/alvr/ install -Dm644 ./build/alvr_streamer_linux/lib64/libalvr_vulkan_layer.so -t $RPM_BUILD_ROOT/%{_libdir} install -d $RPM_BUILD_ROOT/%{_libexecdir}/alvr/ install -Dm644 ./build/alvr_streamer_linux/libexec/alvr/alvr_drm_lease_shim.so $RPM_BUILD_ROOT/%{_libexecdir}/alvr/alvr_drm_lease_shim.so install -Dm755 ./build/alvr_streamer_linux/libexec/alvr/alvr_fw_config.sh -t $RPM_BUILD_ROOT/%{_libexecdir}/alvr/ install -Dm644 ./build/alvr_streamer_linux/libexec/alvr/alvr-firewalld.xml -t $RPM_BUILD_ROOT/%{_libexecdir}/alvr/ install -Dm644 ./build/alvr_streamer_linux/libexec/alvr/ufw-alvr -t $RPM_BUILD_ROOT/%{_libexecdir}/alvr/ install -Dm755 ./build/alvr_streamer_linux/libexec/alvr/vrcompositor-wrapper $RPM_BUILD_ROOT/%{_libexecdir}/alvr/vrcompositor-wrapper install -Dm644 ./build/alvr_streamer_linux/share/vulkan/explicit_layer.d/alvr_x86_64.json -t ${RPM_BUILD_ROOT}%{_datadir}/vulkan/explicit_layer.d/ install -d ${RPM_BUILD_ROOT}%{_datadir}/applications/ install -p -m 644 ./alvr/xtask/flatpak/com.valvesoftware.Steam.Utility.alvr.desktop ${RPM_BUILD_ROOT}%{_datadir}/applications/alvr_dashboard.desktop desktop-file-edit --set-key=Exec --set-value=alvr_dashboard --set-icon=alvr_dashboard ${RPM_BUILD_ROOT}%{_datadir}/applications/alvr_dashboard.desktop desktop-file-validate \ ${RPM_BUILD_ROOT}%{_datadir}/applications/alvr_dashboard.desktop install -d $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/256x256/apps/ install -p -m 644 ./alvr/xtask/flatpak/alvr_icon.png $RPM_BUILD_ROOT/%{_datadir}/icons/hicolor/256x256/apps/alvr_dashboard.png %files %license LICENSE %{_bindir}/alvr_dashboard %{_libdir}/alvr/* %{_libdir}/libalvr_vulkan_layer.so %{_libexecdir}/alvr/* %{_datadir}/vulkan/explicit_layer.d/alvr_x86_64.json %{_datadir}/applications/alvr_dashboard.desktop %{_datadir}/icons/hicolor/256x256/apps/alvr_dashboard.png %changelog ## START: Generated by rpmautospec * Sun Oct 13 2024 Grillo del Mal - 20.11.1-2 - Add alternative builds * Sun Oct 13 2024 Grillo del Mal - 20.11.1-1 - Initial commit ## END: Generated by rpmautospec