mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-09-28 04:08:38 +00:00
fix: properly build and install vapor
Co-authored-by: Gabriele Musco <gabmus@disroot.org>
This commit is contained in:
parent
5139ed7ba3
commit
754395586e
2 changed files with 12 additions and 30 deletions
|
@ -2,12 +2,11 @@ use crate::{
|
||||||
build_tools::{cmake::Cmake, git::Git},
|
build_tools::{cmake::Cmake, git::Git},
|
||||||
profile::Profile,
|
profile::Profile,
|
||||||
termcolor::TermColor,
|
termcolor::TermColor,
|
||||||
ui::job_worker::job::{FuncWorkerData, FuncWorkerOut, WorkerJob},
|
ui::job_worker::job::WorkerJob,
|
||||||
util::file_utils::{copy_file, rm_rf},
|
util::file_utils::rm_rf,
|
||||||
};
|
};
|
||||||
use std::{
|
use std::{
|
||||||
collections::{HashMap, VecDeque},
|
collections::{HashMap, VecDeque},
|
||||||
fs::create_dir_all,
|
|
||||||
path::Path,
|
path::Path,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -37,16 +36,22 @@ pub fn get_build_vapor_jobs(profile: &Profile, clean_build: bool) -> VecDeque<Wo
|
||||||
jobs.extend(git.get_pre_build_jobs(profile.pull_on_build));
|
jobs.extend(git.get_pre_build_jobs(profile.pull_on_build));
|
||||||
|
|
||||||
let build_dir = profile.ovr_comp.path.join("build");
|
let build_dir = profile.ovr_comp.path.join("build");
|
||||||
|
let install_dir = build_dir.join("install_pfx");
|
||||||
let cmake = Cmake {
|
let cmake = Cmake {
|
||||||
env: None,
|
env: None,
|
||||||
vars: Some({
|
vars: Some({
|
||||||
let mut cmake_vars: HashMap<String, String> = HashMap::new();
|
let mut cmake_vars: HashMap<String, String> = HashMap::new();
|
||||||
for (k, v) in [
|
for (k, v) in [
|
||||||
("VAPOR_LOG_SILENT=ON", "ON"),
|
("VAPOR_LOG_SILENT", "ON"),
|
||||||
|
("USE_SYSTEM_OPENXR", "OFF"),
|
||||||
("CMAKE_BUILD_TYPE", "RelWithDebInfo"),
|
("CMAKE_BUILD_TYPE", "RelWithDebInfo"),
|
||||||
] {
|
] {
|
||||||
cmake_vars.insert(k.to_string(), v.to_string());
|
cmake_vars.insert(k.to_string(), v.to_string());
|
||||||
}
|
}
|
||||||
|
cmake_vars.insert(
|
||||||
|
"CMAKE_INSTALL_PREFIX".into(),
|
||||||
|
install_dir.to_string_lossy().to_string(),
|
||||||
|
);
|
||||||
cmake_vars
|
cmake_vars
|
||||||
}),
|
}),
|
||||||
source_dir: profile.ovr_comp.path.clone(),
|
source_dir: profile.ovr_comp.path.clone(),
|
||||||
|
@ -57,29 +62,7 @@ pub fn get_build_vapor_jobs(profile: &Profile, clean_build: bool) -> VecDeque<Wo
|
||||||
jobs.push_back(cmake.get_prepare_job());
|
jobs.push_back(cmake.get_prepare_job());
|
||||||
}
|
}
|
||||||
jobs.push_back(cmake.get_build_job());
|
jobs.push_back(cmake.get_build_job());
|
||||||
jobs.push_back(WorkerJob::Func(FuncWorkerData {
|
jobs.push_back(cmake.get_install_job());
|
||||||
func: Box::new(move || {
|
|
||||||
let dest_dir = build_dir.join("bin/linux64");
|
|
||||||
if let Err(e) = create_dir_all(&dest_dir) {
|
|
||||||
return FuncWorkerOut {
|
|
||||||
success: false,
|
|
||||||
out: vec![format!(
|
|
||||||
"failed to create dir {}: {e}",
|
|
||||||
dest_dir.to_string_lossy()
|
|
||||||
)],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
copy_file(
|
|
||||||
&build_dir.join("src/vrclient.so"),
|
|
||||||
&dest_dir.join("vrclient.so"),
|
|
||||||
);
|
|
||||||
|
|
||||||
FuncWorkerOut {
|
|
||||||
success: true,
|
|
||||||
out: Vec::default(),
|
|
||||||
}
|
|
||||||
}),
|
|
||||||
}));
|
|
||||||
|
|
||||||
jobs
|
jobs
|
||||||
}
|
}
|
||||||
|
|
|
@ -341,9 +341,8 @@ impl ProfileOvrCompatibilityModule {
|
||||||
/// this should correspond to the build output directory
|
/// this should correspond to the build output directory
|
||||||
pub fn runtime_dir(&self) -> PathBuf {
|
pub fn runtime_dir(&self) -> PathBuf {
|
||||||
match self.mod_type {
|
match self.mod_type {
|
||||||
OvrCompatibilityModuleType::Opencomposite | OvrCompatibilityModuleType::Vapor => {
|
OvrCompatibilityModuleType::Opencomposite => self.path.join("build"),
|
||||||
self.path.join("build")
|
OvrCompatibilityModuleType::Vapor => self.path.join("build/install_pfx/lib/VapoR"),
|
||||||
}
|
|
||||||
OvrCompatibilityModuleType::Xrizer => self.path.join("target/release"),
|
OvrCompatibilityModuleType::Xrizer => self.path.join("target/release"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue