ci: fix the Windows, Linux, macOS and ARM64 failures

- Windows: vcpkg ships `pkgconf` without the `pkg-config` shim, so the
  oak-ffmpeg-link build script failed with "program not found". Probe
  `pkg-config`, fall back to `pkgconf` (or honor `PKG_CONFIG`), and join
  the child's `PKG_CONFIG_PATH` with the platform separator instead of a
  hard-coded `:` (which split `C:\...` apart).
- Linux (and openKylin): the test binaries link the VAAPI stack via
  vcpkg's FFmpeg; install the `libva2`/`libva-drm2`/`libvdpau1` runtime
  packages the loader needs.
- macOS: bump the gpui submodule
  (OakVideoEditorCommunity/oak-gpui@fix/macos-metal-layer-and-dead-code):
  `setColorspace:` now sends to the `MetalLayerRef` (`self.layer.as_ref()`
  made `&*layer` the owned type, which is not `objc::Message`), and the
  viewer's `GpuFrameEntry` carries the non-Linux dead-code allowance.
- openKylin ARM64: switch the ocio patch to the fork's
  fix/aarch64-c-char rev. Upstream models C `char*` as `*const i8`;
  aarch64's `c_char` is u8, so the crates did not compile. The fix uses
  `c_char` throughout ocio-sys and the ocio-rs boundary (pushed as
  30338c6a169bbbada862fb3ac256e79b656159cf).
This commit is contained in:
2026-09-12 21:08:21 +08:00
parent 48e99e56b7
commit 4337559ed0
5 changed files with 52 additions and 31 deletions
+42 -23
View File
@@ -64,29 +64,48 @@ fn main() {
}
let pkg_path = env_or_dotenv("PKG_CONFIG_PATH").unwrap_or_default();
let output = Command::new("pkg-config")
.arg("--static")
.arg("--libs")
.args([
"libavformat",
"libavcodec",
"libavfilter",
"libavdevice",
"libavutil",
"libswscale",
"libswresample",
])
.env(
"PKG_CONFIG_PATH",
format!(
"{}{}{}",
pc_dir.display(),
if pkg_path.is_empty() { "" } else { ":" },
pkg_path
),
)
.output()
.expect("pkg-config is required when FFMPEG_DIR is set");
// The pkg-config child must see the FFMPEG_DIR .pc files. Join with the
// platform separator (`:` on Unix, `;` on Windows): formatting a `:`
// into a Windows `C:\...` path list makes pkgconf split the drive
// letter off.
let joined_path = {
let mut paths = vec![pc_dir.clone()];
if !pkg_path.is_empty() {
paths.extend(std::env::split_paths(&pkg_path));
}
std::env::join_paths(paths).unwrap_or_default()
};
const FFMPEG_LIBS: [&str; 7] = [
"libavformat",
"libavcodec",
"libavfilter",
"libavdevice",
"libavutil",
"libswscale",
"libswresample",
];
let run = |program: &str| {
Command::new(program)
.arg("--static")
.arg("--libs")
.args(FFMPEG_LIBS)
.env("PKG_CONFIG_PATH", &joined_path)
.output()
};
// vcpkg ships `pkgconf` on Windows without a `pkg-config` shim (macOS
// Homebrew ships both); fall back on the standard name first, then
// pkgconf. Only a missing program falls back — a pkg-config that runs
// and fails is a real error (bad .pc, missing libs) and must surface.
let output = match env_or_dotenv("PKG_CONFIG").filter(|p| !p.trim().is_empty()) {
Some(custom) => run(&custom).expect("PKG_CONFIG points at a program that failed to run"),
None => match run("pkg-config") {
Ok(output) => output,
Err(e) if e.kind() == std::io::ErrorKind::NotFound => {
run("pkgconf").expect("pkg-config/pkgconf is required when FFMPEG_DIR is set")
}
Err(e) => panic!("failed to run pkg-config: {e}"),
},
};
if !output.status.success() {
panic!(
"pkg-config --static --libs failed for the FFMPEG_DIR install: {}",