diff --git a/pkgs/by-name/en/envision/autopatchelf.patch b/pkgs/by-name/en/envision/autopatchelf.patch new file mode 100644 index 00000000000000..d3063f74063d23 --- /dev/null +++ b/pkgs/by-name/en/envision/autopatchelf.patch @@ -0,0 +1,205 @@ +diff --git a/src/builders/build_basalt.rs b/src/builders/build_basalt.rs +index e67e081..0162e1d 100644 +--- a/src/builders/build_basalt.rs ++++ b/src/builders/build_basalt.rs +@@ -6,6 +6,7 @@ use crate::{ + util::file_utils::rm_rf, + }; + use std::collections::{HashMap, VecDeque}; ++use std::env; + + pub fn get_build_basalt_jobs(profile: &Profile, clean_build: bool) -> VecDeque { + let mut jobs = VecDeque::::new(); +@@ -101,6 +102,21 @@ pub fn get_build_basalt_jobs(profile: &Profile, clean_build: bool) -> VecDeque VecDeque { + let mut jobs = VecDeque::::new(); +@@ -71,6 +72,21 @@ pub fn get_build_libsurvive_jobs(profile: &Profile, clean_build: bool) -> VecDeq + } + jobs.push_back(cmake.get_build_job()); + jobs.push_back(cmake.get_install_job()); ++ jobs.push_back(WorkerJob::new_cmd( ++ None, ++ "auto-patchelf".into(), ++ Some( ++ [ ++ vec![ ++ "--no-add-existing", ++ "--paths".into(), ++ build_dir.into_os_string().into_string().unwrap(), ++ "--libs".into(), ++ ], ++ env::var("libs").unwrap_or_default().split(":").map(|s| s.to_string()).collect(), ++ ].concat() ++ ), ++ )); + + jobs + } +diff --git a/src/builders/build_monado.rs b/src/builders/build_monado.rs +index f379d6f..79d8fb9 100644 +--- a/src/builders/build_monado.rs ++++ b/src/builders/build_monado.rs +@@ -9,6 +9,7 @@ use std::{ + collections::{HashMap, VecDeque}, + path::Path, + }; ++use std::env; + + pub fn get_build_monado_jobs(profile: &Profile, clean_build: bool) -> VecDeque { + let mut jobs = VecDeque::::new(); +@@ -83,6 +84,21 @@ pub fn get_build_monado_jobs(profile: &Profile, clean_build: bool) -> VecDeque VecDeque { + let mut jobs = VecDeque::::new(); +@@ -48,6 +49,21 @@ pub fn get_build_opencomposite_jobs(profile: &Profile, clean_build: bool) -> Vec + jobs.push_back(cmake.get_prepare_job()); + } + jobs.push_back(cmake.get_build_job()); ++ jobs.push_back(WorkerJob::new_cmd( ++ None, ++ "auto-patchelf".into(), ++ Some( ++ [ ++ vec![ ++ "--no-add-existing", ++ "--paths".into(), ++ build_dir.into_os_string().into_string().unwrap(), ++ "--libs".into(), ++ ], ++ env::var("libs").unwrap_or_default().split(":").map(|s| s.to_string()).collect(), ++ ].concat() ++ ), ++ )); + + jobs + } +diff --git a/src/builders/build_openhmd.rs b/src/builders/build_openhmd.rs +index 1157eca..359f49c 100644 +--- a/src/builders/build_openhmd.rs ++++ b/src/builders/build_openhmd.rs +@@ -3,6 +3,7 @@ use crate::{ + util::file_utils::rm_rf, + }; + use std::{collections::VecDeque, path::Path}; ++use std::env; + + pub fn get_build_openhmd_jobs(profile: &Profile, clean_build: bool) -> VecDeque { + let mut jobs = VecDeque::::new(); +@@ -80,6 +81,22 @@ pub fn get_build_openhmd_jobs(profile: &Profile, clean_build: bool) -> VecDeque< + "install".into(), + ]), + )); ++ // autopatchelf job ++ jobs.push_back(WorkerJob::new_cmd( ++ None, ++ "auto-patchelf".into(), ++ Some( ++ [ ++ vec![ ++ "--no-add-existing", ++ "--paths".into(), ++ build_dir.into_os_string().into_string().unwrap(), ++ "--libs".into(), ++ ], ++ env::var("libs").unwrap_or_default().split(":").map(|s| s.to_string()).collect(), ++ ].concat() ++ ), ++ )); + + jobs + } +diff --git a/src/builders/build_wivrn.rs b/src/builders/build_wivrn.rs +index f2a415d..a160186 100644 +--- a/src/builders/build_wivrn.rs ++++ b/src/builders/build_wivrn.rs +@@ -9,6 +9,7 @@ use std::{ + collections::{HashMap, VecDeque}, + path::Path, + }; ++use std::env; + + pub fn get_build_wivrn_jobs(profile: &Profile, clean_build: bool) -> VecDeque { + let mut jobs = VecDeque::::new(); +@@ -60,6 +61,21 @@ pub fn get_build_wivrn_jobs(profile: &Profile, clean_build: bool) -> VecDeque