diff --git a/src/depcheck/mod.rs b/src/depcheck/mod.rs index 002a8c8..e46b1e7 100644 --- a/src/depcheck/mod.rs +++ b/src/depcheck/mod.rs @@ -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}; diff --git a/src/depcheck/xrizer_deps.rs b/src/depcheck/xrizer_deps.rs new file mode 100644 index 0000000..ec48b4b --- /dev/null +++ b/src/depcheck/xrizer_deps.rs @@ -0,0 +1,57 @@ +use super::{DepType, Dependency, DependencyCheckResult}; +use crate::linux_distro::LinuxDistro; +use std::collections::HashMap; + +fn xrizer_deps() -> Vec { + 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 { + Dependency::check_many(xrizer_deps()) +} + +pub fn get_missing_xrizer_deps() -> Vec { + check_xrizer_deps() + .iter() + .filter(|res| !res.found) + .map(|res| res.dependency.clone()) + .collect() +} diff --git a/src/profile.rs b/src/profile.rs index a3344df..a8cb283 100644 --- a/src/profile.rs +++ b/src/profile.rs @@ -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 { + 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