fix(ci): explicitly use builtin jpeg and png libs in m1 pipeline

This commit is contained in:
Federico Terzi 2021-10-02 21:54:54 +02:00
parent c90ae3c128
commit b7a80c956a

View File

@ -203,7 +203,13 @@ fn build_native() {
Command::new(out_wx_dir.join("configure")) Command::new(out_wx_dir.join("configure"))
.current_dir(build_dir.to_string_lossy().to_string()) .current_dir(build_dir.to_string_lossy().to_string())
.args(&["--disable-shared", "--without-libtiff", "--without-liblzma"]) .args(&[
"--disable-shared",
"--without-libtiff",
"--without-liblzma",
"--with-libjpeg=builtin",
"--with-libpng=builtin",
])
.env("CXXFLAGS", &configure_cxx_flags) .env("CXXFLAGS", &configure_cxx_flags)
.spawn() .spawn()
.expect("failed to execute configure") .expect("failed to execute configure")
@ -297,7 +303,12 @@ fn convert_fat_libraries_to_arm(lib_dir: &Path) {
{ {
let path = entry.expect("unable to unwrap glob entry"); let path = entry.expect("unable to unwrap glob entry");
if path.file_name().unwrap_or_default().to_string_lossy().contains("-arm.a") { if path
.file_name()
.unwrap_or_default()
.to_string_lossy()
.contains("-arm.a")
{
println!("skipping {} as it's already arm", path.to_string_lossy()); println!("skipping {} as it's already arm", path.to_string_lossy());
continue; continue;
} }
@ -310,7 +321,10 @@ fn convert_fat_libraries_to_arm(lib_dir: &Path) {
let lipo_output = String::from_utf8_lossy(&lipo_output.stdout); let lipo_output = String::from_utf8_lossy(&lipo_output.stdout);
let lipo_output = lipo_output.trim(); let lipo_output = lipo_output.trim();
if !lipo_output.contains("Fat header") { if !lipo_output.contains("Fat header") {
println!("skipping {} as it's not a fat library", path.to_string_lossy()); println!(
"skipping {} as it's not a fat library",
path.to_string_lossy()
);
continue; continue;
} }
@ -322,10 +336,7 @@ fn convert_fat_libraries_to_arm(lib_dir: &Path) {
std::fs::rename(&path, &renamed_file).expect("unable to rename fat library"); std::fs::rename(&path, &renamed_file).expect("unable to rename fat library");
println!( println!("converting {} to arm", path.to_string_lossy(),);
"converting {} to arm",
path.to_string_lossy(),
);
let result = std::process::Command::new("lipo") let result = std::process::Command::new("lipo")
.args(&[ .args(&[
@ -341,7 +352,6 @@ fn convert_fat_libraries_to_arm(lib_dir: &Path) {
if !result.status.success() { if !result.status.success() {
panic!("unable to convert fat library to arm64 version"); panic!("unable to convert fat library to arm64 version");
} }
} }
} }