Skip to content

Declare static build's dependencies in OpenColorIO.pc#2328

Open
thiblahute wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
thiblahute:bugfix/static-pc-requires-private
Open

Declare static build's dependencies in OpenColorIO.pc#2328
thiblahute wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
thiblahute:bugfix/static-pc-requires-private

Conversation

@thiblahute

@thiblahute thiblahute commented Jul 15, 2026

Copy link
Copy Markdown

Summary

A static libOpenColorIO doesn't embed its own mandatory dependencies (expat, yaml-cpp, Imath, pystring, minizip-ng, ZLIB), so consumers using pkg-config have to hardcode that list themselves today.

This adds Requires.private to OpenColorIO.pc so pkg-config resolves those dependencies' own .pc files instead. Dependencies built from source via OCIO_INSTALL_EXT_PACKAGES already generate their own .pc file in the build tree (pystring is the one exception, so it gets a minimal generated one here too). Resolving Requires.private against them only works from that build tree, the same way pkg-config's -uninstalled convention works — a consumer wanting a standalone, relocatable install should point OCIO at system-provided copies of these dependencies instead.

A dependency found on the system instead of built from source falls back to Libs.private, since we can't assume it has a resolvable .pc file.

Verification

Verified with a from-scratch static build (-DBUILD_SHARED_LIBS=OFF -DOCIO_INSTALL_EXT_PACKAGES=ALL): the installed OpenColorIO.pc declares Requires.private: expat Imath pystring yaml-cpp minizip-ng zlib, and pkg-config --static --libs --cflags OpenColorIO correctly resolves the full transitive include/link flags on its own, given a PKG_CONFIG_PATH covering both the install prefix and the build tree's ext/dist pkg-config directories.

This is a build-system/packaging change rather than library functionality, so there's no ctest coverage to add for it; verification was done by inspecting the generated .pc files and running real pkg-config queries against them, as described above.

@linux-foundation-easycla

linux-foundation-easycla Bot commented Jul 15, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: thiblahute / name: Thibault Saunier (4f67a8a)

A static libOpenColorIO doesn't embed its own mandatory dependencies
(expat, yaml-cpp, Imath, pystring, minizip-ng, ZLIB), so consumers
using pkg-config have to hardcode that list themselves today.

This adds Requires.private to OpenColorIO.pc so pkg-config resolves
those dependencies' own .pc files instead. Dependencies built from
source via OCIO_INSTALL_EXT_PACKAGES already generate their own .pc
file in the build tree (pystring is the one exception, so it gets a
minimal generated one here too); resolving Requires.private against
them only works from that build tree, the same way pkg-config's
"-uninstalled" convention works. A consumer wanting a standalone,
relocatable install should point OCIO at system-provided copies of
these dependencies instead.

A dependency found on the system instead of built from source falls
back to Libs.private, since we can't assume it has a resolvable .pc
file.

On Apple platforms the ColorSync, CoreFoundation, CoreGraphics and
IOKit frameworks OpenColorIO links privately for its SystemMonitor
support are declared in Libs.private too; without them a static
consumer fails to link with missing _CGGetActiveDisplayList/
_ColorSync*/_IODisplay* symbols.

Verified with a static build: pkg-config --static --libs --cflags
OpenColorIO correctly resolves the full dependency chain on its own,
given a PKG_CONFIG_PATH covering both the install prefix and the
build tree's ext/dist pkg-config directories.

Signed-off-by: Thibault Saunier <tsaunier@igalia.com>
@thiblahute
thiblahute force-pushed the bugfix/static-pc-requires-private branch from 4f67a8a to 5525b11 Compare July 21, 2026 18:29
shalomwang pushed a commit to thiblahute/ocio-rs that referenced this pull request Jul 25, 2026
OCIO's SystemMonitor support privately links ColorSync, CoreFoundation,
CoreGraphics and IOKit on Apple platforms, and neither the static
libOpenColorIO.a nor the .pc file its CMake build generates records
that, so binaries consuming the archive failed to link on macOS with
missing _CGGetActiveDisplayList/_ColorSync*/_IODisplay* symbols.

This predates the system-deps migration (upstream CI only exercises
the bundled feature on ubuntu-latest); declare the frameworks next to
the other transitive static deps the .pc file doesn't know about.

The real fix belongs in OpenColorIO's OpenColorIO.pc:
AcademySoftwareFoundation/OpenColorIO#2328 adds Requires.private/
Libs.private for the static library deps, and the frameworks should
join its Libs.private. Both halves of add_transitive_static_libs can
shrink once a release carrying that is vendored.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant