Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

fix(media-proxy): link source-built native libs first (#2442)

Hampusbaa18aed5b2a
diff --git a/fluxer_media_proxy/build.rs b/fluxer_media_proxy/build.rs
index 8c9fb6f4d..c6dc03c07 100644
--- a/fluxer_media_proxy/build.rs
+++ b/fluxer_media_proxy/build.rs
@@ -1,6 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-use std::{collections::HashSet, path::PathBuf, process::Command};
+use std::{collections::HashSet, path::Path, path::PathBuf, process::Command};
+
+fn is_distribution_lib_dir(path: &Path) -> bool {
+ let Some(path) = path.to_str() else {
+ return false;
+ };
+ path.starts_with("/usr/lib") || path.starts_with("/lib")
+}
const NATIVE_SHIM_SOURCES: [&str; 16] = [
"src/webp_animation.c",
@@ -131,8 +138,16 @@ fn main() {
shim.compile("fluxer_vips_shim");
+ let (source_built_link_paths, distribution_link_paths): (Vec<PathBuf>, Vec<PathBuf>) =
+ link_paths
+ .into_iter()
+ .partition(|path| !is_distribution_lib_dir(path));
+
let mut emitted_link_paths: HashSet<PathBuf> = HashSet::new();
- for path in link_paths {
+ for path in source_built_link_paths
+ .into_iter()
+ .chain(distribution_link_paths)
+ {
if !emitted_link_paths.insert(path.clone()) {
continue;
}