ci: build OpenColorIO from the ocio-sys vendored source on every platform
The distro OCIO is too old for the bridge's API floor where it matters (Ubuntu 24.04 ships 2.1; the bridge uses 2.4+ APIs), and version drift across platforms is a support hazard — enable ocio-rs' bundled feature and drop the OCIO_INSTALL_DIR/system-package wiring from CI and CD so Linux, macOS and Windows all build the same vendored OCIO. cmake/make/ diffutils added where the runners lack them (Windows FFmpeg build needs make + cmp).
This commit is contained in:
+14
-14
@@ -32,22 +32,22 @@ jobs:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
tooling/install-deps.sh
|
||||
# Real OpenColorIO (ocio-sys real bridge) + rsvg-convert for the
|
||||
# app icon (cargo-packager needs PNG/icns/ico, the repo only has
|
||||
# cmake/make for the vendored OpenColorIO build (ocio-sys
|
||||
# `bundled`; Ubuntu's libopencolorio-dev is older than the
|
||||
# bridge's API floor) + rsvg-convert for the app icon
|
||||
# (cargo-packager needs PNG/icns/ico, the repo only has
|
||||
# Oak_Icon.svg).
|
||||
sudo apt-get install -y \
|
||||
libopencolorio-dev \
|
||||
cmake \
|
||||
librsvg2-bin \
|
||||
libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \
|
||||
libvulkan-dev libxkbcommon-dev
|
||||
|
||||
- name: Configure build environment
|
||||
run: |
|
||||
{
|
||||
echo "OCIO_RS_ENABLE_REAL=1"
|
||||
echo "OCIO_INSTALL_DIR=/usr"
|
||||
echo "OCIO_RS_LINK=dynamic"
|
||||
} >> "$GITHUB_ENV"
|
||||
# No OCIO_INSTALL_DIR on purpose: the vendored OpenColorIO is
|
||||
# built from source (see ci.yml).
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Cache cargo artifacts
|
||||
uses: Swatinem/rust-cache@v2
|
||||
@@ -129,14 +129,14 @@ jobs:
|
||||
- name: Install system dependencies
|
||||
run: |
|
||||
tooling/install-deps.sh
|
||||
brew install opencolorio librsvg
|
||||
brew install cmake librsvg
|
||||
|
||||
- name: Configure build environment
|
||||
run: |
|
||||
{
|
||||
# OCIO comes from the ocio-sys vendored source build (same on
|
||||
# every platform); no OCIO_INSTALL_DIR override.
|
||||
echo "OCIO_RS_ENABLE_REAL=1"
|
||||
echo "OCIO_INSTALL_DIR=/opt/homebrew/opt/opencolorio"
|
||||
echo "OCIO_RS_LINK=dynamic"
|
||||
echo "CFLAGS=-I/opt/homebrew/include"
|
||||
echo "LDFLAGS=-L/opt/homebrew/lib"
|
||||
echo "PKG_CONFIG_PATH=/opt/homebrew/lib/pkgconfig/openjpeg"
|
||||
@@ -229,14 +229,14 @@ jobs:
|
||||
run: |
|
||||
bash tooling/install-deps.sh
|
||||
pacman -S --needed --noconfirm \
|
||||
mingw-w64-ucrt-x86_64-opencolorio \
|
||||
mingw-w64-ucrt-x86_64-cmake \
|
||||
mingw-w64-ucrt-x86_64-librsvg
|
||||
|
||||
- name: Configure build environment
|
||||
run: |
|
||||
# OCIO comes from the ocio-sys vendored source build (same on
|
||||
# every platform); no OCIO_INSTALL_DIR override.
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_INSTALL_DIR=/ucrt64" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=dynamic" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Cache cargo artifacts
|
||||
uses: Swatinem/rust-cache@v2
|
||||
|
||||
+14
-11
@@ -47,10 +47,12 @@ jobs:
|
||||
# Codec/filter libraries for the ffmpeg-sys-next build feature
|
||||
# (see tooling/install-deps.sh).
|
||||
tooling/install-deps.sh
|
||||
# Real OpenColorIO (ocio-sys real bridge) plus the headless test
|
||||
# infra gpui needs: X11, software Mesa Vulkan (lavapipe) and xvfb.
|
||||
# cmake/make for the vendored OpenColorIO build (ocio-sys
|
||||
# `bundled`; Ubuntu's libopencolorio-dev is 2.1, older than the
|
||||
# bridge's API floor) plus the headless test infra gpui needs:
|
||||
# X11, software Mesa Vulkan (lavapipe) and xvfb.
|
||||
sudo apt-get install -y \
|
||||
libopencolorio-dev \
|
||||
cmake \
|
||||
libgl1-mesa-dev libgl1-mesa-dri mesa-vulkan-drivers \
|
||||
libvulkan-dev libxkbcommon-dev xvfb
|
||||
|
||||
@@ -58,7 +60,7 @@ jobs:
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
tooling/install-deps.sh
|
||||
brew install opencolorio
|
||||
brew install cmake
|
||||
|
||||
- name: Setup MSYS2 (Windows)
|
||||
if: runner.os == 'Windows'
|
||||
@@ -75,7 +77,7 @@ jobs:
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
bash tooling/install-deps.sh
|
||||
pacman -S --needed --noconfirm mingw-w64-ucrt-x86_64-opencolorio
|
||||
pacman -S --needed --noconfirm mingw-w64-ucrt-x86_64-cmake
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Build environment
|
||||
@@ -83,19 +85,20 @@ jobs:
|
||||
# ocio-sys builds a stub bridge unless these are set; the oakcommon
|
||||
# ocioutils tests need the real library (see crates/oakcommon/.cargo/
|
||||
# config.toml, which only applies to builds run from that directory).
|
||||
# ocio-sys builds its vendored OpenColorIO from source on Linux (the
|
||||
# `bundled` feature; the distro package is too old for the bridge),
|
||||
# so no OCIO_INSTALL_DIR here. macOS/Windows keep the system library.
|
||||
- name: Configure build environment (Linux)
|
||||
if: runner.os == 'Linux'
|
||||
run: |
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_INSTALL_DIR=/usr" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=dynamic" >> "$GITHUB_ENV"
|
||||
|
||||
- name: Configure build environment (macOS)
|
||||
if: runner.os == 'macOS'
|
||||
run: |
|
||||
# OCIO comes from the ocio-sys vendored source build (same on
|
||||
# every platform); no OCIO_INSTALL_DIR override.
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_INSTALL_DIR=/opt/homebrew/opt/opencolorio" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=dynamic" >> "$GITHUB_ENV"
|
||||
# Homebrew quirks: lame.pc / snappy / libopenjp2.pc live off the
|
||||
# default pkg-config search paths (see docs/build.md).
|
||||
echo "CFLAGS=-I/opt/homebrew/include" >> "$GITHUB_ENV"
|
||||
@@ -106,9 +109,9 @@ jobs:
|
||||
if: runner.os == 'Windows'
|
||||
shell: msys2 {0}
|
||||
run: |
|
||||
# OCIO comes from the ocio-sys vendored source build (same on
|
||||
# every platform); no OCIO_INSTALL_DIR override.
|
||||
echo "OCIO_RS_ENABLE_REAL=1" >> "$GITHUB_ENV"
|
||||
echo "OCIO_INSTALL_DIR=/ucrt64" >> "$GITHUB_ENV"
|
||||
echo "OCIO_RS_LINK=dynamic" >> "$GITHUB_ENV"
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Caches
|
||||
|
||||
@@ -26,8 +26,11 @@ toml = "0.8"
|
||||
# OpenColorIO bindings (crates.io `ocio-rs`, BSD-3-Clause). ocioutils.rs maps
|
||||
# PixelFormat to the real `ocio_rs::BitDepth` enum and wraps
|
||||
# `ocio_rs::Config`/`CPUProcessor` for config loading and RGBA transforms.
|
||||
# Rationale registered in README.md.
|
||||
ocio-rs = "0.2.1"
|
||||
# Rationale registered in README.md. The `bundled` feature builds the vendored
|
||||
# OpenColorIO from source — all platforms build the SAME OCIO version (distro
|
||||
# packages are too old for the bridge's API floor, e.g. Ubuntu 24.04's 2.1).
|
||||
# An explicit OCIO_INSTALL_DIR still wins over the vendored build when set.
|
||||
ocio-rs = { version = "0.2.1", features = ["bundled"] }
|
||||
# Pure-Rust image I/O (crates.io `image`, MIT OR Apache-2.0); default features
|
||||
# off, TIFF enabled — the only format current callers need. oiioutils.rs
|
||||
# derives per-channel bit depths from its color-type tables and does float
|
||||
|
||||
@@ -41,6 +41,7 @@ if [[ "$OSTYPE" == msys* || "$OSTYPE" == cygwin* || -n "${MSYSTEM:-}" ]]; then
|
||||
# --needed makes each retry resume where the last one stopped.
|
||||
for attempt in 1 2 3; do
|
||||
if run pacman -S --needed --noconfirm \
|
||||
make diffutils \
|
||||
mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-pkgconf \
|
||||
mingw-w64-ucrt-x86_64-nasm \
|
||||
mingw-w64-ucrt-x86_64-x264 mingw-w64-ucrt-x86_64-x265 \
|
||||
|
||||
Reference in New Issue
Block a user