add flatpak manifest

This commit is contained in:
galister
2025-05-13 17:57:31 +09:00
parent eef80eae3a
commit c44a998c67
6 changed files with 7552 additions and 7 deletions

9
Cargo.lock generated
View File

@@ -3009,8 +3009,8 @@ checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
[[package]]
name = "openxr"
version = "0.18.0"
source = "git+https://github.com/galister/openxrs?rev=af4a55d#af4a55df60125491c80c61464c824219c6019b76"
version = "0.19.0"
source = "git+https://github.com/Ralith/openxrs?rev=6c7747aee678048642dc16aad8bab3d6961dce03#6c7747aee678048642dc16aad8bab3d6961dce03"
dependencies = [
"libc",
"libloading",
@@ -3020,9 +3020,10 @@ dependencies = [
[[package]]
name = "openxr-sys"
version = "0.10.0"
source = "git+https://github.com/galister/openxrs?rev=af4a55d#af4a55df60125491c80c61464c824219c6019b76"
version = "0.11.0"
source = "git+https://github.com/Ralith/openxrs?rev=6c7747aee678048642dc16aad8bab3d6961dce03#6c7747aee678048642dc16aad8bab3d6961dce03"
dependencies = [
"cmake",
"libc",
"mint",
]

View File

@@ -35,8 +35,8 @@ json = { version = "0.12.4", optional = true }
json5 = "0.4.1"
libc = "0.2.155"
log = "0.4.21"
openxr = { git = "https://github.com/galister/openxrs", rev = "af4a55d", features = [
"linked",
openxr = { git = "https://github.com/Ralith/openxrs", rev = "6c7747aee678048642dc16aad8bab3d6961dce03", features = [
"static",
"mint",
], optional = true }
ovr_overlay = { features = [

View File

@@ -0,0 +1,65 @@
id: io.github.galister.wlx-overlay-s
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.llvm19
command: wlx-overlay-s
build-options:
append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm19/bin
append-ld-library-path: /usr/lib/sdk/llvm19/lib
finish-args:
# PipeWire & Notifications
- --socket=session-bus
# uinput requires device=all
- --device=all
# X11 + XShm access
- --share=ipc
- --socket=fallback-x11
# Wayland access
- --socket=wayland
# Pipewire
- --filesystem=xdg-run/pipewire-0
# Get the active OpenXR runtime
- --filesystem=xdg-config/openxr:ro
# WiVRn and Monado install locations
- --filesystem=/opt/wivrn:ro
- --filesystem=/opt/monado:ro
- --filesystem=/usr/lib/monado:ro
- --filesystem=/usr/lib64/monado:ro
- --filesystem=/usr/lib/wivrn:ro
- --filesystem=/usr/lib64/wivrn:ro
- --filesystem=/var/lib/flatpak/app/io.github.wivrn.wivrn:ro
- --filesystem=~/.var/app/io.github.wivrn.wivrn:ro
- --filesystem=xdg-data/envision/prefixes:ro
# Access WiVRn/Monado sockets
- --filesystem=xdg-run/wivrn:ro
- --filesystem=xdg-run/monado_comp_ipc:ro
- --filesystem=/tmp/wlx.log:create
cleanup:
- /lib/pkgconfig
- /share/pkgconfig
- /include
- /share/man
- '*.a'
modules:
# wayvr goes here
- name: wlx-overlay-s
buildsystem: simple
build-options:
env:
CARGO_HOME: /run/build/wlx-overlay-s/cargo
build-commands:
- cargo --offline fetch --manifest-path Cargo.toml --verbose
- cargo --offline build --release --no-default-features --features=openxr,x11,wayland --verbose
- install -Dm755 ./target/release/wlx-overlay-s -t /app/bin/
sources:
- type: dir
path: ..
- sources-wlx-overlay-s.json

7459
flatpak/sources-wlx-overlay-s.json Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
use anyhow::{bail, ensure};
use glam::{Affine3A, Quat, Vec3, Vec3A};
use openxr::{self as xr, SessionCreateFlags};
use openxr::{self as xr, SessionCreateFlags, Version};
use xr::OverlaySessionCreateFlagsEXTX;
pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
@@ -54,6 +54,7 @@ pub(super) fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> {
let Ok(xr_instance) = entry.create_instance(
&xr::ApplicationInfo {
api_version: Version::new(1, 1, 37),
application_name: "wlx-overlay-s",
application_version: 0,
engine_name: "wlx-overlay-s",

View File

@@ -34,6 +34,7 @@ use std::{
},
};
use backend::notifications::DbusNotificationSender;
use clap::Parser;
use sysinfo::Pid;
use tracing::level_filters::LevelFilter;
@@ -127,12 +128,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
Ok(())
}
#[allow(unused_mut)]
fn auto_run(running: Arc<AtomicBool>, args: Args) {
use backend::common::BackendError;
let mut tried_xr = false;
let mut tried_vr = false;
#[cfg(feature = "openxr")]
if !args_get_openvr(&args) {
use crate::backend::openxr::openxr_run;
tried_xr = true;
match openxr_run(running.clone(), args.show) {
Ok(()) => return,
Err(BackendError::NotSupported) => (),
@@ -146,6 +152,7 @@ fn auto_run(running: Arc<AtomicBool>, args: Args) {
#[cfg(feature = "openvr")]
if !args_get_openxr(&args) {
use crate::backend::openvr::openvr_run;
tried_vr = true;
match openvr_run(running, args.show) {
Ok(()) => return,
Err(BackendError::NotSupported) => (),
@@ -158,6 +165,18 @@ fn auto_run(running: Arc<AtomicBool>, args: Args) {
log::error!("No more backends to try");
let instructions = match (tried_xr, tried_vr) {
(true, true) => "Make sure that Monado, WiVRn or SteamVR is running.",
(false, true) => "Make sure that SteamVR is running.",
(true, false) => "Make sure that Monado or WiVRn is running.",
_ => "Check your launch arguments.",
};
let instructions = format!("Could not connect to runtime.\n{instructions}");
let _ = DbusNotificationSender::new()
.and_then(|s| s.notify_send("WlxOverlay-S", &instructions, 1, 0, 0, false));
#[cfg(not(any(feature = "openvr", feature = "openxr")))]
compile_error!("No VR support! Enable either openvr or openxr features!");