install a pkg-config file (transcribe.pc) - #118
Open
shaba wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Installs
transcribe.pcnext totranscribe-link.json, under the sameTRANSCRIBE_INSTALLgate, for consumers that speak pkg-config rather thanCMake (meson, autotools, distro packages).
The manifest stays the source of truth:
LibsandLibs.privateare generatedfrom the same lists that feed it, so they cannot drift.
--variable=linkmanifestprints the manifest path, so consumers can find it without knowing the
lib/lib64layout.Scope
cmake/transcribe-install.cmakeand the newcmake/transcribe.pc.in. Additive;no-op when
TRANSCRIBE_INSTALLis 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;
--validatepasses. A toy Cconsumer built from nothing but
--cflags --libs(and--static --libs) linksand runs in both postures.
--variable=linkmanifestresolves correctly,including with an absolute
CMAKE_INSTALL_LIBDIR.