fix: xrizer deps

This commit is contained in:
Sapphire 2025-05-05 00:12:42 -05:00 committed by Gabriele Musco
commit 4709a50483
3 changed files with 70 additions and 2 deletions

View file

@ -6,6 +6,7 @@ pub mod mercury_deps;
pub mod monado_deps;
pub mod openhmd_deps;
pub mod wivrn_deps;
pub mod xrizer_deps;
use crate::linux_distro::LinuxDistro;
use std::{collections::HashMap, env, fmt::Display, path::Path};

View file

@ -0,0 +1,57 @@
use super::{DepType, Dependency, DependencyCheckResult};
use crate::linux_distro::LinuxDistro;
use std::collections::HashMap;
fn xrizer_deps() -> Vec<Dependency> {
vec![
Dependency {
name: "glslc".into(),
dep_type: DepType::Executable,
filename: "glslc".into(),
packages: HashMap::from([
(LinuxDistro::Arch, "shaderc".into()),
(LinuxDistro::Debian, "glslc".into()),
(LinuxDistro::Fedora, "glslc".into()),
(LinuxDistro::Alpine, "glslc".into()),
(LinuxDistro::Gentoo, "dev-util/glslang".into()),
(LinuxDistro::Suse, "shaderc".into()),
]),
},
Dependency {
name: "libxcb-glx".into(),
dep_type: DepType::Include,
filename: "xcb/glx.h".into(),
packages: HashMap::from([
(LinuxDistro::Arch, "libxcb".into()),
(LinuxDistro::Debian, "libxcb-glx0-dev".into()),
(LinuxDistro::Fedora, "libxcb-devel".into()),
(LinuxDistro::Gentoo, "x11-libs/libxcb".into()),
(LinuxDistro::Suse, "libxcb-devel".into()),
]),
},
Dependency {
name: "libclang".into(),
dep_type: DepType::SharedObject,
filename: "libclang.so".into(),
packages: HashMap::from([
(LinuxDistro::Arch, "clang".into()),
(LinuxDistro::Debian, "libclang-19-dev".into()),
(LinuxDistro::Fedora, "clang19-devel".into()),
(LinuxDistro::Gentoo, "llvm-core/clang-runtime".into()),
(LinuxDistro::Suse, "clang19-devel".into()),
]),
},
]
}
pub fn check_xrizer_deps() -> Vec<DependencyCheckResult> {
Dependency::check_many(xrizer_deps())
}
pub fn get_missing_xrizer_deps() -> Vec<Dependency> {
check_xrizer_deps()
.iter()
.filter(|res| !res.found)
.map(|res| res.dependency.clone())
.collect()
}

View file

@ -2,7 +2,8 @@ use crate::{
depcheck::{
basalt_deps::get_missing_basalt_deps, libsurvive_deps::get_missing_libsurvive_deps,
mercury_deps::get_missing_mercury_deps, monado_deps::get_missing_monado_deps,
openhmd_deps::get_missing_openhmd_deps, wivrn_deps::get_missing_wivrn_deps, Dependency,
openhmd_deps::get_missing_openhmd_deps, wivrn_deps::get_missing_wivrn_deps,
xrizer_deps::get_missing_xrizer_deps, Dependency,
},
file_builders::active_runtime_json::ActiveRuntime,
paths::{get_data_dir, BWRAP_SYSTEM_PREFIX, SYSTEM_PREFIX},
@ -282,6 +283,15 @@ impl OvrCompatibilityModuleType {
pub fn iter() -> Iter<'static, Self> {
[Self::Opencomposite, Self::Xrizer, Self::Vapor].iter()
}
pub fn get_missing_deps(&self) -> Vec<Dependency> {
match self {
OvrCompatibilityModuleType::Xrizer => get_missing_xrizer_deps(),
OvrCompatibilityModuleType::Opencomposite | OvrCompatibilityModuleType::Vapor => {
Vec::default()
}
}
}
}
impl FromStr for OvrCompatibilityModuleType {
@ -737,7 +747,7 @@ impl Profile {
if self.features.mercury_enabled {
missing_deps.extend(get_missing_mercury_deps());
}
// no listed deps for opencomp
missing_deps.extend(self.ovr_comp.mod_type.get_missing_deps());
}
missing_deps.sort_unstable();
missing_deps.dedup(); // dedup only works if sorted, hence the above