blob: a83ccef4861914bc3528ed5716d0d2110cc9536c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
# Maintainer: m00nw4tch3r <m00nwtchr at duck dot com>
pkgname=alvr-nvidia
_pkgname=${pkgname%-nvidia}
pkgver=20.11.1
pkgrel=1
pkgdesc="Experimental Linux version of ALVR. Stream VR games from your PC to your headset via Wi-Fi."
arch=('x86_64')
url="https://github.com/alvr-org/ALVR"
license=('MIT')
depends=('vulkan-icd-loader' 'libunwind' 'libdrm' 'x264' 'alsa-lib' 'libva.so' 'libva-drm.so' 'libva-x11.so' 'bash' 'hicolor-icon-theme' 'cuda' 'libpipewire')
makedepends=('git' 'cargo' 'clang' 'imagemagick' 'vulkan-headers' 'jack' 'libxrandr' 'nasm' 'unzip' 'ffnvcodec-headers')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("${_pkgname}"::"git+https://github.com/alvr-org/ALVR.git#tag=v$pkgver"
"git+https://github.com/ValveSoftware/openvr.git"
)
md5sums=('a32d15dc357bffb25dc52b9f4b800d7f'
'SKIP')
options=('!lto')
export CARGO_PROFILE_RELEASE_LTO=true
export RUSTUP_TOOLCHAIN=stable
export CARGO_TARGET_DIR=target
prepare() {
cd "$srcdir/${_pkgname}"
git submodule init
git config submodule.openvr.url "$srcdir/openvr"
git -c protocol.file.allow=always submodule update
sed -i 's:../../../lib64/libalvr_vulkan_layer.so:libalvr_vulkan_layer.so:' alvr/vulkan_layer/layer/alvr_x86_64.json
cargo fetch --locked --target "$CARCH-unknown-linux-gnu"
}
build() {
cd "$srcdir/${_pkgname}"
export ALVR_ROOT_DIR=/usr
export ALVR_LIBRARIES_DIR="$ALVR_ROOT_DIR/lib"
export ALVR_OPENVR_DRIVER_ROOT_DIR="$ALVR_LIBRARIES_DIR/steamvr/alvr/"
export ALVR_VRCOMPOSITOR_WRAPPER_DIR="$ALVR_LIBRARIES_DIR/alvr/"
export FIREWALL_SCRIPT_DIR="$ALVR_ROOT_DIR/share/alvr/"
# export CC=gcc-12 CXX=g++-12
cargo run --release --frozen -p alvr_xtask -- prepare-deps --platform linux
cargo build \
--frozen \
--release \
-p alvr_server_openvr \
-p alvr_dashboard \
-p alvr_vulkan_layer \
-p alvr_vrcompositor_wrapper
for res in 16x16 32x32 48x48 64x64 128x128 256x256; do
mkdir -p "icons/hicolor/${res}/apps/"
magick 'alvr/dashboard/resources/dashboard.ico' -thumbnail "${res}" -alpha on -background none -flatten "./icons/hicolor/${res}/apps/alvr.png"
done
}
package() {
cd "$srcdir/${_pkgname}"
install -Dm644 LICENSE -t "$pkgdir/usr/share/licenses/$_pkgname/"
install -Dm755 target/release/alvr_dashboard -t "$pkgdir/usr/bin/"
# vrcompositor wrapper
install -Dm755 target/release/alvr_vrcompositor_wrapper "$pkgdir/usr/lib/alvr/vrcompositor-wrapper"
install -Dm644 target/release/alvr_drm_lease_shim.so "$pkgdir/usr/lib/alvr/alvr_drm_lease_shim.so"
# OpenVR Driver
install -Dm644 target/release/libalvr_server_openvr.so "$pkgdir/usr/lib/steamvr/alvr/bin/linux64/driver_alvr_server.so"
install -Dm644 alvr/xtask/resources/driver.vrdrivermanifest -t "$pkgdir/usr/lib/steamvr/alvr/"
# Vulkan Layer
install -Dm644 target/release/libalvr_vulkan_layer.so -t "$pkgdir/usr/lib/"
install -Dm644 alvr/vulkan_layer/layer/alvr_x86_64.json -t "$pkgdir/usr/share/vulkan/explicit_layer.d/"
# Desktop
install -Dm644 "alvr/xtask/resources/$_pkgname.desktop" -t "$pkgdir/usr/share/applications"
# Icons
install -d $pkgdir/usr/share/icons/hicolor/{16x16,32x32,48x48,64x64,128x128,256x256}/apps/
cp -ar icons/* $pkgdir/usr/share/icons/
# Firewall
install -Dm644 alvr/xtask/firewall/ufw-alvr -t "$pkgdir/etc/ufw/applications.d/"
install -Dm755 alvr/xtask/firewall/alvr_fw_config.sh -t "$pkgdir/usr/share/alvr/"
}
|