mirror of
https://gitlab.com/gabmus/envision.git
synced 2025-08-03 06:38:52 +00:00
feat: switch to rust for build orchestration of monado, opencomp, libsurvive, wivrn
This commit is contained in:
parent
a2b5057931
commit
cefdf35734
15 changed files with 262 additions and 241 deletions
|
@ -1,36 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -ev
|
|
||||||
|
|
||||||
REPO_DIR=$1
|
|
||||||
|
|
||||||
PREFIX=$2
|
|
||||||
|
|
||||||
DO_PULL=$3
|
|
||||||
|
|
||||||
REPO_URL=$4
|
|
||||||
|
|
||||||
if [[ -z $REPO_DIR ]] || [[ -z $PREFIX ]] || [[ -z $DO_PULL ]]; then
|
|
||||||
echo "Usage: $0 REPO_DIR PREFIX DO_PULL [REPO_URL]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $REPO_URL ]]; then
|
|
||||||
REPO_URL="https://github.com/cntools/libsurvive"
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$(dirname -- "$0")/_clone_or_pull.sh" "$REPO_URL" "$REPO_DIR" "$DO_PULL"
|
|
||||||
|
|
||||||
cd "$REPO_DIR"
|
|
||||||
rm -rf build
|
|
||||||
mkdir -p build
|
|
||||||
cd build
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DENABLE_api_example=OFF \
|
|
||||||
-DCMAKE_SKIP_INSTALL_RPATH=YES \
|
|
||||||
-Wno-dev \
|
|
||||||
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
|
|
||||||
-DCMAKE_INSTALL_LIBDIR="${PREFIX}/lib" \
|
|
||||||
.. -G Ninja
|
|
||||||
cmake --build .
|
|
||||||
cmake --install .
|
|
|
@ -1,39 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# exit on error
|
|
||||||
# echo commands
|
|
||||||
set -ev
|
|
||||||
|
|
||||||
REPO_DIR=$1
|
|
||||||
|
|
||||||
PREFIX=$2
|
|
||||||
|
|
||||||
DO_PULL=$3
|
|
||||||
|
|
||||||
REPO_URL=$4
|
|
||||||
|
|
||||||
if [[ -z $REPO_DIR ]] || [[ -z $PREFIX ]] || [[ -z $DO_PULL ]]; then
|
|
||||||
echo "Usage: $0 REPO_DIR PREFIX DO_PULL [REPO_URL]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $REPO_URL ]]; then
|
|
||||||
REPO_URL="https://gitlab.freedesktop.org/monado/monado"
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$(dirname -- "$0")/_clone_or_pull.sh" "$REPO_URL" "$REPO_DIR" "$DO_PULL"
|
|
||||||
|
|
||||||
cd "$REPO_DIR"
|
|
||||||
rm -rf build
|
|
||||||
mkdir -p build
|
|
||||||
cd build
|
|
||||||
export PKG_CONFIG_PATH="${PREFIX}/lib/pkgconfig"
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DXRT_HAVE_SYSTEM_CJSON=NO \
|
|
||||||
-DCMAKE_LIBDIR="${PREFIX}/lib" \
|
|
||||||
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
|
|
||||||
-DCMAKE_C_FLAGS="-Wl,-rpath ${PREFIX}/lib" \
|
|
||||||
-DCMAKE_CXX_FLAGS="-Wl,-rpath ${PREFIX}/lib" \
|
|
||||||
.. -G Ninja
|
|
||||||
cmake --build .
|
|
||||||
cmake --install .
|
|
|
@ -1,29 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# exit on error
|
|
||||||
# echo commands
|
|
||||||
set -ev
|
|
||||||
|
|
||||||
REPO_DIR=$1
|
|
||||||
|
|
||||||
DO_PULL=$2
|
|
||||||
|
|
||||||
REPO_URL=$3
|
|
||||||
|
|
||||||
if [[ -z $REPO_DIR ]] || [[ -z $DO_PULL ]]; then
|
|
||||||
echo "Usage: $0 REPO_DIR DO_PULL [REPO_URL]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $REPO_URL ]]; then
|
|
||||||
REPO_URL="https://gitlab.com/znixian/OpenOVR.git"
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$(dirname -- "$0")/_clone_or_pull.sh" "$REPO_URL" "$REPO_DIR" "$DO_PULL"
|
|
||||||
|
|
||||||
cd "$REPO_DIR"
|
|
||||||
rm -rf build
|
|
||||||
mkdir -p build
|
|
||||||
cd build
|
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release .. -G Ninja
|
|
||||||
cmake --build .
|
|
|
@ -1,36 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# exit on error
|
|
||||||
# echo commands
|
|
||||||
set -ev
|
|
||||||
|
|
||||||
REPO_DIR=$1
|
|
||||||
|
|
||||||
PREFIX=$2
|
|
||||||
|
|
||||||
DO_PULL=$3
|
|
||||||
|
|
||||||
REPO_URL=$4
|
|
||||||
|
|
||||||
if [[ -z $REPO_DIR ]] || [[ -z $PREFIX ]] || [[ -z $DO_PULL ]]; then
|
|
||||||
echo "Usage: $0 REPO_DIR PREFIX DO_PULL [REPO_URL]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z $REPO_URL ]]; then
|
|
||||||
REPO_URL="https://github.com/Meumeu/WiVRn"
|
|
||||||
fi
|
|
||||||
|
|
||||||
"$(dirname -- "$0")/_clone_or_pull.sh" "$REPO_URL" "$REPO_DIR" "$DO_PULL"
|
|
||||||
|
|
||||||
cd "$REPO_DIR"
|
|
||||||
rm -rf build
|
|
||||||
mkdir -p build
|
|
||||||
cd build
|
|
||||||
cmake -B build-server -DCMAKE_BUILD_TYPE=Release \
|
|
||||||
-DXRT_HAVE_SYSTEM_CJSON=NO \
|
|
||||||
-DWIVRN_BUILD_CLIENT=OFF \
|
|
||||||
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
|
|
||||||
.. -GNinja
|
|
||||||
cmake --build build-server
|
|
||||||
ninja -C build-server install
|
|
|
@ -1,7 +1,3 @@
|
||||||
install_data('_clone_or_pull.sh', install_dir: pkgdatadir / 'scripts')
|
install_data('_clone_or_pull.sh', install_dir: pkgdatadir / 'scripts')
|
||||||
install_data('build_basalt.sh', install_dir: pkgdatadir / 'scripts')
|
install_data('build_basalt.sh', install_dir: pkgdatadir / 'scripts')
|
||||||
install_data('build_libsurvive.sh', install_dir: pkgdatadir / 'scripts')
|
|
||||||
install_data('build_monado.sh', install_dir: pkgdatadir / 'scripts')
|
|
||||||
install_data('build_mercury.sh', install_dir: pkgdatadir / 'scripts')
|
install_data('build_mercury.sh', install_dir: pkgdatadir / 'scripts')
|
||||||
install_data('build_opencomposite.sh', install_dir: pkgdatadir / 'scripts')
|
|
||||||
install_data('build_wivrn.sh', install_dir: pkgdatadir / 'scripts')
|
|
||||||
|
|
|
@ -20,7 +20,12 @@ impl Cmake {
|
||||||
if k.contains(" ") {
|
if k.contains(" ") {
|
||||||
panic!("Cmake vars cannot contain spaces!");
|
panic!("Cmake vars cannot contain spaces!");
|
||||||
}
|
}
|
||||||
args.push(format!("-D{k}=\"{v}\"", k=k, v=v));
|
if v.contains(" ") {
|
||||||
|
args.push(format!("-D{k}=\"{v}\"", k=k, v=v));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.push(format!("-D{k}={v}", k=k, v=v));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
args.push(self.source_dir.clone());
|
args.push(self.source_dir.clone());
|
||||||
|
@ -32,4 +37,10 @@ impl Cmake {
|
||||||
"--build".into(), self.build_dir.clone()
|
"--build".into(), self.build_dir.clone()
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_install_runner(&self) -> Runner {
|
||||||
|
Runner::new(self.env.clone(), "cmake".into(), vec![
|
||||||
|
"--install".into(), self.build_dir.clone()
|
||||||
|
])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
59
src/build_tools/git.rs
Normal file
59
src/build_tools/git.rs
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
use std::path::Path;
|
||||||
|
|
||||||
|
use crate::{profile::Profile, runner::Runner};
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct Git {
|
||||||
|
pub repo: String,
|
||||||
|
pub dir: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Git {
|
||||||
|
pub fn get_reset_runner(&self) -> Runner {
|
||||||
|
Runner::new(
|
||||||
|
None,
|
||||||
|
"git".into(),
|
||||||
|
vec![
|
||||||
|
"-C".into(),
|
||||||
|
self.dir.clone(),
|
||||||
|
"reset".into(),
|
||||||
|
"--hard".into(),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_pull_runner(&self) -> Runner {
|
||||||
|
Runner::new(
|
||||||
|
None,
|
||||||
|
"git".into(),
|
||||||
|
vec!["-C".into(), self.dir.clone(), "pull".into()],
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_clone_runner(&self) -> Runner {
|
||||||
|
Runner::new(
|
||||||
|
None,
|
||||||
|
"git".into(),
|
||||||
|
vec!["clone".into(), self.repo.clone(), self.dir.clone()],
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn get_clone_or_not_runner(&self) -> Option<Runner> {
|
||||||
|
let path_s = format!("{}/.git", self.dir.clone());
|
||||||
|
let path = Path::new(&path_s);
|
||||||
|
if path.is_dir() {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
Some(self.get_clone_runner())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn clone_or_pull(&self, profile: &Profile) -> Option<Runner> {
|
||||||
|
match self.get_clone_or_not_runner() {
|
||||||
|
Some(r) => Some(r),
|
||||||
|
None => match profile.pull_on_build {
|
||||||
|
true => Some(self.get_pull_runner()),
|
||||||
|
false => None,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1 +1,2 @@
|
||||||
pub mod cmake;
|
pub mod cmake;
|
||||||
|
pub mod git;
|
||||||
|
|
|
@ -1,18 +1,18 @@
|
||||||
use crate::{constants::pkg_data_dir, profile::Profile, runner::Runner};
|
use crate::{constants::pkg_data_dir, profile::Profile, runner::Runner};
|
||||||
|
|
||||||
pub fn get_build_basalt_runner(profile: Profile) -> Runner {
|
pub fn get_build_basalt_runner(profile: &Profile) -> Runner {
|
||||||
let mut args = vec![
|
let mut args = vec![
|
||||||
profile
|
profile
|
||||||
.features.basalt.path
|
.features.basalt.path.clone()
|
||||||
.expect("Missing basalt path for given profile"),
|
.expect("Missing basalt path for given profile"),
|
||||||
profile.prefix,
|
profile.prefix.clone(),
|
||||||
match profile.pull_on_build {
|
match profile.pull_on_build {
|
||||||
true => "1".into(),
|
true => "1".into(),
|
||||||
false => "0".into(),
|
false => "0".into(),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
if profile.features.basalt.repo.is_some() {
|
if profile.features.basalt.repo.is_some() {
|
||||||
args.push(profile.features.basalt.repo.unwrap());
|
args.push(profile.features.basalt.repo.as_ref().unwrap().clone());
|
||||||
}
|
}
|
||||||
let runner = Runner::new(
|
let runner = Runner::new(
|
||||||
None,
|
None,
|
||||||
|
|
|
@ -1,26 +1,49 @@
|
||||||
use crate::{constants::pkg_data_dir, profile::Profile, runner::Runner};
|
use crate::{
|
||||||
|
build_tools::{cmake::Cmake, git::Git},
|
||||||
|
file_utils::rm_rf,
|
||||||
|
profile::Profile,
|
||||||
|
runner::Runner,
|
||||||
|
};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
pub fn get_build_libsurvive_runner(profile: Profile) -> Runner {
|
pub fn get_build_libsurvive_runners(profile: &Profile) -> Vec<Runner> {
|
||||||
let mut args = vec![
|
let mut runners: Vec<Runner> = vec![];
|
||||||
profile
|
let git = Git {
|
||||||
.features.libsurvive.path
|
repo: match profile.features.libsurvive.repo.as_ref() {
|
||||||
.expect("Missing libsurvive path for given profile"),
|
Some(r) => r.clone(),
|
||||||
profile.prefix,
|
None => "https://github.com/cntools/libsurvive".into(),
|
||||||
match profile.pull_on_build {
|
|
||||||
true => "1".into(),
|
|
||||||
false => "0".into(),
|
|
||||||
},
|
},
|
||||||
];
|
dir: profile.features.libsurvive.path.as_ref().unwrap().clone(),
|
||||||
if profile.features.libsurvive.repo.is_some() {
|
};
|
||||||
args.push(profile.features.libsurvive.repo.unwrap());
|
match git.clone_or_pull(profile) {
|
||||||
}
|
Some(r) => runners.push(r),
|
||||||
let runner = Runner::new(
|
None => {}
|
||||||
None,
|
};
|
||||||
format!(
|
|
||||||
"{sysdata}/scripts/build_libsurvive.sh",
|
let build_dir = format!(
|
||||||
sysdata = pkg_data_dir()
|
"{}/build",
|
||||||
),
|
profile.features.libsurvive.path.as_ref().unwrap()
|
||||||
args,
|
|
||||||
);
|
);
|
||||||
runner
|
rm_rf(&build_dir);
|
||||||
|
let mut cmake_vars: HashMap<String, String> = HashMap::new();
|
||||||
|
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "Release".into());
|
||||||
|
cmake_vars.insert("ENABLE_api_example".into(), "OFF".into());
|
||||||
|
cmake_vars.insert("CMAKE_SKIP_INSTALL_RPATH".into(), "YES".into());
|
||||||
|
cmake_vars.insert("CMAKE_INSTALL_PREFIX".into(), profile.prefix.clone());
|
||||||
|
cmake_vars.insert(
|
||||||
|
"CMAKE_INSTALL_LIBDIR".into(),
|
||||||
|
format!("{}/lib", profile.prefix),
|
||||||
|
);
|
||||||
|
|
||||||
|
let cmake = Cmake {
|
||||||
|
env: None,
|
||||||
|
vars: Some(cmake_vars),
|
||||||
|
source_dir: profile.features.libsurvive.path.as_ref().unwrap().clone(),
|
||||||
|
build_dir,
|
||||||
|
};
|
||||||
|
runners.push(cmake.get_prepare_runner());
|
||||||
|
runners.push(cmake.get_build_runner());
|
||||||
|
runners.push(cmake.get_install_runner());
|
||||||
|
|
||||||
|
runners
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
use crate::{constants::pkg_data_dir, paths::get_cache_dir, profile::Profile, runner::Runner};
|
use crate::{constants::pkg_data_dir, paths::get_cache_dir, profile::Profile, runner::Runner};
|
||||||
|
|
||||||
pub fn get_build_mercury_runner(profile: Profile) -> Runner {
|
pub fn get_build_mercury_runner(profile: &Profile) -> Runner {
|
||||||
let args = vec![profile.prefix, get_cache_dir()];
|
let args = vec![profile.prefix.clone(), get_cache_dir()];
|
||||||
let runner = Runner::new(
|
let runner = Runner::new(
|
||||||
None,
|
None,
|
||||||
format!(
|
format!(
|
||||||
|
|
|
@ -1,21 +1,55 @@
|
||||||
use crate::{constants::pkg_data_dir, profile::Profile, runner::Runner};
|
use crate::{
|
||||||
|
build_tools::{cmake::Cmake, git::Git},
|
||||||
|
file_utils::rm_rf,
|
||||||
|
profile::Profile,
|
||||||
|
runner::Runner,
|
||||||
|
};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
pub fn get_build_monado_runner(profile: Profile) -> Runner {
|
pub fn get_build_monado_runners(profile: &Profile) -> Vec<Runner> {
|
||||||
let mut args = vec![
|
let mut runners: Vec<Runner> = vec![];
|
||||||
profile.xrservice_path,
|
let git = Git {
|
||||||
profile.prefix,
|
repo: match profile.xrservice_repo.as_ref() {
|
||||||
match profile.pull_on_build {
|
Some(r) => r.clone(),
|
||||||
true => "1".into(),
|
None => "https://gitlab.freedesktop.org/monado/monado".into(),
|
||||||
false => "0".into(),
|
|
||||||
},
|
},
|
||||||
];
|
dir: profile.xrservice_path.clone(),
|
||||||
if profile.xrservice_repo.is_some() {
|
};
|
||||||
args.push(profile.xrservice_repo.unwrap());
|
match git.clone_or_pull(profile) {
|
||||||
}
|
Some(r) => runners.push(r),
|
||||||
let runner = Runner::new(
|
None => {}
|
||||||
None,
|
};
|
||||||
format!("{sysdata}/scripts/build_monado.sh", sysdata = pkg_data_dir()),
|
|
||||||
args,
|
let build_dir = format!("{}/build", profile.xrservice_path);
|
||||||
|
rm_rf(&build_dir);
|
||||||
|
let mut env: HashMap<String, String> = HashMap::new();
|
||||||
|
env.insert(
|
||||||
|
"PKG_CONFIG_PATH".into(),
|
||||||
|
format!("{}/lib/pkgconfig", profile.prefix),
|
||||||
);
|
);
|
||||||
runner
|
let mut cmake_vars: HashMap<String, String> = HashMap::new();
|
||||||
|
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "Release".into());
|
||||||
|
cmake_vars.insert("XRT_HAVE_SYSTEM_CJSON".into(), "NO".into());
|
||||||
|
cmake_vars.insert("CMAKE_LIBDIR".into(), format!("{}/lib", profile.prefix));
|
||||||
|
cmake_vars.insert("CMAKE_INSTALL_PREFIX".into(), profile.prefix.clone());
|
||||||
|
cmake_vars.insert(
|
||||||
|
"CMAKE_C_FLAGS".into(),
|
||||||
|
format!("-Wl,-rpath='{}/lib'", profile.prefix),
|
||||||
|
);
|
||||||
|
cmake_vars.insert(
|
||||||
|
"CMAKE_CXX_FLAGS".into(),
|
||||||
|
format!("-Wl,-rpath='{}/lib'", profile.prefix),
|
||||||
|
);
|
||||||
|
|
||||||
|
let cmake = Cmake {
|
||||||
|
env: Some(env),
|
||||||
|
vars: Some(cmake_vars),
|
||||||
|
source_dir: profile.xrservice_path.clone(),
|
||||||
|
build_dir,
|
||||||
|
};
|
||||||
|
runners.push(cmake.get_prepare_runner());
|
||||||
|
runners.push(cmake.get_build_runner());
|
||||||
|
runners.push(cmake.get_install_runner());
|
||||||
|
|
||||||
|
runners
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +1,37 @@
|
||||||
use crate::{constants::pkg_data_dir, profile::Profile, runner::Runner};
|
use crate::{
|
||||||
|
build_tools::{cmake::Cmake, git::Git},
|
||||||
|
file_utils::rm_rf,
|
||||||
|
profile::Profile,
|
||||||
|
runner::Runner,
|
||||||
|
};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
pub fn get_build_opencomposite_runner(profile: Profile) -> Runner {
|
pub fn get_build_opencomposite_runners(profile: &Profile) -> Vec<Runner> {
|
||||||
let mut args = vec![
|
let mut runners: Vec<Runner> = vec![];
|
||||||
profile.opencomposite_path,
|
let git = Git {
|
||||||
match profile.pull_on_build {
|
repo: match profile.opencomposite_repo.as_ref() {
|
||||||
true => "1".into(),
|
Some(r) => r.clone(),
|
||||||
false => "0".into(),
|
None => "https://gitlab.com/znixian/OpenOVR.git".into(),
|
||||||
},
|
},
|
||||||
];
|
dir: profile.opencomposite_path.clone(),
|
||||||
if profile.opencomposite_repo.is_some() {
|
};
|
||||||
args.push(profile.opencomposite_repo.unwrap());
|
match git.clone_or_pull(profile) {
|
||||||
}
|
Some(r) => runners.push(r),
|
||||||
let runner = Runner::new(
|
None => {}
|
||||||
None,
|
};
|
||||||
format!(
|
|
||||||
"{sysdata}/scripts/build_opencomposite.sh",
|
let build_dir = format!("{}/build", profile.opencomposite_path);
|
||||||
sysdata = pkg_data_dir()
|
rm_rf(&build_dir);
|
||||||
),
|
let mut cmake_vars: HashMap<String, String> = HashMap::new();
|
||||||
args,
|
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "Release".into());
|
||||||
);
|
let cmake = Cmake {
|
||||||
runner
|
env: None,
|
||||||
|
vars: Some(cmake_vars),
|
||||||
|
source_dir: profile.opencomposite_path.clone(),
|
||||||
|
build_dir,
|
||||||
|
};
|
||||||
|
runners.push(cmake.get_prepare_runner());
|
||||||
|
runners.push(cmake.get_build_runner());
|
||||||
|
|
||||||
|
runners
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +1,42 @@
|
||||||
use crate::{constants::pkg_data_dir, profile::Profile, runner::Runner};
|
use crate::{
|
||||||
|
build_tools::{cmake::Cmake, git::Git},
|
||||||
|
file_utils::rm_rf,
|
||||||
|
profile::Profile,
|
||||||
|
runner::Runner,
|
||||||
|
};
|
||||||
|
use std::collections::HashMap;
|
||||||
|
|
||||||
pub fn get_build_wivrn_runner(profile: Profile) -> Runner {
|
pub fn get_build_wivrn_runners(profile: &Profile) -> Vec<Runner> {
|
||||||
let mut args = vec![
|
let mut runners: Vec<Runner> = vec![];
|
||||||
profile.xrservice_path,
|
let git = Git {
|
||||||
profile.prefix,
|
repo: match profile.xrservice_repo.as_ref() {
|
||||||
match profile.pull_on_build {
|
Some(r) => r.clone(),
|
||||||
true => "1".into(),
|
None => "https://github.com/Meumeu/WiVRn".into(),
|
||||||
false => "0".into(),
|
|
||||||
},
|
},
|
||||||
];
|
dir: profile.xrservice_path.clone(),
|
||||||
if profile.xrservice_repo.is_some() {
|
};
|
||||||
args.push(profile.xrservice_repo.unwrap());
|
match git.clone_or_pull(profile) {
|
||||||
}
|
Some(r) => runners.push(r),
|
||||||
let runner = Runner::new(
|
None => {}
|
||||||
None,
|
};
|
||||||
format!("{sysdata}/scripts/build_wivrn.sh", sysdata = pkg_data_dir()),
|
|
||||||
args,
|
let build_dir = format!("{}/build", profile.xrservice_path);
|
||||||
);
|
rm_rf(&build_dir);
|
||||||
runner
|
let mut cmake_vars: HashMap<String, String> = HashMap::new();
|
||||||
|
cmake_vars.insert("CMAKE_BUILD_TYPE".into(), "Release".into());
|
||||||
|
cmake_vars.insert("XRT_HAVE_SYSTEM_CJSON".into(), "NO".into());
|
||||||
|
cmake_vars.insert("WIVRN_BUILD_CLIENT".into(), "OFF".into());
|
||||||
|
cmake_vars.insert("CMAKE_INSTALL_PREFIX".into(), profile.prefix.clone());
|
||||||
|
|
||||||
|
let cmake = Cmake {
|
||||||
|
env: None,
|
||||||
|
vars: Some(cmake_vars),
|
||||||
|
source_dir: profile.xrservice_path.clone(),
|
||||||
|
build_dir,
|
||||||
|
};
|
||||||
|
runners.push(cmake.get_prepare_runner());
|
||||||
|
runners.push(cmake.get_build_runner());
|
||||||
|
runners.push(cmake.get_install_runner());
|
||||||
|
|
||||||
|
runners
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,11 +4,11 @@ use super::debug_view::{DebugView, DebugViewMsg};
|
||||||
use super::libsurvive_setup_window::LibsurviveSetupWindow;
|
use super::libsurvive_setup_window::LibsurviveSetupWindow;
|
||||||
use super::main_view::MainViewMsg;
|
use super::main_view::MainViewMsg;
|
||||||
use crate::builders::build_basalt::get_build_basalt_runner;
|
use crate::builders::build_basalt::get_build_basalt_runner;
|
||||||
use crate::builders::build_libsurvive::get_build_libsurvive_runner;
|
use crate::builders::build_libsurvive::get_build_libsurvive_runners;
|
||||||
use crate::builders::build_mercury::get_build_mercury_runner;
|
use crate::builders::build_mercury::get_build_mercury_runner;
|
||||||
use crate::builders::build_monado::get_build_monado_runner;
|
use crate::builders::build_monado::get_build_monado_runners;
|
||||||
use crate::builders::build_opencomposite::get_build_opencomposite_runner;
|
use crate::builders::build_opencomposite::get_build_opencomposite_runners;
|
||||||
use crate::builders::build_wivrn::get_build_wivrn_runner;
|
use crate::builders::build_wivrn::get_build_wivrn_runners;
|
||||||
use crate::config::Config;
|
use crate::config::Config;
|
||||||
use crate::constants::APP_NAME;
|
use crate::constants::APP_NAME;
|
||||||
use crate::depcheck::check_dependency;
|
use crate::depcheck::check_dependency;
|
||||||
|
@ -346,11 +346,13 @@ impl SimpleComponent for App {
|
||||||
RunnerStatus::Stopped(_) => {}
|
RunnerStatus::Stopped(_) => {}
|
||||||
RunnerStatus::Running => {
|
RunnerStatus::Running => {
|
||||||
if self.xrservice_runner.is_some() {
|
if self.xrservice_runner.is_some() {
|
||||||
if self.xrservice_runner.as_mut().unwrap().status() == RunnerStatus::Running {
|
if self.xrservice_runner.as_mut().unwrap().status()
|
||||||
|
== RunnerStatus::Running
|
||||||
|
{
|
||||||
self.xrservice_runner.as_mut().unwrap().terminate();
|
self.xrservice_runner.as_mut().unwrap().terminate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
self.start_xrservice();
|
self.start_xrservice();
|
||||||
|
@ -367,23 +369,23 @@ impl SimpleComponent for App {
|
||||||
});
|
});
|
||||||
if profile.features.libsurvive.enabled {
|
if profile.features.libsurvive.enabled {
|
||||||
missing_deps.extend(get_missing_libsurvive_deps());
|
missing_deps.extend(get_missing_libsurvive_deps());
|
||||||
runners.push(get_build_libsurvive_runner(profile.clone()));
|
runners.extend(get_build_libsurvive_runners(&profile));
|
||||||
}
|
}
|
||||||
if profile.features.basalt.enabled {
|
if profile.features.basalt.enabled {
|
||||||
missing_deps.extend(get_missing_basalt_deps());
|
missing_deps.extend(get_missing_basalt_deps());
|
||||||
runners.push(get_build_basalt_runner(profile.clone()));
|
runners.push(get_build_basalt_runner(&profile));
|
||||||
}
|
}
|
||||||
if profile.features.mercury_enabled {
|
if profile.features.mercury_enabled {
|
||||||
missing_deps.extend(get_missing_mercury_deps());
|
missing_deps.extend(get_missing_mercury_deps());
|
||||||
runners.push(get_build_mercury_runner(profile.clone()));
|
runners.push(get_build_mercury_runner(&profile));
|
||||||
}
|
}
|
||||||
runners.push(match profile.xrservice_type {
|
runners.extend(match profile.xrservice_type {
|
||||||
XRServiceType::Monado => get_build_monado_runner(profile.clone()),
|
XRServiceType::Monado => get_build_monado_runners(&profile),
|
||||||
XRServiceType::Wivrn => get_build_wivrn_runner(profile.clone()),
|
XRServiceType::Wivrn => get_build_wivrn_runners(&profile),
|
||||||
});
|
});
|
||||||
// no listed deps for opencomp
|
// no listed deps for opencomp
|
||||||
}
|
}
|
||||||
runners.push(get_build_opencomposite_runner(profile.clone()));
|
runners.extend(get_build_opencomposite_runners(&profile));
|
||||||
if !missing_deps.is_empty() {
|
if !missing_deps.is_empty() {
|
||||||
missing_deps.sort_unstable();
|
missing_deps.sort_unstable();
|
||||||
missing_deps.dedup(); // dedup only works if sorted, hence the above
|
missing_deps.dedup(); // dedup only works if sorted, hence the above
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue