fix: just buyild stardust without installing to a prefix

This commit is contained in:
Gabriele Musco 2023-12-08 09:04:27 +00:00
commit 8b1583a973

View file

@ -3,10 +3,10 @@ use std::{collections::VecDeque, path::PathBuf};
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct StardustServerSpec { pub struct StardustServerSpec {
repo: String, pub repo: String,
branch: String, pub branch: String,
debug: bool, pub debug: bool,
wayland_support: bool, pub wayland_support: bool,
} }
impl Default for StardustServerSpec { impl Default for StardustServerSpec {
fn default() -> Self { fn default() -> Self {
@ -21,42 +21,43 @@ impl Default for StardustServerSpec {
#[derive(Debug, Clone)] #[derive(Debug, Clone)]
pub struct StardustClientSpec { pub struct StardustClientSpec {
repo: String, pub repo: String,
branch: String, pub branch: String,
debug: bool, pub debug: bool,
} }
pub fn get_build_stardust_jobs( pub fn get_build_stardust_jobs(
prefix_path: PathBuf,
server_spec: StardustServerSpec, server_spec: StardustServerSpec,
client_specs: &[StardustClientSpec], client_specs: &[StardustClientSpec],
) -> VecDeque<WorkerJob> { ) -> VecDeque<WorkerJob> {
let mut jobs = VecDeque::<WorkerJob>::new(); let mut jobs = VecDeque::<WorkerJob>::new();
let server_git_dir = get_data_dir() + "/stardust-xr-server"; let server_git = Git {
let server_git_job = Git {
repo: server_spec.repo, repo: server_spec.repo,
dir: server_git_dir.clone(), dir: get_data_dir() + "/stardust/stardust-xr-server",
default_branch: server_spec.branch, default_branch: server_spec.branch,
}; };
jobs.extend(server_git_job.get_pre_build_jobs(true)); jobs.extend(server_git.get_pre_build_jobs(true));
let mut args = vec![ jobs.push_back(WorkerJob::new_cmd(
"install".into(), None,
"--path".into(), "cargo".into(),
server_git_dir, Some({
"--root".into(), let mut args = vec![
prefix_path.to_string_lossy().to_string(), "build".into(),
"--no-default-features".into(), "--path".into(),
]; server_git.dir,
if server_spec.wayland_support { "--no-default-features".into(),
args.push("--features".into()); ];
args.push("wayland".into()); if server_spec.wayland_support {
} args.push("--features".into());
if server_spec.debug { args.push("wayland".into());
args.push("--debug".into()); }
} if !server_spec.debug {
jobs.push_back(WorkerJob::new_cmd(None, "cargo".into(), Some(args))); args.push("--release".into());
}
args
}),
));
jobs jobs
} }