From f78491e8eee52f1d4cfd4670a1ecd16cfb9c307f Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Sat, 5 Aug 2023 20:36:32 +0300 Subject: [PATCH] test --- debian/alvr.install | 2 ++ main.sh | 63 ++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 debian/alvr.install diff --git a/debian/alvr.install b/debian/alvr.install new file mode 100644 index 0000000..7312ca8 --- /dev/null +++ b/debian/alvr.install @@ -0,0 +1,2 @@ +usr +etc \ No newline at end of file diff --git a/main.sh b/main.sh index 4fd7b08..226eb6a 100755 --- a/main.sh +++ b/main.sh @@ -2,14 +2,69 @@ DEBIAN_FRONTEND=noninteractive -# Clone Upstream -mkdir -p ./src-pkg-name -cp -rvf ./debian ./src-pkg-name/ -cd ./src-pkg-name/ # Get build deps apt-get build-dep ./ -y + +# Build ALVR +git clone https://github.com/alvr-org/ALVR --recursive -b v20.1.0 +cd ./ALVR +export CARGO_PROFILE_RELEASE_LTO=true +export RUSTUP_TOOLCHAIN=stable +export CARGO_TARGET_DIR=target +sed -i 's:../../../lib64/libalvr_vulkan_layer.so:libalvr_vulkan_layer.so:' alvr/vulkan_layer/layer/alvr_x86_64.json +cargo fetch --locked --target "x86_64-unknown-linux-gnu" +export ALVR_ROOT_DIR=/usr +export ALVR_LIBRARIES_DIR="$ALVR_ROOT_DIR/lib/x86_64-linux-gnu" +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/" +cargo run --release --frozen -p alvr_xtask -- prepare-deps --platform linux +cargo build \ + --frozen \ + --release \ + -p alvr_server \ + -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/" + convert 'alvr/dashboard/resources/dashboard.ico' -thumbnail "${res}" -alpha on -background none -flatten "./icons/hicolor/${res}/apps/alvr.png" +done +mkdir -p ../alvr +cp -rvf ../debian ../alvr/ + +# Make ALVR Dir +install -Dm644 LICENSE -t "../alvr/usr/share/licenses/alvr/" +install -Dm755 target/release/alvr_dashboard -t "../alvr/usr/bin/" + +# vrcompositor wrapper +install -Dm755 target/release/alvr_vrcompositor_wrapper "../alvr/usr/lib/x86_64-linux-gnu/alvr/vrcompositor-wrapper" + +# OpenVR Driver +install -Dm644 target/release/libalvr_server.so "../alvr/usr/lib/x86_64-linux-gnu/steamvr/alvr/bin/linux64/driver_alvr_server.so" +install -Dm644 alvr/xtask/resources/driver.vrdrivermanifest -t "../alvr/usr/lib/x86_64-linux-gnu/steamvr/alvr/" + +# Vulkan Layer +install -Dm644 target/release/libalvr_vulkan_layer.so -t "../alvr/usr/lib/x86_64-linux-gnu/" +install -Dm644 alvr/vulkan_layer/layer/alvr_x86_64.json -t "../alvr/usr/share/vulkan/explicit_layer.d/" + +# Desktop +install -Dm644 packaging/freedesktop/alvr.desktop -t "../alvr/usr/share/applications" + +# Icons +install -d ../alvr/usr/share/icons/hicolor/{16x16,32x32,48x48,64x64,128x128,256x256}/apps/ +cp -ar icons/* ../alvr/usr/share/icons/ + +# Firewall +install -Dm644 "packaging/firewall/alvr-firewalld.xml" "../alvr/usr/lib/x86_64-linux-gnu/firewalld/services/alvr.xml" +install -Dm644 "packaging/firewall/ufw-alvr" -t "../alvr/etc/ufw/applications.d/" + +install -Dm755 packaging/firewall/alvr_fw_config.sh -t "../alvr/usr/share/alvr/" + +cd ../alvr + # Build package dpkg-buildpackage --no-sign