mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-17 07:49:03 +00:00
feat: move dependency collection to profile method
This commit is contained in:
parent
00322492bd
commit
afbebfc2ec
2 changed files with 33 additions and 18 deletions
|
@ -1,4 +1,9 @@
|
||||||
use crate::{
|
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,
|
||||||
|
},
|
||||||
paths::{get_data_dir, BWRAP_SYSTEM_PREFIX, SYSTEM_PREFIX},
|
paths::{get_data_dir, BWRAP_SYSTEM_PREFIX, SYSTEM_PREFIX},
|
||||||
util::file_utils::get_writer,
|
util::file_utils::get_writer,
|
||||||
xdg::XDG,
|
xdg::XDG,
|
||||||
|
@ -555,6 +560,32 @@ impl Profile {
|
||||||
pub fn libopenxr_so(&self) -> Option<PathBuf> {
|
pub fn libopenxr_so(&self) -> Option<PathBuf> {
|
||||||
self.find_so(self.xrservice_type.libopenxr_path())
|
self.find_so(self.xrservice_type.libopenxr_path())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn missing_dependencies(&self) -> Vec<Dependency> {
|
||||||
|
let mut missing_deps = Vec::new();
|
||||||
|
if self.can_be_built {
|
||||||
|
missing_deps.extend(match self.xrservice_type {
|
||||||
|
XRServiceType::Monado => get_missing_monado_deps(),
|
||||||
|
XRServiceType::Wivrn => get_missing_wivrn_deps(),
|
||||||
|
});
|
||||||
|
if self.features.libsurvive.enabled {
|
||||||
|
missing_deps.extend(get_missing_libsurvive_deps());
|
||||||
|
}
|
||||||
|
if self.features.openhmd.enabled {
|
||||||
|
missing_deps.extend(get_missing_openhmd_deps());
|
||||||
|
}
|
||||||
|
if self.features.basalt.enabled {
|
||||||
|
missing_deps.extend(get_missing_basalt_deps());
|
||||||
|
}
|
||||||
|
if self.features.mercury_enabled {
|
||||||
|
missing_deps.extend(get_missing_mercury_deps());
|
||||||
|
}
|
||||||
|
// no listed deps for opencomp
|
||||||
|
}
|
||||||
|
missing_deps.sort_unstable();
|
||||||
|
missing_deps.dedup(); // dedup only works if sorted, hence the above
|
||||||
|
missing_deps
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn prepare_ld_library_path(prefix: &Path) -> String {
|
pub fn prepare_ld_library_path(prefix: &Path) -> String {
|
||||||
|
|
|
@ -23,12 +23,7 @@ use crate::{
|
||||||
},
|
},
|
||||||
config::Config,
|
config::Config,
|
||||||
constants::APP_NAME,
|
constants::APP_NAME,
|
||||||
depcheck::{
|
depcheck::common::dep_pkexec,
|
||||||
basalt_deps::get_missing_basalt_deps, common::dep_pkexec,
|
|
||||||
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,
|
|
||||||
},
|
|
||||||
file_builders::{
|
file_builders::{
|
||||||
active_runtime_json::{
|
active_runtime_json::{
|
||||||
set_current_active_runtime_to_profile, set_current_active_runtime_to_steam,
|
set_current_active_runtime_to_profile, set_current_active_runtime_to_steam,
|
||||||
|
@ -458,41 +453,30 @@ impl AsyncComponent for App {
|
||||||
},
|
},
|
||||||
Msg::BuildProfile(clean_build) => {
|
Msg::BuildProfile(clean_build) => {
|
||||||
let profile = self.get_selected_profile();
|
let profile = self.get_selected_profile();
|
||||||
let mut missing_deps = vec![];
|
|
||||||
let mut jobs = VecDeque::<WorkerJob>::new();
|
let mut jobs = VecDeque::<WorkerJob>::new();
|
||||||
// profile per se can't be built, but we still need opencomp
|
// profile per se can't be built, but we still need opencomp
|
||||||
if profile.can_be_built {
|
if profile.can_be_built {
|
||||||
missing_deps.extend(match profile.xrservice_type {
|
|
||||||
XRServiceType::Monado => get_missing_monado_deps(),
|
|
||||||
XRServiceType::Wivrn => get_missing_wivrn_deps(),
|
|
||||||
});
|
|
||||||
if profile.features.libsurvive.enabled {
|
if profile.features.libsurvive.enabled {
|
||||||
missing_deps.extend(get_missing_libsurvive_deps());
|
|
||||||
jobs.extend(get_build_libsurvive_jobs(&profile, clean_build));
|
jobs.extend(get_build_libsurvive_jobs(&profile, clean_build));
|
||||||
}
|
}
|
||||||
if profile.features.openhmd.enabled {
|
if profile.features.openhmd.enabled {
|
||||||
missing_deps.extend(get_missing_openhmd_deps());
|
|
||||||
jobs.extend(get_build_openhmd_jobs(&profile, clean_build));
|
jobs.extend(get_build_openhmd_jobs(&profile, clean_build));
|
||||||
}
|
}
|
||||||
if profile.features.basalt.enabled {
|
if profile.features.basalt.enabled {
|
||||||
missing_deps.extend(get_missing_basalt_deps());
|
|
||||||
jobs.extend(get_build_basalt_jobs(&profile, clean_build));
|
jobs.extend(get_build_basalt_jobs(&profile, clean_build));
|
||||||
}
|
}
|
||||||
if profile.features.mercury_enabled {
|
if profile.features.mercury_enabled {
|
||||||
missing_deps.extend(get_missing_mercury_deps());
|
|
||||||
jobs.extend(get_build_mercury_jobs(&profile));
|
jobs.extend(get_build_mercury_jobs(&profile));
|
||||||
}
|
}
|
||||||
jobs.extend(match profile.xrservice_type {
|
jobs.extend(match profile.xrservice_type {
|
||||||
XRServiceType::Monado => get_build_monado_jobs(&profile, clean_build),
|
XRServiceType::Monado => get_build_monado_jobs(&profile, clean_build),
|
||||||
XRServiceType::Wivrn => get_build_wivrn_jobs(&profile, clean_build),
|
XRServiceType::Wivrn => get_build_wivrn_jobs(&profile, clean_build),
|
||||||
});
|
});
|
||||||
// no listed deps for opencomp
|
|
||||||
}
|
}
|
||||||
jobs.extend(get_build_opencomposite_jobs(&profile, clean_build));
|
jobs.extend(get_build_opencomposite_jobs(&profile, clean_build));
|
||||||
|
let missing_deps = profile.missing_dependencies();
|
||||||
if !(self.skip_depcheck || profile.skip_dependency_check || missing_deps.is_empty())
|
if !(self.skip_depcheck || profile.skip_dependency_check || missing_deps.is_empty())
|
||||||
{
|
{
|
||||||
missing_deps.sort_unstable();
|
|
||||||
missing_deps.dedup(); // dedup only works if sorted, hence the above
|
|
||||||
let distro = LinuxDistro::get();
|
let distro = LinuxDistro::get();
|
||||||
let (missing_package_list, install_missing_widget): (
|
let (missing_package_list, install_missing_widget): (
|
||||||
String,
|
String,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue