Skip to content

install a pkg-config file (transcribe.pc) - #118

Open
shaba wants to merge 1 commit into
handy-computer:mainfrom
shaba:pkgconfig
Open

install a pkg-config file (transcribe.pc)#118
shaba wants to merge 1 commit into
handy-computer:mainfrom
shaba:pkgconfig

Conversation

@shaba

@shaba shaba commented Jul 28, 2026

Copy link
Copy Markdown

Summary

Installs transcribe.pc next to transcribe-link.json, under the same
TRANSCRIBE_INSTALL gate, for consumers that speak pkg-config rather than
CMake (meson, autotools, distro packages).

The manifest stays the source of truth: Libs and Libs.private are generated
from the same lists that feed it, so they cannot drift. --variable=linkmanifest
prints the manifest path, so consumers can find it without knowing the
lib/lib64 layout.

Scope

cmake/transcribe-install.cmake and the new cmake/transcribe.pc.in. Additive;
no-op when TRANSCRIBE_INSTALL is OFF.

AI Assistance

AI assisted with the implementation and validation; I reviewed, tested and own
the change.

Validation

Built and installed both shared and static; --validate passes. A toy C
consumer built from nothing but --cflags --libs (and --static --libs) links
and runs in both postures. --variable=linkmanifest resolves correctly,
including with an absolute CMAKE_INSTALL_LIBDIR.

Adds cmake/transcribe.pc.in and installs the configured transcribe.pc into
<libdir>/pkgconfig from the TRANSCRIBE_INSTALL rules, beside the link
manifest and under the same gate.

- for build systems that speak pkg-config rather than CMake or
  transcribe-link.json: meson, autotools, and distro -devel packages,
  which conventionally expect a .pc in every library package.
- Libs / Libs.private follow pkg-config semantics: Libs is what a consumer
  of the shared library needs (libtranscribe.so already carries DT_NEEDED
  on the ggml libraries, so -ltranscribe is enough), Libs.private is what a
  static link additionally drags in and is emitted only under --static. In
  a static build the whole archive set stays in Libs, in single-pass-ld
  order, so a plain --libs is not a broken link line. Both fields are
  generated from the same lists that feed the manifest, so the two cannot
  drift.
- the manifest is reachable from the .pc as well:
  `pkg-config --variable=linkmanifest transcribe` gives its absolute path,
  which lets a non-CMake consumer find it without knowing the lib/lib64
  layout or being handed a prefix out of band.
- libdir/includedir follow GNUInstallDirs and stay ${prefix}-relative, so
  pkg-config --define-prefix can relocate the install; they fall back to
  the absolute path when CMAKE_INSTALL_LIBDIR/INCLUDEDIR is given as one.
@shaba
shaba requested a review from cjpais as a code owner July 28, 2026 16:00
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