From 8b1583a9736e810d9279b846896baec659244306 Mon Sep 17 00:00:00 2001 From: Gabriele Musco Date: Fri, 8 Dec 2023 09:04:27 +0000 Subject: [PATCH] fix: just buyild stardust without installing to a prefix --- src/builders/build_stardust.rs | 59 +++++++++++++++++----------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/builders/build_stardust.rs b/src/builders/build_stardust.rs index 2fa0301..1d541ff 100644 --- a/src/builders/build_stardust.rs +++ b/src/builders/build_stardust.rs @@ -3,10 +3,10 @@ use std::{collections::VecDeque, path::PathBuf}; #[derive(Debug, Clone)] pub struct StardustServerSpec { - repo: String, - branch: String, - debug: bool, - wayland_support: bool, + pub repo: String, + pub branch: String, + pub debug: bool, + pub wayland_support: bool, } impl Default for StardustServerSpec { fn default() -> Self { @@ -21,42 +21,43 @@ impl Default for StardustServerSpec { #[derive(Debug, Clone)] pub struct StardustClientSpec { - repo: String, - branch: String, - debug: bool, + pub repo: String, + pub branch: String, + pub debug: bool, } pub fn get_build_stardust_jobs( - prefix_path: PathBuf, server_spec: StardustServerSpec, client_specs: &[StardustClientSpec], ) -> VecDeque { let mut jobs = VecDeque::::new(); - let server_git_dir = get_data_dir() + "/stardust-xr-server"; - - let server_git_job = Git { + let server_git = Git { repo: server_spec.repo, - dir: server_git_dir.clone(), + dir: get_data_dir() + "/stardust/stardust-xr-server", default_branch: server_spec.branch, }; - jobs.extend(server_git_job.get_pre_build_jobs(true)); - let mut args = vec![ - "install".into(), - "--path".into(), - server_git_dir, - "--root".into(), - prefix_path.to_string_lossy().to_string(), - "--no-default-features".into(), - ]; - if server_spec.wayland_support { - args.push("--features".into()); - args.push("wayland".into()); - } - if server_spec.debug { - args.push("--debug".into()); - } - jobs.push_back(WorkerJob::new_cmd(None, "cargo".into(), Some(args))); + jobs.extend(server_git.get_pre_build_jobs(true)); + jobs.push_back(WorkerJob::new_cmd( + None, + "cargo".into(), + Some({ + let mut args = vec![ + "build".into(), + "--path".into(), + server_git.dir, + "--no-default-features".into(), + ]; + if server_spec.wayland_support { + args.push("--features".into()); + args.push("wayland".into()); + } + if !server_spec.debug { + args.push("--release".into()); + } + args + }), + )); jobs }