package(install): refine relative path generation in .pc files#6597
Merged
waruqi merged 1 commit intoxmake-io:devfrom Jun 30, 2025
Merged
package(install): refine relative path generation in .pc files#6597waruqi merged 1 commit intoxmake-io:devfrom
waruqi merged 1 commit intoxmake-io:devfrom
Conversation
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.
A previous change (#6445) was introduced to improve the relocatability of packages by using relative paths in the generated
.pcfiles. However, this had an undesirable side effect when handling paths to external dependencies.The Problem
For a package like
libpngthat depends onzlib, the paths tozlibwere converted into deeply nested and fragile relative paths, which is not ideal.For example, the
Libsfield was changed as follows:This path
(${libdir}/../../...)is confusing and defeats the purpose of improving relocatability.The Solution
This PR fixes the issue by applying a more precise rule for path conversion:
Paths within the package's own installation directory (
installdir) are converted to be relative to${prefix}or${exec_prefix}.Paths outside of the package's
installdir(i.e., pointing to external dependencies) are kept as absolute paths.