mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-09-29 12:48:38 +00:00
Merge branch 'fix/xrizer-depcheck' into 'main'
fix: xrizer deps Closes #204 See merge request gabmus/envision!128
This commit is contained in:
commit
ebd8b05bda
10 changed files with 107 additions and 52 deletions
|
@ -1,7 +1,7 @@
|
|||
use super::{
|
||||
boost_deps::boost_deps,
|
||||
common::{dep_cmake, dep_eigen, dep_gpp, dep_libgl, dep_ninja, dep_opencv},
|
||||
DepType, Dependency, DependencyCheckResult,
|
||||
DepType, DepcheckResultGetMissing, Dependency, DependencyCheckResult,
|
||||
};
|
||||
use crate::linux_distro::LinuxDistro;
|
||||
use std::collections::HashMap;
|
||||
|
@ -181,9 +181,5 @@ pub fn check_basalt_deps() -> Vec<DependencyCheckResult> {
|
|||
}
|
||||
|
||||
pub fn get_missing_basalt_deps() -> Vec<Dependency> {
|
||||
check_basalt_deps()
|
||||
.iter()
|
||||
.filter(|res| !res.found)
|
||||
.map(|res| res.dependency.clone())
|
||||
.collect()
|
||||
check_basalt_deps().filter_missing_deps()
|
||||
}
|
||||
|
|
|
@ -319,3 +319,19 @@ pub fn dep_getcap_setcap() -> Dependency {
|
|||
]),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn dep_glslc() -> Dependency {
|
||||
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, "shaderc".into()),
|
||||
(LinuxDistro::Gentoo, "media-libs/shaderc".into()),
|
||||
(LinuxDistro::Suse, "shaderc".into()),
|
||||
]),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use super::{
|
||||
common::{dep_cmake, dep_eigen, dep_gcc, dep_git, dep_gpp, dep_ninja},
|
||||
Dependency, DependencyCheckResult,
|
||||
DepcheckResultGetMissing, Dependency, DependencyCheckResult,
|
||||
};
|
||||
|
||||
fn libsurvive_deps() -> Vec<Dependency> {
|
||||
|
@ -19,9 +19,5 @@ pub fn check_libsurvive_deps() -> Vec<DependencyCheckResult> {
|
|||
}
|
||||
|
||||
pub fn get_missing_libsurvive_deps() -> Vec<Dependency> {
|
||||
check_libsurvive_deps()
|
||||
.iter()
|
||||
.filter(|res| !res.found)
|
||||
.map(|res| res.dependency.clone())
|
||||
.collect()
|
||||
check_libsurvive_deps().filter_missing_deps()
|
||||
}
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
use super::{common::dep_opencv, DepType, Dependency, DependencyCheckResult};
|
||||
use super::{
|
||||
common::dep_opencv, DepType, DepcheckResultGetMissing, Dependency, DependencyCheckResult,
|
||||
};
|
||||
use crate::linux_distro::LinuxDistro;
|
||||
use std::collections::HashMap;
|
||||
|
||||
|
@ -39,9 +41,5 @@ pub fn check_mercury_deps() -> Vec<DependencyCheckResult> {
|
|||
}
|
||||
|
||||
pub fn get_missing_mercury_deps() -> Vec<Dependency> {
|
||||
check_mercury_deps()
|
||||
.iter()
|
||||
.filter(|res| !res.found)
|
||||
.map(|res| res.dependency.clone())
|
||||
.collect()
|
||||
check_mercury_deps().filter_missing_deps()
|
||||
}
|
||||
|
|
|
@ -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};
|
||||
|
@ -108,6 +109,24 @@ impl Display for DependencyCheckResult {
|
|||
}
|
||||
}
|
||||
|
||||
pub trait DepcheckResultGetMissing {
|
||||
fn filter_missing_deps(self) -> Vec<Dependency>;
|
||||
}
|
||||
|
||||
impl DepcheckResultGetMissing for Vec<DependencyCheckResult> {
|
||||
fn filter_missing_deps(self) -> Vec<Dependency> {
|
||||
self.into_iter()
|
||||
.filter_map(|res| {
|
||||
if !res.found {
|
||||
Some(res.dependency)
|
||||
} else {
|
||||
None
|
||||
}
|
||||
})
|
||||
.collect()
|
||||
}
|
||||
}
|
||||
|
||||
fn shared_obj_paths() -> Vec<String> {
|
||||
vec![
|
||||
"/lib".into(),
|
||||
|
|
|
@ -4,9 +4,12 @@ use super::{
|
|||
dep_libgl, dep_libudev, dep_libx11, dep_libxcb, dep_ninja, dep_openxr, dep_vulkan_headers,
|
||||
dep_vulkan_icd_loader,
|
||||
},
|
||||
DepType, Dependency, DependencyCheckResult,
|
||||
DepType, DepcheckResultGetMissing, Dependency, DependencyCheckResult,
|
||||
};
|
||||
use crate::{
|
||||
depcheck::common::{dep_glslc, dep_libxrandr},
|
||||
linux_distro::LinuxDistro,
|
||||
};
|
||||
use crate::{depcheck::common::dep_libxrandr, linux_distro::LinuxDistro};
|
||||
use std::collections::HashMap;
|
||||
|
||||
fn monado_deps() -> Vec<Dependency> {
|
||||
|
@ -60,19 +63,7 @@ fn monado_deps() -> Vec<Dependency> {
|
|||
dep_ninja(),
|
||||
dep_gcc(),
|
||||
dep_gpp(),
|
||||
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, "shaderc".into()),
|
||||
(LinuxDistro::Gentoo, "media-libs/shaderc".into()),
|
||||
(LinuxDistro::Suse, "shaderc".into()),
|
||||
]),
|
||||
},
|
||||
dep_glslc(),
|
||||
dep_glslang_validator(),
|
||||
Dependency {
|
||||
name: "sdl2".into(),
|
||||
|
@ -131,9 +122,5 @@ pub fn check_monado_deps() -> Vec<DependencyCheckResult> {
|
|||
}
|
||||
|
||||
pub fn get_missing_monado_deps() -> Vec<Dependency> {
|
||||
check_monado_deps()
|
||||
.iter()
|
||||
.filter(|res| !res.found)
|
||||
.map(|res| res.dependency.clone())
|
||||
.collect()
|
||||
check_monado_deps().filter_missing_deps()
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
use super::{
|
||||
common::{dep_gcc, dep_git, dep_gpp, dep_ninja},
|
||||
Dependency, DependencyCheckResult,
|
||||
DepcheckResultGetMissing, Dependency, DependencyCheckResult,
|
||||
};
|
||||
use crate::linux_distro::LinuxDistro;
|
||||
use std::collections::HashMap;
|
||||
|
@ -31,9 +31,5 @@ pub fn check_openhmd_deps() -> Vec<DependencyCheckResult> {
|
|||
}
|
||||
|
||||
pub fn get_missing_openhmd_deps() -> Vec<Dependency> {
|
||||
check_openhmd_deps()
|
||||
.iter()
|
||||
.filter(|res| !res.found)
|
||||
.map(|res| res.dependency.clone())
|
||||
.collect()
|
||||
check_openhmd_deps().filter_missing_deps()
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ use super::{
|
|||
dep_libudev, dep_libx11, dep_libxcb, dep_ninja, dep_openxr, dep_vulkan_headers,
|
||||
dep_vulkan_icd_loader,
|
||||
},
|
||||
DepType, Dependency, DependencyCheckResult,
|
||||
DepType, DepcheckResultGetMissing, Dependency, DependencyCheckResult,
|
||||
};
|
||||
use crate::{
|
||||
depcheck::common::{dep_libgl, dep_libxrandr},
|
||||
|
@ -270,9 +270,5 @@ pub fn check_wivrn_deps() -> Vec<DependencyCheckResult> {
|
|||
}
|
||||
|
||||
pub fn get_missing_wivrn_deps() -> Vec<Dependency> {
|
||||
check_wivrn_deps()
|
||||
.iter()
|
||||
.filter(|res| !res.found)
|
||||
.map(|res| res.dependency.clone())
|
||||
.collect()
|
||||
check_wivrn_deps().filter_missing_deps()
|
||||
}
|
||||
|
|
41
src/depcheck/xrizer_deps.rs
Normal file
41
src/depcheck/xrizer_deps.rs
Normal file
|
@ -0,0 +1,41 @@
|
|||
use super::{DepType, DepcheckResultGetMissing, Dependency, DependencyCheckResult};
|
||||
use crate::{depcheck::common::dep_glslc, linux_distro::LinuxDistro};
|
||||
use std::collections::HashMap;
|
||||
|
||||
fn xrizer_deps() -> Vec<Dependency> {
|
||||
vec![
|
||||
dep_glslc(),
|
||||
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().filter_missing_deps()
|
||||
}
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue